Search in sources :

Example 6 with Label

use of org.osate.ge.graphics.internal.Label in project osate2 by osate.

the class DiagramElementPredicates method isMoveableShape.

/**
 * Returns true if the specified diagram element is a shape that can be moved. This includes regular shapes and secondary labels for
 * connections and flow indicators.
 * @param de the diagram element to check
 * @return true if the specified diagram element is a shape that can be moved.
 */
public static boolean isMoveableShape(final DiagramElement de) {
    final Graphic graphic = de.getGraphic();
    final boolean shapeSecondaryLabel = graphic instanceof Label && de.getParent() instanceof DiagramElement && ((DiagramElement) de.getParent()).getGraphic() instanceof AgeShape;
    return graphic instanceof AgeShape && !shapeSecondaryLabel;
}
Also used : Graphic(org.osate.ge.graphics.Graphic) Label(org.osate.ge.graphics.internal.Label) AgeShape(org.osate.ge.graphics.internal.AgeShape)

Aggregations

AgeShape (org.osate.ge.graphics.internal.AgeShape)6 Label (org.osate.ge.graphics.internal.Label)6 PortSide (org.eclipse.elk.core.options.PortSide)5 ElkGraphElement (org.eclipse.elk.graph.ElkGraphElement)5 ElkLabel (org.eclipse.elk.graph.ElkLabel)5 ElkPort (org.eclipse.elk.graph.ElkPort)5 Dimension (org.osate.ge.graphics.Dimension)5 DiagramElement (org.osate.ge.internal.diagram.runtime.DiagramElement)5 Collection (java.util.Collection)4 Collections (java.util.Collections)4 EnumSet (java.util.EnumSet)4 List (java.util.List)4 Entry (java.util.Map.Entry)4 Objects (java.util.Objects)4 Optional (java.util.Optional)4 Collectors (java.util.stream.Collectors)4 KVector (org.eclipse.elk.core.math.KVector)4 CoreOptions (org.eclipse.elk.core.options.CoreOptions)4 NodeLabelPlacement (org.eclipse.elk.core.options.NodeLabelPlacement)4 SizeConstraint (org.eclipse.elk.core.options.SizeConstraint)4