Skip to content

Commit

Permalink
Rework diagram element moveability check. Fixes #2544 (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-alldredge committed Dec 9, 2020
1 parent f76409f commit 111f091
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Expand Up @@ -29,10 +29,6 @@
* Marker for graphics which will be used to represent shapes. Not public API.
*/
public interface AgeShape extends Graphic {
default boolean isMoveable() {
return true;
}

default boolean isResizeable() {
return true;
}
Expand Down
5 changes: 0 additions & 5 deletions ge/org.osate.ge/src/org/osate/ge/graphics/internal/Label.java
Expand Up @@ -24,11 +24,6 @@
package org.osate.ge.graphics.internal;

public class Label implements AgeShape {
@Override
public boolean isMoveable() {
return false;
}

@Override
public boolean isResizeable() {
return false;
Expand Down
Expand Up @@ -36,7 +36,9 @@ public static boolean isResizeable(final DiagramElement de) {

public static boolean isMoveable(final DiagramElement de) {
final Graphic graphic = de.getGraphic();
return graphic instanceof AgeShape && ((AgeShape)graphic).isMoveable();
final boolean shapeSecondaryLabel = graphic instanceof Label && de.getParent() instanceof DiagramElement
&& ((DiagramElement) de.getParent()).getGraphic() instanceof AgeShape;
return graphic instanceof AgeShape && !shapeSecondaryLabel;
}

public static boolean isUndocked(final DiagramElement de) {
Expand Down

0 comments on commit 111f091

Please sign in to comment.