private void setFocusedSquare(ColorSquare square) { hoverSquare.setVisible(square != null); if (square == focusedSquare) { return; } focusedSquare = square; hoverSquare.setVisible(focusedSquare != null); if (focusedSquare == null) { return; } if (!focusedSquare.isFocused()) { focusedSquare.requestFocus(); } hoverSquare.rectangle.setFill(focusedSquare.rectangle.getFill()); Bounds b = square.localToScene(square.getLayoutBounds()); double x = b.getMinX(); double y = b.getMinY(); double xAdjust; double scaleAdjust = hoverSquare.getScaleX() == 1.0 ? 0 : hoverSquare.getWidth() / 4.0; if (colorPicker.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) { x = focusedSquare.getLayoutX(); xAdjust = -focusedSquare.getWidth() + scaleAdjust; } else { xAdjust = focusedSquare.getWidth() / 2.0 + scaleAdjust; } hoverSquare.setLayoutX(snapPosition(x) - xAdjust); hoverSquare.setLayoutY(snapPosition(y) - focusedSquare.getHeight() / 2.0 + (hoverSquare.getScaleY() == 1.0 ? 0 : focusedSquare .getHeight() / 4.0)); }
fillRect.setFill(Color.TRANSPARENT); text = new Text(); text.getStyleClass().setAll("text", "percentage");
public class ChatWindow extends Application { @Override public void start(final Stage stage) throws Exception { stage.initStyle(StageStyle.TRANSPARENT); // here it is Group rg = new Group(); Scene scene = new Scene(rg, 320, 240, Color.TRANSPARENT); stage.setScene(scene); stage.show(); Rectangle r = new Rectangle(5, 5, stage.getWidth() - 10, stage.getHeight() - 10); r.setFill(Color.STEELBLUE); r.setEffect(new DropShadow()); rg.getChildren().add(r); } public static void main(String[] args) { launch(); } }
/** * {@inheritDoc} */ @Override public void setTextBackground( Paint aTextBackground ) { _rect.setFill( aTextBackground ); }
public void setBackgroundFill(Paint color) { backgroundBar.setFill(color); }
public static Node warningDecoration(Color color) { Rectangle d = new Rectangle(7, 7); d.setFill(color); return d; } }
public static Node rectDecoration(Color color) { Rectangle d = new Rectangle(7, 7); d.setFill(color); return d; }
for(int i=1; i<=rows; i++) { for(int j=1; j<=cols; j++) { Rectangle r = new Rectangle(70, 70, Color.AQUA); r.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent t) { r.setFill(Color.RED); } }); grid.add(r, j, i); } }
for(int i=1; i<=rows; i++) { for(int j=1; j<=cols; j++) { Rectangle r = new Rectangle(70, 70, Color.AQUA); r.setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent t) { r.setFill(Color.RED); } }); grid.add(r, j, i); } }
@Override protected Node createBackground(double width, double height) { Rectangle bg = new Rectangle(width, height); bg.setFill(Color.rgb(10, 1, 1)); return bg; }
public void setBackgroundPaint(Paint paint) { undecorator.removeDefaultBackgroundStyleClass(); undecorator.getBackgroundNode().setFill(paint); }
public void setFill(Color color) { innerBar.setFill(color); DropShadow ds = new DropShadow(15, color); ds.setInput(new Glow(0.5)); innerBar.setEffect(ds); }
private Rectangle buidlRectangle(double stroke) { Rectangle r = new Rectangle(); r.setStrokeType(StrokeType.INSIDE); r.setStrokeWidth(stroke); r.setStroke(Color.RED); r.setFill(Color.TRANSPARENT); return r; }
private Rectangle buidlRectangle(double stroke) { Rectangle r = new Rectangle(); r.setStrokeType(StrokeType.INSIDE); r.setStrokeWidth(stroke); r.setStroke(Color.RED); r.setFill(Color.TRANSPARENT); return r; }
public void setFill(Color color) { innerBar.setFill(color); DropShadow ds = new DropShadow(15, color); ds.setInput(new Glow(0.5)); innerBar.setEffect(ds); }
public DragButton(@Nonnull String text) { setCursor(Cursor.W_RESIZE); rectangle = new Rectangle(); rectangle.setFill(Color.GRAY); rectangle.setArcHeight(5.0); rectangle.setArcWidth(5.0); line = new Line(); label = Components.label(text); label.setTextFill(Color.WHITE); getChildren().addAll(rectangle, line, label); }
public VCanvas() { Rectangle rect = new Rectangle(); rect.setStroke(new Color(1, 1, 1, 1)); rect.setFill(new Color(0, 0, 0, 0.5)); contentProperty().addListener((ov, oldV, newV) -> { if (newV != null) { MouseControlUtil. addSelectionRectangleGesture((Parent) newV, rect); } }); setContent(innerCanvas); getStyleClass().add("vflow-background"); }
public PlaceHolderSkin(PlaceHolder control) { super(control); Rectangle area = new Rectangle(control.getX(), control.getY(), control.getLocalWidth(), control.getLocalHeight()); area.setFill(Color.TRANSPARENT); area.xProperty().bind(control.xProperty()); area.yProperty().bind(control.yProperty()); area.widthProperty().bind(control.widthLocalProperty()); area.heightProperty().bind(control.heightLocalProperty()); Group g = new Group(area); getChildren().add(g); }
public SwitchSymbol(Color stroke, double strokeWidth, double size) { setPrefSize(size, size); leg1 = new Line(); leg1.setFill(stroke); leg1.setStroke(stroke); leg1.setStrokeWidth(strokeWidth); leg2 = new Line(); leg2.setFill(stroke); leg2.setStroke(stroke); leg2.setStrokeWidth(strokeWidth); box = new Rectangle(); box.setFill(Color.TRANSPARENT); box.setStroke(stroke); box.setStrokeWidth(strokeWidth); getChildren().addAll(leg1, leg2, box); }