Commit 744809ff authored by legoc's avatar legoc
Browse files

Improved selection/deselection

parent 5eb2558e
......@@ -275,6 +275,11 @@ public class EditorMenuBar extends MenuBar {
return;
}
System.out.println("Selection");
for (Component c : Nomad3DEditor.getInstance().getModel().getSelection()) {
System.out.println(" " + c.getName() + " is selected");
}
HashSet<Component> selectedComponents = Component.excludeComponentsWithParentIn(Nomad3DEditor.getInstance().getModel().getSelection());
if (selectedComponents.isEmpty()) {
Alert alert = new Alert(AlertType.WARNING);
......@@ -2546,10 +2551,18 @@ public class EditorMenuBar extends MenuBar {
@Override
public void handle(ActionEvent event) {
List<Component> selectedComponents = Nomad3DEditor.getInstance().getModel().getSelection();
System.out.println("Selection before clear");
for (Component c : Nomad3DEditor.getInstance().getModel().getSelection()) {
System.out.println(" " + c.getName() + " is selected");
}
Nomad3DEditor.getInstance().getModel().clearSelection();
for (Component component : selectedComponents) {
component.getTreeItem().selectedProperty().set(false);
Nomad3DEditor.getInstance().getModel().removeSelectionRelated();
System.out.println("Selection");
for (Component c : Nomad3DEditor.getInstance().getModel().getSelection()) {
System.out.println(" " + c.getName() + " is selected");
}
}
});
......@@ -2907,8 +2920,9 @@ public class EditorMenuBar extends MenuBar {
return;
}
Nomad3DEditor.getInstance().getModel().getRoot().focusSelection(Nomad3DEditor.getInstance().getModel().getSelection(), showType, activeConfiguration, true);
Nomad3DEditor.getInstance().getModel().getRoot().focusSelection(Nomad3DEditor.getInstance().getModel().getSelection(), showType);
Nomad3DEditor.getInstance().getModel().clearSelection();
updateWalls();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment