Java Reference
In-Depth Information
public Color getStroke() {
return stroke.get();
}
public void setStroke(Color value) {
this.stroke.set(value);
}
public ObjectProperty<Color> fillProperty() {
return fill;
}
public ObjectProperty<Color> strokeProperty() {
return stroke;
}
}
private static class View {
public Display display;
public Shell frame;
public FXCanvas canvas;
public Button changeFillButton;
public Button changeStrokeButton;
public Label mouseLocation;
public boolean mouseInCanvas;
public Rectangle rectangle;
private View(final Model model) {
this.display = new Display();
frame = new Shell(display);
frame.setText("JavaFX in SWT Example");
RowLayout frameLayout = new RowLayout(SWT.VERTICAL);
frameLayout.spacing = 10;
frameLayout.center = true;
frame.setLayout(frameLayout);
Composite canvasPanel = new Composite(frame, SWT.NONE);
RowLayout canvasPanelLayout = new RowLayout(SWT.VERTICAL);
canvasPanelLayout.spacing = 10;
canvasPanel.setLayout(canvasPanelLayout);
canvas = new FXCanvas(canvasPanel, SWT.NONE);
rectangle = new Rectangle(200, 200);
rectangle.setStrokeWidth(10);
VBox vBox = new VBox(rectangle);
Scene scene = new Scene(vBox, 210, 210);
canvas.setScene(scene);
rectangle.fillProperty().bind(model.fillProperty());
rectangle.strokeProperty().bind(model.strokeProperty());
Search WWH ::




Custom Search