/** * {@inheritDoc} */ @Override public void setTextBorderColor( Paint aTextBorderColor ) { _rect.setStroke( aTextBorderColor ); }
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; }
@Override protected void updateItem(Stop item, boolean empty) { super.updateItem(item, empty); if( item != null && ! empty ) { Rectangle r = new Rectangle(20,20,item.getColor()); r.setStrokeWidth(1); r.setStroke(Color.BLACK); setGraphic(r); setText(FORMAT.format(item.getOffset()*100)+"%"); //$NON-NLS-1$ } else { setGraphic(null); setText(null); } } }
@Override protected void updateItem(Stop item, boolean empty) { super.updateItem(item, empty); if( item != null && ! empty ) { Rectangle r = new Rectangle(20,20,item.getColor()); r.setStrokeWidth(1); r.setStroke(Color.BLACK); setGraphic(r); setText(FORMAT.format(item.getOffset()*100)+"%"); //$NON-NLS-1$ } else { setGraphic(null); setText(null); } } }
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 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 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); }
selectRect.setMouseTransparent( true ); selectRect.setOpacity( 0.3 ); selectRect.setStroke( Color.rgb( 0, 0x29, 0x66 ) ); selectRect.setStrokeType( StrokeType.INSIDE ); selectRect.setStrokeWidth( 3.0 );
/** * Creates a default ColorGridCell instance. */ public ColorGridCell() { getStyleClass().add("color-grid-cell"); //$NON-NLS-1$ colorRect = new Rectangle(); colorRect.setStroke(Color.BLACK); colorRect.heightProperty().bind(heightProperty()); colorRect.widthProperty().bind(widthProperty()); setGraphic(colorRect); if (debug) { setContentDisplay(ContentDisplay.TEXT_ONLY); } }
/** * Prepare Stage for dock feedback display */ void buildDockFeedbackStage() { dockFeedbackPopup = new Stage(StageStyle.TRANSPARENT); dockFeedback = new Rectangle(0, 0, 100, 100); dockFeedback.setArcHeight(10); dockFeedback.setArcWidth(10); dockFeedback.setFill(Color.TRANSPARENT); dockFeedback.setStroke(Color.BLACK); dockFeedback.setStrokeWidth(2); dockFeedback.setCache(true); dockFeedback.setCacheHint(CacheHint.SPEED); dockFeedback.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 10, 0.2, 3, 3)); dockFeedback.setMouseTransparent(true); BorderPane borderpane = new BorderPane(); borderpane.setStyle("-fx-background-color:transparent"); // J8 borderpane.setCenter(dockFeedback); Scene scene = new Scene(borderpane); scene.setFill(Color.TRANSPARENT); dockFeedbackPopup.setScene(scene); dockFeedbackPopup.sizeToScene(); }
r1.setStroke(Color.BLACK);
PressAnyKeyState() { getInput().addEventHandler(KeyEvent.KEY_PRESSED, e -> { if (Input.isIllegal(e.getCode())) return; boolean rebound = FXGL.getInput().rebind(actionContext, e.getCode(), InputModifier.from(e)); if (rebound) FXGL.getStateMachine().popState(); }); getInput().addEventHandler(MouseEvent.MOUSE_PRESSED, e -> { boolean rebound = FXGL.getInput().rebind(actionContext, e.getButton(), InputModifier.from(e)); if (rebound) FXGL.getStateMachine().popState(); }); Rectangle rect = new Rectangle(250, 100); rect.setStroke(Color.color(0.85, 0.9, 0.9, 0.95)); rect.setStrokeWidth(10); rect.setArcWidth(15); rect.setArcHeight(15); Text text = getUIFactory().newText(getLocalizedString("menu.pressAnyKey"), 24); StackPane pane = new StackPane(rect, text); pane.setTranslateX(FXGL.getAppWidth() / 2 - 125); pane.setTranslateY(FXGL.getAppHeight() / 2 - 50); getChildren().add(pane); } }
rectangle.setStroke(Color.DARKGREY); rectangle.setArcHeight(4); rectangle.setArcWidth(6);
bg.setStroke(Color.WHITE); bg.setStrokeWidth(4); bg.setArcWidth(25);
/** * Constructs a {@link FxLabelDecorator} with the required minimum * attributes. * * @param aText The with which to initialize the cell. * @param aFontName The font name to be used when rendering. * @param aTextSizeFactor The factor to be used relative to the width of the * cell. * @param aNode The background image to be used. */ public FxLabelDecoratorImpl( String aText, String aFontName, double aTextSizeFactor, Node aNode ) { _text = aText; _fontName = aFontName; _textSizeFactor = aTextSizeFactor; _content = aNode; _textNode = new Text( aText ); _textNode.setFont( new Font( aFontName, PROBE_FONT_SIZE ) ); _textNode.setFill( DEFAULT_TEXT_COLOR ); _rect = new Rectangle( _textNode.getBoundsInLocal().getWidth(), _textNode.getBoundsInLocal().getHeight(), DEFAULT_TEXT_BACKGROUND_COLOR ); _rect.setStroke( DEFAULT_TEXT_BORDER_COLOR ); setBorder( null ); StackPane.setMargin( _content, null ); StackPane.setAlignment( _content, Pos.CENTER ); StackPane.setMargin( _rect, null ); StackPane.setAlignment( _rect, FxGraphicalUtility.toPos( _horizAlignTextMode, _vertAlignTextMode ) ); StackPane.setMargin( _textNode, null ); StackPane.setAlignment( _textNode, FxGraphicalUtility.toPos( _horizAlignTextMode, _vertAlignTextMode ) ); getChildren().addAll( _rect, _content, _textNode ); _redraw.run(); }