Class Icons
java.lang.Object
ch.autumo.ui.fx.control.Icons
Icon nodes from the bundled Phosphor icon font (MIT, see
fonts/Phosphor-LICENSE.txt).
Phosphor ships 1530 icons; each one is addressed by its name ("warning",
"trash", "gear-six", "folder-open", …). The name/codepoint
table fonts/phosphor-codepoints.properties is shipped with the font and is
generated from the upstream web package, because JavaFX does not apply the font's
ligatures reliably — the character code is therefore set explicitly.
Usage:
final Text icon = Icons.create("warning", 24);
if (icon != null) {
icon.getStyleClass().add("ph-icon-warning");
button.setGraphic(icon);
}
Missing names and any font loading failure yield null, so a missing icon
never breaks a dialog or a toolbar. The base style sheet paints a plain
.ph-icon in the standard text colour; the semantic classes
ph-icon-info, ph-icon-warning and ph-icon-error carry the
colours used by the dialog types.
-
Method Summary
-
Method Details
-
create
-
create
-
isAvailable
Whether the given icon name is known to the bundled font.- Parameters:
name- icon name- Returns:
trueif the icon can be created
-