ワークスペースを永続化し、ユーザーがウィンドウを 2 回目に開いたときに復元したいと考えています。
たとえば、次のものがあります。
//Create the workspace there the panes will live
Pane workspace = new Pane();
//Create the layers - assume there is code to allow these to be dragged and moved
Pane layer1 = new Pane();
Pane layer2 = new Pane();
Pane layer3 = new Pane();
workspace.getChildren().addAll(layer1, layer2, layer3);
次のようにして、どのレイヤーが一番上にあるかを選択できることを知っています。
layer2.toFront();
しかし、私が見つけられないように見えるのは、現在どのレイヤーが一番上にあるかを判断する機能です。
すなわち
layer1.setOnToFront(event -> {});
layer1.setOnToBack(event -> {});
あるいは
boolean onTop = layer1.isOnTop();
ワークスペースが開いているときにノードがどこにあるかを特定する方法はありますか?
ありがとう!