@Override public boolean isSettable(StyledTextNode styleable) { return !styleable.fillProperty().isBound(); }
/** * @return the paint used to fill the text */ public final @NonNull Paint getFill() { return this.fillProperty().get(); }
/** * Set a new paint * * @param color * the paint used to fill the text */ public final void setFill(final @NonNull Paint color) { this.fillProperty().set(color); }
/** * Create a new styled text node * * @param text * the text */ public StyledTextNode(String text) { getStyleClass().add("styled-text-node"); //$NON-NLS-1$ this.originalText = text; this.textNode = new Text(processText(text)); this.textNode.setBoundsType(TextBoundsType.LOGICAL_VERTICAL_CENTER); this.textNode.fillProperty().bind(fillProperty()); getChildren().add(this.textNode); this.decorationStrategy.addListener(this::handleDecorationChange); this.tabCharAdvance.addListener(o -> { this.textNode.setText(processText(text)); }); }