@Override protected void handleControlPropertyChanged(String p) { if ("TOGGLE_COLOR".equals(p)) { if (getSkinnable().isSelected()) { circle.setFill(((JFXToggleButton) getSkinnable()).getToggleColor()); } } else if ("UNTOGGLE_COLOR".equals(p)) { if (!getSkinnable().isSelected()) { circle.setFill(((JFXToggleButton) getSkinnable()).getUnToggleColor()); } } else if ("TOGGLE_LINE_COLOR".equals(p)) { if (getSkinnable().isSelected()) { line.setStroke(((JFXToggleButton) getSkinnable()).getToggleLineColor()); } } else if ("UNTOGGLE_LINE_COLOR".equals(p)) { if (!getSkinnable().isSelected()) { line.setStroke(((JFXToggleButton) getSkinnable()).getUnToggleLineColor()); } } else { super.handleControlPropertyChanged(p); } }
minCircle.setFill(Color.rgb(255, 255, 255, 0.87)); minCircle.setTranslateX(selectionCircle.getRadius() - minCircle.getRadius()); minCircle.setVisible(time.getMinute() % 5 != 0);
protected BorderPane createContentPane(LocalTime time, boolean _24HourView) { Circle circle = new Circle(contentCircleRadius), selectionCircle = new Circle(contentCircleRadius / 6); circle.setFill(Color.rgb(224, 224, 224, 0.67));
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }
radio.getStyleClass().setAll("radio"); radio.setStrokeWidth(2); radio.setFill(Color.TRANSPARENT); radio.setSmooth(true);
circle.setFill(getSkinnable().isSelected() ? toggleButton.getToggleColor() : toggleButton.getUnToggleColor()); circle.setCenterX(-circleRadius); circle.setCenterY(0);
public TransformerSymbol(Color stroke, double strokeWidth, double size) { setPrefSize(size, size); c1 = new Circle(); c1.setFill(Color.TRANSPARENT); c1.setStroke(stroke); c1.setStrokeWidth(strokeWidth); c2 = new Circle(); c2.setFill(Color.TRANSPARENT); c2.setStroke(stroke); c2.setStrokeWidth(strokeWidth); getChildren().addAll(c1, c2); }
@Override @Pure public Node drawShape(MapCircle element, RectangularShape2afp<?, ?, ?, ?, ?, ?> bounds) { final Circle circle = createCircle(element, bounds); final Color color = GisFxTools.rgb(element.getColor()); circle.setFill(color); circle.setStroke(color); return circle; }
/** * Constructor * * @param labelString */ @Override public void setStep(IWizardStep step) { this.step = step; circle.setFill(Color.rgb(148, 148, 148)); circle.setOpacity(0.57); indexLabel.setText(String.valueOf(step.getIndex())); indexLabel.getStyleClass().add(WIZARD_VERTICAL_STEPPER_INDEX_LABEL_CSS); circleContainer.getChildren().addAll(circle, indexLabel); titleLabel.getStyleClass().add(WIZARD_VERTICAL_STEPPER_LABEL_CSS); titleLabel.setText(step.getTitle()); titleLabel.setWrapText(true); getChildren().add(0, circleContainer); getChildren().add(1, titleLabel); }
/** * @{inheritedDoc} */ @Override public void setError() { circle.setFill(Color.RED); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), false); bridge.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); error = true; valid = null; }
/** * @{inheritedDoc} */ @Override public void setValid() { circle.setFill(Color.GREEN); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), true); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), false); bridge.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), true); indexLabel.setText(String.valueOf(step.getIndex())); error = null; valid = true; }
/** * Constructor * * @param labelString */ @Override public void setStep(IWizardStep step) { this.step = step; circle.setFill(Color.rgb(148, 148, 148)); indexLabel.setText(String.valueOf(step.getIndex())); indexLabel.getStyleClass().add(WIZARD_HORIZONTAL_STEPPER_INDEX_LABEL_CSS); circleContainer.getChildren().addAll(circle, indexLabel); titleLabel.getStyleClass().add(WIZARD_HORIZONTAL_STEPPER_LABEL_CSS); titleLabel.setText(step.getTitle()); getChildren().add(0, circleContainer); getChildren().add(1, titleLabel); step.validProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if(!newValue) { setError(); } else { setValid(); } }}); }
/** * @{inheritedDoc} */ @Override public void setValid() { circle.setFill(Color.GREEN); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), true); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), false); bridge.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), true); indexLabel.setText(""); error = null; valid = true; }
/** * @{inheritedDoc} */ @Override public void setError() { circle.setFill(Color.RED); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("valid"), false); bridge.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); indexLabel.setText(""); error = true; valid = null; }
/** * @{inheritedDoc} */ @Override public void select(boolean value) { pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); if (value) { titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); indexLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); if (value) { circle.setFill(Color.rgb(33, 150, 243)); } } // have been validated and is error // and selected!! should not be happen // only move to next step if valid if (error == null) { } // back or next to a valid step // do not change the valid state on the circle icon if (valid != null) { titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); } }
/** * @{inheritedDoc} */ @Override public void select(boolean value) { pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); if (value) { titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); indexLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); if (value) { circle.setFill(Color.rgb(33, 150, 243)); } } // have been validated and is error // and selected!! should not be happen // only move to next step if valid if (error == null) { } // back or next to a valid step // do not change the valid state on the circle icon if (valid != null) { titleLabel.pseudoClassStateChanged(PseudoClass.getPseudoClass("selected"), value); } }
/** * draw a circle with given text on the given pane * * @param pane * @param text * @param radius * @param color * @param x * @param y */ public static Circle drawCircleWithText(Pane pane, String text, double radius, Color color, double x, double y) { Circle circle = new Circle(); circle.setRadius(radius); circle.setFill(color); circle.setTranslateX(x); circle.setTranslateY(y); Label label = new Label(text); label.setTranslateX(x + radius); label.setTranslateY(y + radius); label.setTextFill(color); pane.getChildren().addAll(circle, label); return circle; }
circle.setFill(Color.color(0.52, 0.80, 0.92));
public GeneratorSymbol(Color stroke, double strokeWidth, double size) { setPrefSize(size, size); c = new Circle(); c.setFill(Color.TRANSPARENT); c.setStroke(stroke); c.setStrokeWidth(strokeWidth); a1 = new Arc(); a1.setStartAngle(0); a1.setLength(180); a1.setFill(Color.TRANSPARENT); a1.setStroke(stroke); a1.setStrokeWidth(strokeWidth); a2 = new Arc(); a2.setStartAngle(0); a2.setLength(-180); a2.setFill(Color.TRANSPARENT); a2.setStroke(stroke); a2.setStrokeWidth(strokeWidth); getChildren().addAll(c, a1, a2); }
private void updateColor() { final ColorPicker colorPicker = (ColorPicker) getSkinnable(); Color color = colorPicker.getValue(); // update picker box color Color circleColor = color == null ? Color.WHITE : color; Circle colorCircle = new Circle(); colorCircle.setFill(circleColor); colorCircle.setLayoutX(colorBox.getWidth() / 4); colorCircle.setLayoutY(colorBox.getHeight() / 2); colorBox.getChildren().add(colorCircle); Timeline animateColor = new Timeline(new KeyFrame(Duration.millis(240), new KeyValue(colorCircle.radiusProperty(), 200, Interpolator.EASE_BOTH))); animateColor.setOnFinished((finish) -> { JFXNodeUtils.updateBackground(colorBox.getBackground(), colorBox, colorCircle.getFill()); colorBox.getChildren().remove(colorCircle); }); animateColor.play(); // update label color displayNode.setTextFill(circleColor.grayscale().getRed() < 0.5 ? Color.valueOf( "rgba(255, 255, 255, 0.87)") : Color.valueOf("rgba(0, 0, 0, 0.87)")); if (colorLabelVisible.get()) { displayNode.setText(JFXNodeUtils.colorToHex(circleColor)); } else { displayNode.setText(""); } }