In addition to using ScenicView as suggested by Uluk, sometimes I also just delete the active nodes in the console after showing Stage. This default value toString()for nodes lists their identifiers and css class classes.
public static void dump(Node n) { dump(n, 0); }
private static void dump(Node n, int depth) {
for (int i = 0; i < depth; i++) System.out.print(" ");
System.out.println(n);
if (n instanceof Parent)
for (Node c : ((Parent) n).getChildrenUnmodifiable())
dump(c, depth + 1);
}
Output Example:
BorderPane@13c3750
Text@2e3919[styleClass=lyric-text]
Button[id=null, styleClass=button change-lyric]
ButtonSkin[id=null, styleClass=button change-lyric]
ImageView@13a4e73
LabeledText@567aef[styleClass=text]
api css, .
api public : CSS Style Object Model Java. StyleMap node, , css node, StyleMap.
public void addStyleMaps(Node node, int depth) {
node.impl_setStyleMap(FXCollections.observableMap(new HashMap<WritableValue, List<Style>>()));
if (node instanceof Parent) {
for (Node child : ((Parent) node).getChildrenUnmodifiable()) {
addStyleMaps(child, depth + 1);
}
}
}
value = >
System.out.println(n + " " + node.impl_getStyleMap());
, .
, impl_ api, , (, , ) JavaFX api.
, , , ScenicView, CSS- Firebug. , ScenicView , css , .