/** * Gets the font that will be used when painting this decorator's text. * * @return * This decorator's font */ public Font getFont() { return (Font)label.getStyles().get("font"); }
/** * Gets the font that will be used when painting this decorator's text. * * @return * This decorator's font */ public Font getFont() { return (Font)label.getStyles().get("font"); }
/** * Sets the font that will be used when painting this decorator's text. * * @param font * This decorator's font */ public void setFont(Font font) { if (font == null) { throw new IllegalArgumentException("font is null."); } label.getStyles().put("font", font); validate(); }
/** * Sets the font that will be used when painting this decorator's text. * * @param font * This decorator's font */ public void setFont(Font font) { if (font == null) { throw new IllegalArgumentException("font is null."); } label.getStyles().put("font", font); validate(); }
/** * Creates a new <tt>WatermarkDecorator</tt> with the specified text and * image. * * @param text * The text to paint over the decorated component * * @param image * The image to paint over the decorated component */ public WatermarkDecorator(String text, Image image) { boxPane.add(imageView); boxPane.add(label); boxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); imageView.getStyles().put("opacity", opacity); Font font = (Font)label.getStyles().get("font"); label.getStyles().put("font", font.deriveFont(Font.BOLD, 60)); label.setText(text); imageView.setImage(image); validate(); }
/** * Creates a new <tt>WatermarkDecorator</tt> with the specified text and * image. * * @param text * The text to paint over the decorated component * * @param image * The image to paint over the decorated component */ public WatermarkDecorator(String text, Image image) { boxPane.add(imageView); boxPane.add(label); boxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); imageView.getStyles().put("opacity", opacity); Font font = (Font)label.getStyles().get("font"); label.getStyles().put("font", font.deriveFont(Font.BOLD, 60)); label.setText(text != null ? text : ""); imageView.setImage(image); validate(); }
protected void renderStyles(ListView listView, boolean selected, @SuppressWarnings("unused") boolean highlighted, boolean disabled) { imageView.getStyles().put("opacity", listView.isEnabled() ? 1.0f : 0.5f); Font font = (Font)listView.getStyles().get("font"); label.getStyles().put("font", font); Color color; if (listView.isEnabled() && !disabled) { if (selected) { if (listView.isFocused()) { color = (Color)listView.getStyles().get("selectionColor"); } else { color = (Color)listView.getStyles().get("inactiveSelectionColor"); } } else { color = (Color)listView.getStyles().get("color"); } } else { color = (Color)listView.getStyles().get("disabledColor"); } label.getStyles().put("color", color); }
protected void renderStyles(ListView listView, boolean selected, boolean highlighted, boolean disabled) { imageView.getStyles().put("opacity", listView.isEnabled() ? 1.0f : 0.5f); Font font = (Font)listView.getStyles().get("font"); label.getStyles().put("font", font); Color color; if (listView.isEnabled() && !disabled) { if (selected) { if (listView.isFocused()) { color = (Color)listView.getStyles().get("selectionColor"); } else { color = (Color)listView.getStyles().get("inactiveSelectionColor"); } } else { color = (Color)listView.getStyles().get("color"); } } else { color = (Color)listView.getStyles().get("disabledColor"); } label.getStyles().put("color", color); }
public LinkButtonDataRenderer() { getStyles().put("horizontalSpacing", 4); getColumns().add(new TablePane.Column()); getColumns().add(new TablePane.Column(1, true)); TablePane.Row row = new TablePane.Row(); row.add(imageView); row.add(label); getRows().add(row); label.getStyles().put("wrapText", true); }
public LinkButtonDataRenderer() { getStyles().put("horizontalSpacing", 4); getColumns().add(new TablePane.Column()); getColumns().add(new TablePane.Column(1, true)); TablePane.Row row = new TablePane.Row(); row.add(imageView); row.add(label); getRows().add(row); label.getStyles().put("wrapText", true); }
Component.StyleDictionary labelStyles = label.getStyles();
Label tooltipLabel = new Label(tooltipText); boolean tooltipWrapText = component.getTooltipWrapText(); tooltipLabel.getStyles().put("wrapText", tooltipWrapText); Tooltip tooltip = new Tooltip(tooltipLabel);
Component.StyleDictionary labelStyles = label.getStyles();