From 9c316a804324ec2e92b5cf28cc136a00ea2f715d Mon Sep 17 00:00:00 2001 From: uhypu Date: Sun, 10 Mar 2024 14:06:12 +0100 Subject: [PATCH] marquee tool fix --- src/main/java/org/gecko/view/views/EditorView.java | 4 +--- src/main/java/org/gecko/viewmodel/EdgeViewModel.java | 3 +-- src/main/java/org/gecko/viewmodel/EditorViewModel.java | 3 +++ .../java/org/gecko/viewmodel/SystemConnectionViewModel.java | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gecko/view/views/EditorView.java b/src/main/java/org/gecko/view/views/EditorView.java index 7866b781..502afa79 100644 --- a/src/main/java/org/gecko/view/views/EditorView.java +++ b/src/main/java/org/gecko/view/views/EditorView.java @@ -38,11 +38,9 @@ /** * Represents a displayable view in the Gecko Graphic Editor, holding a collection of displayed {@link ViewElement}s and - * other items specific to their vizualization. + * other items specific to their visualisation. */ public class EditorView { - private static final double AUTOMATON_INSPECTOR_HEIGHT = 680; - private final ViewFactory viewFactory; @Getter private final EditorViewModel viewModel; diff --git a/src/main/java/org/gecko/viewmodel/EdgeViewModel.java b/src/main/java/org/gecko/viewmodel/EdgeViewModel.java index bf47aa76..0bc6bc03 100644 --- a/src/main/java/org/gecko/viewmodel/EdgeViewModel.java +++ b/src/main/java/org/gecko/viewmodel/EdgeViewModel.java @@ -59,6 +59,7 @@ public EdgeViewModel( this.endOffsetProperty = new SimpleObjectProperty<>(Point2D.ZERO); this.startPointProperty = new SimpleObjectProperty<>(); this.endPointProperty = new SimpleObjectProperty<>(); + sizeProperty.setValue(Point2D.ZERO); setBindings(); getSource().getOutgoingEdges().add(this); @@ -194,12 +195,10 @@ public void setOrientation(int orientation) { @Override public void setPosition(@NonNull Point2D position) { - return; } @Override public void setSize(@NonNull Point2D position) { - return; } @Override diff --git a/src/main/java/org/gecko/viewmodel/EditorViewModel.java b/src/main/java/org/gecko/viewmodel/EditorViewModel.java index 27975ebe..8221a5e9 100644 --- a/src/main/java/org/gecko/viewmodel/EditorViewModel.java +++ b/src/main/java/org/gecko/viewmodel/EditorViewModel.java @@ -291,6 +291,9 @@ public List> getElementsByName(String name) { */ public Set> getElementsInArea(Bounds bound) { return containedPositionableViewModelElementsProperty.stream().filter(element -> { + if (element.getSize().equals(Point2D.ZERO)) { + return false; + } Bounds elementBound = new BoundingBox(element.getPosition().getX(), element.getPosition().getY(), element.getSize().getX(), element.getSize().getY()); diff --git a/src/main/java/org/gecko/viewmodel/SystemConnectionViewModel.java b/src/main/java/org/gecko/viewmodel/SystemConnectionViewModel.java index d8a6c7b7..9a3a2d56 100644 --- a/src/main/java/org/gecko/viewmodel/SystemConnectionViewModel.java +++ b/src/main/java/org/gecko/viewmodel/SystemConnectionViewModel.java @@ -31,6 +31,7 @@ public class SystemConnectionViewModel extends PositionableViewModelElement(source); this.destinationProperty = new SimpleObjectProperty<>(destination); this.edgePoints = FXCollections.observableArrayList(); + sizeProperty.setValue(Point2D.ZERO); } public void setSource(@NonNull PortViewModel source) { @@ -99,12 +100,10 @@ public static boolean isConnectingAllowed( @Override public void setPosition(@NonNull Point2D position) { - return; } @Override public void setSize(@NonNull Point2D position) { - return; } @Override