Java Reference
In-Depth Information
} else {
model.setStrokePaint(Color.DARKGRAY);
}
});
}
private static class Model {
private ObjectProperty<Paint> fillPaint = new SimpleObjectProperty<>();
private ObjectProperty<Paint> strokePaint = new SimpleObjectProperty<>();
private Model() {
fillPaint.set(Color.LIGHTGRAY);
strokePaint.set(Color.DARKGRAY);
}
final public Paint getFillPaint() {
return fillPaint.get();
}
final public void setFillPaint(Paint value) {
this.fillPaint.set(value);
}
final public Paint getStrokePaint() {
return strokePaint.get();
}
final public void setStrokePaint(Paint value) {
this.strokePaint.set(value);
}
final public ObjectProperty<Paint> fillPaintProperty() {
return fillPaint;
}
final public ObjectProperty<Paint> strokePaintProperty() {
return strokePaint;
}
}
private static class View {
public Rectangle rectangle;
public Button changeFillButton;
public Button changeStrokeButton;
public HBox buttonHBox;
public Scene scene;
private View(Model model) {
rectangle = new Rectangle(200, 200);
rectangle.setStrokeWidth(10);
rectangle.fillProperty().bind(model.fillPaintProperty());
rectangle.strokeProperty().bind(model.strokePaintProperty());
Search WWH ::




Custom Search