button.setMinSize(30,30); button.setMaxSize(30,30); button.ripplerFillProperty().bind(glyphDetailViewer.colorPicker.valueProperty()); glyphDetailViewer.colorPicker.valueProperty().addListener((o, oldVal, newVal) -> { String webColor = "#" + Integer.toHexString(newVal.hashCode()).substring(0, 6).toUpperCase(); Consumer<String> lookupConsumer = lookup->{
private void refreshView() { if (glyph.getValue() == null) { idLabel.setText(""); nameLabel.setText(""); return; } sizeSlider.valueProperty().addListener(observable -> glyph.get().setSize(sizeSlider.getValue())); idLabel.setText(String.format("%04d", glyph.get().getGlyphId())); nameLabel.setText(glyph.get().getName()); glyph.get().setFill(colorPicker.getValue()); glyph.get().fillProperty().bind(colorPicker.valueProperty()); centeredGlyph.getChildren().setAll(glyph.get()); }
registerChangeListener(colorPicker.valueProperty(), "VALUE"); colorLabelVisible.addListener(invalidate -> { if (displayNode != null) {
}); customColorDialog.setCurrentColor(colorPicker.valueProperty().get()); if (popupControl != null) { popupControl.setAutoHide(false);
ObjectProperty<Paint> op = label.textFillProperty(); ColorPicker cp = new ColorPicker(Color.GRAY); ... op.bind(cp.valueProperty());
@Override protected ObservableValue<Color> getObservableValue() { return getEditor().valueProperty(); }
private void unbindColorProperties() { ObjectProperty<Color>[] lightProps = cssLightConfig.getColorProperties(); picker1.valueProperty().unbindBidirectional(lightProps[0]); picker2.valueProperty().unbindBidirectional(lightProps[1]); picker3.valueProperty().unbindBidirectional(lightProps[2]); ObjectProperty<Color>[] darkProps = cssDarkConfig.getColorProperties(); picker1.valueProperty().unbindBidirectional(darkProps[0]); picker2.valueProperty().unbindBidirectional(darkProps[1]); picker3.valueProperty().unbindBidirectional(darkProps[2]); }
@Override public Node createValueVisualisation() { ColorPicker colorPicker = new ColorPicker(); colorPicker.valueProperty().bindBidirectional(observableAttributeValue); return colorPicker; } }
public void updateColorControls() { Type type = currentCssConfig.getType(); unbindColorProperties(); if(type == Type.CSS) { cssUrlGroup.setVisible(true); cssColorGroup.setVisible(false); cssUrl.setText(currentCssConfig.getCssUrl()); } else { cssColorGroup.setVisible(true); cssUrlGroup.setVisible(false); ObjectProperty<Color>[] props = currentCssConfig.getColorProperties(); picker1.valueProperty().bindBidirectional(props[0]); picker2.valueProperty().bindBidirectional(props[1]); picker3.valueProperty().bindBidirectional(props[2]); refreshPickers(); } }
colorPicker.valueProperty().addListener((observable, oldColor, newColor) -> textArea.setStyle( "-fx-text-fill: " + toRgbString(newColor) + ";"
private ColorPicker createBaseColorPicker() { ColorPicker colorPicker = new ColorPicker(Color.TRANSPARENT); colorPicker.getCustomColors().addAll(Color.TRANSPARENT, Color.web("#f3622d"), Color.web("#fba71b"), Color.web("#57b757"), Color.web("#41a9c9"), Color.web("#888"), Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.CYAN, Color.BLUE, Color.PURPLE, Color.MAGENTA, Color.BLACK); colorPicker.valueProperty().addListener(new ChangeListener<Color>() { @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) { setBaseColor(c); } }); return colorPicker; }
private ColorPicker createBackgroundColorPicker() { ColorPicker colorPicker = new ColorPicker(Color.TRANSPARENT); colorPicker.getCustomColors().addAll(Color.TRANSPARENT, Color.web("#f3622d"), Color.web("#fba71b"), Color.web("#57b757"), Color.web("#41a9c9"), Color.web("#888"), Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.CYAN, Color.BLUE, Color.PURPLE, Color.MAGENTA, Color.BLACK); colorPicker.valueProperty().addListener(new ChangeListener<Color>() { @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) { if (c == null) { backgroundColor = null; } else { backgroundColor = c; } updateUserAgentStyleSheet(); } }); return colorPicker; }
private ColorPicker createAccentColorPicker() { ColorPicker colorPicker = new ColorPicker(Color.web("#0096C9")); colorPicker.getCustomColors().addAll(Color.TRANSPARENT, Color.web("#0096C9"), Color.web("#4fb6d6"), Color.web("#f3622d"), Color.web("#fba71b"), Color.web("#57b757"), Color.web("#41a9c9"), Color.web("#888"), Color.RED, Color.ORANGE, Color.YELLOW, Color.GREEN, Color.CYAN, Color.BLUE, Color.PURPLE, Color.MAGENTA, Color.BLACK); colorPicker.valueProperty().addListener(new ChangeListener<Color>() { @Override public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color c) { setAccentColor(c); } }); return colorPicker; }
/** * Setup of the binding between the view model and the UI controls. */ private void setupBinding() { tfName.textProperty().bindBidirectional(sportTypeViewModel.name); cbRecordDistance.selectedProperty().bindBidirectional(sportTypeViewModel.recordDistance); cbSpeedMode.valueProperty().bindBidirectional(sportTypeViewModel.speedMode); cpColor.valueProperty().bindBidirectional(sportTypeViewModel.color); // the record distance mode can only be changed, when no exercises exists for // this sport type => disable checkbox, when such exercises were found Optional<Exercise> oExercise = document.getExerciseList().stream() .filter(exercise -> exercise.getSportType().getId() == sportTypeViewModel.id) .findFirst(); cbRecordDistance.setDisable(oExercise.isPresent()); // speed mode can only be configured when distance is being recorded cbSpeedMode.disableProperty().bind(cbRecordDistance.selectedProperty().not()); // Edit and Delete buttons must be disabled when there is no selection in the appropriate list final BooleanBinding sportSubtypeSelected = Bindings.isNull( liSportSubtypes.getSelectionModel().selectedItemProperty()); btSportSubtypeEdit.disableProperty().bind(sportSubtypeSelected); btSportSubtypeDelete.disableProperty().bind(sportSubtypeSelected); final BooleanBinding equipmentSelected = Bindings.isNull( liEquipments.getSelectionModel().selectedItemProperty()); btEquipmentEdit.disableProperty().bind(equipmentSelected); btEquipmentDelete.disableProperty().bind(equipmentSelected); }
@Override public void changed(ObservableValue<? extends AuditralColorMapping> observable, AuditralColorMapping oldValue, AuditralColorMapping newValue) { if (oldValue != null) { colorDetail.valueProperty().unbindBidirectional(oldValue.color); occurrenceDetail.textProperty().unbindBidirectional(oldValue.occurrenceRegEx); loglevelDetail.textProperty().unbindBidirectional(oldValue.loglevelRegEx); workflowidDetail.textProperty().unbindBidirectional(oldValue.workflowInstanceIdRegEx); correlationidDetail.textProperty().unbindBidirectional(oldValue.correlationIdRegEx); conversionidDetail.textProperty().unbindBidirectional(oldValue.conversationIdRegEx); messageTypDetail.textProperty().unbindBidirectional(oldValue.messageTypeRegEx); idDetail.textProperty().unbindBidirectional(oldValue.idRegEx); } if (newValue != null) { colorDetail.valueProperty().bindBidirectional(newValue.color); occurrenceDetail.textProperty().bindBidirectional(newValue.occurrenceRegEx); loglevelDetail.textProperty().bindBidirectional(newValue.loglevelRegEx); workflowidDetail.textProperty().bindBidirectional(newValue.workflowInstanceIdRegEx); correlationidDetail.textProperty().bindBidirectional(newValue.correlationIdRegEx); conversionidDetail.textProperty().bindBidirectional(newValue.conversationIdRegEx); messageTypDetail.textProperty().bindBidirectional(newValue.messageTypeRegEx); idDetail.textProperty().bindBidirectional(newValue.idRegEx); colorDetail.fireEvent(new ActionEvent());// javafx bug workaround else color chooser wont update // http://javafx-jira.kenai.com/browse/RT-26633 } } });
public StopColorPane(BiConsumer<Stop, Stop> consumer) { setText(Messages.getString("PaintEditor.ColorStop")); //$NON-NLS-1$ this.consumer = consumer; setCollapsible(false); setDisable(true); GridLayoutPane p = new GridLayoutPane(); p.setNumColumns(2); { this.picker = new ColorPicker(); this.picker.valueProperty().addListener(this::update); GridLayoutPane.setConstraint(this.picker, new GridData(GridData.FILL_HORIZONTAL)); p.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), this.picker); //$NON-NLS-1$ } { this.f = new TextField(); this.f.textProperty().addListener(this::update); GridLayoutPane.setConstraint(this.f, new GridData(GridData.FILL_HORIZONTAL)); p.getChildren().addAll(new Label(Messages.getString("PaintEditor.Offset")), this.f); //$NON-NLS-1$ } setContent(p); }
public StopColorPane(BiConsumer<Stop, Stop> consumer) { setText(Messages.getString("PaintEditor.ColorStop")); //$NON-NLS-1$ this.consumer = consumer; setCollapsible(false); setDisable(true); GridLayoutPane p = new GridLayoutPane(); p.setNumColumns(2); { this.picker = new ColorPicker(); this.picker.valueProperty().addListener(this::update); GridLayoutPane.setConstraint(this.picker, new GridData(GridData.FILL_HORIZONTAL)); p.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), this.picker); //$NON-NLS-1$ } { this.f = new TextField(); this.f.textProperty().addListener(this::update); GridLayoutPane.setConstraint(this.f, new GridData(GridData.FILL_HORIZONTAL)); p.getChildren().addAll(new Label(Messages.getString("PaintEditor.Offset")), this.f); //$NON-NLS-1$ } setContent(p); }
registerChangeListener(colorPicker.valueProperty(), obs-> updateColor());
private Tab createColorTab() { Tab t = new Tab(); t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$ GridLayoutPane p = new GridLayoutPane(); p.setNumColumns(3); Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE); this.solidPreview = solidPreview; GridLayoutPane dataPane = new GridLayoutPane(); dataPane.setNumColumns(2); ColorPicker picker = new ColorPicker(); picker.valueProperty().addListener((o) -> { solidPreview.setFill(picker.getValue()); this.paint.set(picker.getValue()); }); dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$ Color color = (Color) this.paint.get(); if (color instanceof Color) { picker.setValue(color); } TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$ dtp.setCollapsible(false); TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$ pane.setCollapsible(false); GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true)); GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false)); p.getChildren().addAll(pane, dtp); t.setContent(p); return t; }
private Tab createColorTab() { Tab t = new Tab(); t.setText(Messages.getString("PaintEditor.Color")); //$NON-NLS-1$ GridLayoutPane p = new GridLayoutPane(); p.setNumColumns(3); Rectangle solidPreview = new Rectangle(PREVIEW_SIZE, PREVIEW_SIZE); this.solidPreview = solidPreview; GridLayoutPane dataPane = new GridLayoutPane(); dataPane.setNumColumns(2); ColorPicker picker = new ColorPicker(); picker.valueProperty().addListener((o) -> { solidPreview.setFill(picker.getValue()); this.paint.set(picker.getValue()); }); dataPane.getChildren().addAll(new Label(Messages.getString("PaintEditor.Color")), picker); //$NON-NLS-1$ Color color = (Color) this.paint.get(); if (color instanceof Color) { picker.setValue(color); } TitledPane dtp = new TitledPane(Messages.getString("PaintEditor.Data"), dataPane); //$NON-NLS-1$ dtp.setCollapsible(false); TitledPane pane = new TitledPane(Messages.getString("PaintEditor.Preview"), solidPreview); //$NON-NLS-1$ pane.setCollapsible(false); GridLayoutPane.setConstraint(dtp, new GridData(Alignment.FILL, Alignment.FILL, true, true)); GridLayoutPane.setConstraint(pane, new GridData(Alignment.BEGINNING, Alignment.BEGINNING, false, false)); p.getChildren().addAll(pane, dtp); t.setContent(p); return t; }