RuntimeException for using Parent.toFront()
Using ScenicView v11.0.2 on Ubuntu.
I run into a RuntimeException when the code is using Parent.toFront.
Parent.toFront has an optimization not to set the change the parent field of the node it moves:
childrenTriggerPermutation = true;
try {
children.remove(node);
children.add(node);
} finally {
childrenTriggerPermutation = false;
}
due to childrenTriggerPermutation optimization the moved node seen by S VNodeFactory.createNode has the parent set, but that parent does not list the node, hence the RuntimeException. I don't know enough about ScenicView to understand how to fix it, maybe just creating SVRemoteNodeAdapter as if the parent is not known?
java.lang.RuntimeException: Error while creating node:class javafx.scene.layout.BorderPane id:null NODE INFORMATION Node:BorderPane@3e408c4 Class:class javafx.scene.layout.BorderPane Id:null Children:[] PARENT INFORMATION Node:StackPane@1ae7aa45 Class:class javafx.scene.layout.StackPane Id:null Children:[BundlesTab@22491c46[styleClass=bundles-tab]]
at org.fxconnector.node.SVNodeFactory.createNode(SVNodeFactory.java:56)
at org.fxconnector.StageControllerImpl.createNode(StageControllerImpl.java:773)
at org.fxconnector.StageControllerImpl.lambda$new$10(StageControllerImpl.java:229)
at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.base/javafx.collections.FXCollections$UnmodifiableObservableListImpl.lambda$new$0(FXCollections.java:955)
at javafx.base/javafx.collections.WeakListChangeListener.onChanged(WeakListChangeListener.java:88)
at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164)
at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.lambda$new$0(VetoableListDecorator.java:76)
at javafx.base/com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
at javafx.base/javafx.collections.ModifiableObservableListBase.remove(ModifiableObservableListBase.java:183)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:332)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.remove(VetoableListDecorator.java:221)
at javafx.graphics/javafx.scene.Parent.toFront(Parent.java:729)
at javafx.graphics/javafx.scene.Node.toFront(Node.java:2040)