use of com.fxexperience.javafx.scene.control.paintpicker.PaintPicker in project fxexperience2 by EricCanull.
the class PopupEditor method initializePopup.
private void initializePopup(Object startColor) {
setText(getPreviewString(startColor));
color.set((Color) startColor);
this.textProperty().bind(new StringBinding() {
{
bind(color);
}
@Override
protected String computeValue() {
return getWebColor();
}
});
this.showingProperty().addListener((ov, previousVal, newVal) -> {
if (newVal) {
if (!initialized) {
paintPicker = new PaintPicker(Mode.COLOR);
editorHost.getChildren().add(getPopupContentNode());
paintPicker.paintProperty().addListener(paintChangeListener);
}
paintPicker.setPaintProperty(color.get());
}
});
rectangle.fillProperty().bind(new ObjectBinding<Paint>() {
{
bind(color);
}
@Override
protected Paint computeValue() {
return getColor();
}
});
}
Aggregations