| package org.eclipse.nebula.widgets.nattable.renderer.javafx |
| |
| import javafx.application.Application |
| import javafx.scene.Scene |
| import javafx.scene.layout.Pane |
| import javafx.stage.Stage |
| import org.eclipse.nebula.widgets.nattable.core.layer.Layer |
| import org.eclipse.nebula.widgets.nattable.core.layer.axis.impl.AxisImpl |
| import org.eclipse.nebula.widgets.nattable.core.layer.impl.DummyLayer |
| |
| class JavaFXExample extends Application { |
| |
| def static void main(String[] args) { |
| launch(args) |
| } |
| |
| override start(Stage primaryStage) { |
| primaryStage.title = "NatTable -> JavaFX" |
| val root = new Pane |
| |
| val natTable = new JavaFXNatTable(layer, 300, 250) |
| |
| root.children += natTable |
| |
| primaryStage.scene = new Scene(root) |
| primaryStage.show |
| |
| natTable.widthProperty.bind(root.widthProperty) |
| natTable.heightProperty.bind(root.heightProperty) |
| } |
| |
| def Layer getLayer() { |
| new DummyLayer( |
| new AxisImpl(4, 200), |
| new AxisImpl(4, 100) |
| ) |
| } |
| |
| } |