Class OrthogonalLinkDiagramLayouter
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.layout.AbstractDiagramLayouter
-
- com.nomagic.magicdraw.uml.symbols.layout.AbstractLinkDiagramLayouter
-
- com.nomagic.magicdraw.uml.symbols.layout.OrthogonalLinkDiagramLayouter
-
- All Implemented Interfaces:
DiagramLayouter,java.lang.Cloneable
@OpenApi public class OrthogonalLinkDiagramLayouter extends AbstractLinkDiagramLayouter
Link layouter.
-
-
Field Summary
Fields Modifier and Type Field Description private static intTHIRTY_SECONDSprivate static intTWO_MINUTES
-
Constructor Summary
Constructors Constructor Description OrthogonalLinkDiagramLayouter()Construct OrthogonalLinkDiagramLayouter
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyConstraintsForEdge(DiagramPresentationElement dpe, UMLGraph graph, y.base.EdgeMap spcMap, y.base.EdgeMap tpcMap, java.util.Collection<y.base.Edge> selectedEdges, y.base.Edge edge, y.layout.router.polyline.EdgeRouter oer)Applies custom constraints for edge.protected voidconfigureSettings(OrthogonalRouterOptionsGroup options, y.layout.router.polyline.EdgeRouter oer)Configures initial edge router settingsprivate static voidcreateEdgeInGraph(UMLGraph graph, PresentationElement el, y.base.Node clientNode, y.base.Node supplierNode)private static voidcreateFakeDiagramFrameNodes(UMLGraph graph, DiagramPresentationElement dpe, java.util.Collection<PresentationElement> selectedElements, PresentationElement el, PresentationElement oppositeEl)private static voidcreateFakeEdgesForDiagramFrame(UMLGraph graph, DiagramPresentationElement dpe, java.util.Collection<PresentationElement> selectedElements)private static voidcreateFakeEdgesForPathToPath(UMLGraph graph, java.util.Collection<PresentationElement> selectedElements)protected UMLGraphcreateGraph(DiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)Constructs a graph for layoutprivate static y.base.NodecreatePathToPathNodeForEnd(UMLGraph graph, BaseElement routedPath, PresentationElement clientOrSupplier, java.util.Collection<PresentationElement> selectedElements, java.awt.Point fakeNodeLocation)protected static PresentationElementgetClient(UMLGraph graph, y.base.Edge edge, PathElement pathElement)private static com.nomagic.magicdraw.uml.symbols.manipulators.autorouting.RoutingDatagetRoutingDataWithPoint(DiagramPresentationElement dpe, UMLGraph graph, y.base.EdgeMap spcMap, y.base.EdgeMap tpcMap, y.base.Edge edge, PresentationElement client, PresentationElement supplier, java.awt.Point point, PathElement pathElement)protected static PresentationElementgetSupplier(UMLGraph graph, y.base.Edge edge, PathElement pathElement)private static booleanisClientSourceAndTargetSupplier(UMLGraph graph, y.base.Edge edge, PathElement pathElement)static booleanisSelfLoop(PathElement path)protected booleanlayout(AbstractDiagramLayouterOptionsGroup opt, DiagramPresentationElement dpe, UMLGraph graph)Layouts a diagramprivate y.layout.LayouterprepareRouter(DiagramPresentationElement dpe, UMLGraph graph, OrthogonalRouterOptionsGroup options)protected voidsetEdgeConstraintMaps(DiagramPresentationElement dpe, UMLGraph graph, y.layout.router.polyline.EdgeRouter oer)-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.layout.AbstractLinkDiagramLayouter
clearOldRectangles, containsSelectedFromTheSameParent, getConnectedPaths, getSelected, placeLegendAndInfo, postprocessing, resizeFrameIfNecessary
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.layout.AbstractDiagramLayouter
afterLayout, canLayout, clone, createCommands, createGraph, createLayoutParameters, drawLayoutResults, getAnchoredPresentationElement, getDiagramLayouterAbortHandler, getLayoutParameter, getMessagesFromPath, getOptionsID, isTypeSupported, layout, needPartitionData, preProcessing, setAnchoredPresentationElement, setLabelConsiderationMode, setLayoutParameter
-
-
-
-
Field Detail
-
TWO_MINUTES
private static final int TWO_MINUTES
- See Also:
- Constant Field Values
-
THIRTY_SECONDS
private static final int THIRTY_SECONDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
createGraph
@OpenApi protected UMLGraph createGraph(DiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)
Description copied from class:AbstractLinkDiagramLayouterConstructs a graph for layout- Overrides:
createGraphin classAbstractLinkDiagramLayouter- Parameters:
dpe- shapes and edges are taken from this diagramoptionsGroup- layouter options- Returns:
- a created UMLGraph
-
layout
@OpenApi protected boolean layout(AbstractDiagramLayouterOptionsGroup opt, DiagramPresentationElement dpe, UMLGraph graph)
Description copied from class:AbstractDiagramLayouterLayouts a diagram- Specified by:
layoutin classAbstractDiagramLayouter- Parameters:
opt- layouter optionsdpe- diagram to layoutgraph- a constructed graph from the diagram- Returns:
- true if it was layouted successfully , false otherwise.
-
prepareRouter
private y.layout.Layouter prepareRouter(DiagramPresentationElement dpe, UMLGraph graph, OrthogonalRouterOptionsGroup options)
-
setEdgeConstraintMaps
protected void setEdgeConstraintMaps(DiagramPresentationElement dpe, UMLGraph graph, y.layout.router.polyline.EdgeRouter oer)
-
createFakeEdgesForDiagramFrame
private static void createFakeEdgesForDiagramFrame(UMLGraph graph, DiagramPresentationElement dpe, java.util.Collection<PresentationElement> selectedElements)
-
createFakeDiagramFrameNodes
private static void createFakeDiagramFrameNodes(UMLGraph graph, DiagramPresentationElement dpe, java.util.Collection<PresentationElement> selectedElements, PresentationElement el, @CheckForNull PresentationElement oppositeEl)
-
createFakeEdgesForPathToPath
private static void createFakeEdgesForPathToPath(UMLGraph graph, java.util.Collection<PresentationElement> selectedElements)
-
createEdgeInGraph
private static void createEdgeInGraph(UMLGraph graph, PresentationElement el, @CheckForNull y.base.Node clientNode, @CheckForNull y.base.Node supplierNode)
-
createPathToPathNodeForEnd
@CheckForNull private static y.base.Node createPathToPathNodeForEnd(UMLGraph graph, BaseElement routedPath, PresentationElement clientOrSupplier, java.util.Collection<PresentationElement> selectedElements, java.awt.Point fakeNodeLocation)
-
applyConstraintsForEdge
protected void applyConstraintsForEdge(DiagramPresentationElement dpe, UMLGraph graph, y.base.EdgeMap spcMap, y.base.EdgeMap tpcMap, java.util.Collection<y.base.Edge> selectedEdges, y.base.Edge edge, y.layout.router.polyline.EdgeRouter oer)
Applies custom constraints for edge. Fills selectedEdges set in the process.- Parameters:
dpe- current diagramgraph- current graphspcMap- source port constraint maptpcMap- target port constraint mapselectedEdges- list for filling with edges that will be routededge- edge to be routed
-
getClient
protected static PresentationElement getClient(UMLGraph graph, y.base.Edge edge, PathElement pathElement)
-
getSupplier
protected static PresentationElement getSupplier(UMLGraph graph, y.base.Edge edge, PathElement pathElement)
-
isClientSourceAndTargetSupplier
private static boolean isClientSourceAndTargetSupplier(UMLGraph graph, y.base.Edge edge, PathElement pathElement)
-
getRoutingDataWithPoint
private static com.nomagic.magicdraw.uml.symbols.manipulators.autorouting.RoutingData getRoutingDataWithPoint(DiagramPresentationElement dpe, UMLGraph graph, y.base.EdgeMap spcMap, y.base.EdgeMap tpcMap, y.base.Edge edge, PresentationElement client, PresentationElement supplier, @CheckForNull java.awt.Point point, PathElement pathElement)
-
configureSettings
protected void configureSettings(OrthogonalRouterOptionsGroup options, y.layout.router.polyline.EdgeRouter oer)
Configures initial edge router settings- Parameters:
options- router option groupoer- router
-
isSelfLoop
public static boolean isSelfLoop(@Nonnull PathElement path)
-
-