Class AbstractLinkDiagramLayouter
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.layout.AbstractDiagramLayouter
-
- com.nomagic.magicdraw.uml.symbols.layout.AbstractLinkDiagramLayouter
-
- All Implemented Interfaces:
DiagramLayouter
,java.lang.Cloneable
- Direct Known Subclasses:
OrganicLinkDiagramLayouter
,OrthogonalLinkDiagramLayouter
@OpenApi public abstract class AbstractLinkDiagramLayouter extends AbstractDiagramLayouter
Layout the diagram symbols in diagram.
-
-
Constructor Summary
Constructors Constructor Description AbstractLinkDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths)
Construct AbstractLinkDiagramLayouter with the given argument.AbstractLinkDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effect
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addIfNotPresent(java.util.Collection<PresentationElement> pathsToLayout, PresentationElement el)
Adds element el to the list, if it does not exist there alreadyprotected void
clearOldRectangles(UMLGraph graph)
Clears old rectangles for shapes.private static void
collectShapesOnEdgeRecursively(PresentationElement next, java.util.List<PresentationElement> allShapes)
protected boolean
containsSelectedFromTheSameParent(DiagramPresentationElement dpe)
Checks if selected elements have the same parent.protected UMLGraph
createGraph(DiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)
Constructs a graph for layoutprivate static java.util.List<PathElement>
getAllPaths(PresentationElement next)
static java.util.Set<PresentationElement>
getConnectedPaths(DiagramPresentationElement diagramView)
Gets the selected paths and any paths that are connected to selected shapes.protected java.util.Set<PresentationElement>
getSelected(DiagramPresentationElement diagramView)
Collects a set of selected layoutable presentation elements in a diagramprotected void
placeLegendAndInfo(DiagramPresentationElement diagram, UMLGraph graph)
Places diagram legends and infos.protected void
postprocessing(UMLGraph graph, com.nomagic.magicdraw.commands.MacroCommand mc)
Does some post processing after layout.protected void
resizeFrameIfNecessary(DiagramPresentationElement dpe, UMLGraph graph, com.nomagic.magicdraw.commands.MacroCommand mc)
Resizes diagram frame if there are no elements selected.-
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, layout, needPartitionData, preProcessing, setAnchoredPresentationElement, setLabelConsiderationMode, setLayoutParameter
-
-
-
-
Constructor Detail
-
AbstractLinkDiagramLayouter
@OpenApi public AbstractLinkDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths)
Construct AbstractLinkDiagramLayouter with the given argument.- Parameters:
optionId
- String.nodes
- boolean.paths
- boolean.
-
AbstractLinkDiagramLayouter
@OpenApi @Deprecated public AbstractLinkDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effectConstruct AbstractLinkDiagramLayouter with the given argument.- Parameters:
optionId
- String.nodes
- boolean.paths
- boolean.supportsSubgraph
- boolean.
-
-
Method Detail
-
createGraph
@OpenApi protected UMLGraph createGraph(DiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)
Constructs a graph for layout- Overrides:
createGraph
in classAbstractDiagramLayouter
- Parameters:
dpe
- shapes and edges are taken from this diagramoptionsGroup
- layouter options- Returns:
- a created UMLGraph
-
resizeFrameIfNecessary
protected void resizeFrameIfNecessary(DiagramPresentationElement dpe, UMLGraph graph, com.nomagic.magicdraw.commands.MacroCommand mc)
Description copied from class:AbstractDiagramLayouter
Resizes diagram frame if there are no elements selected.- Parameters:
dpe
- diagrammc
- macro command
-
postprocessing
protected void postprocessing(UMLGraph graph, com.nomagic.magicdraw.commands.MacroCommand mc)
Description copied from class:AbstractDiagramLayouter
Does some post processing after layout. Moves the graph, layouts swimlanes.- Parameters:
graph
- the graph data for post processing
-
containsSelectedFromTheSameParent
protected boolean containsSelectedFromTheSameParent(DiagramPresentationElement dpe)
Description copied from class:AbstractDiagramLayouter
Checks if selected elements have the same parent. if nothing is selected return true
-
getSelected
@OpenApi protected java.util.Set<PresentationElement> getSelected(DiagramPresentationElement diagramView)
Description copied from class:AbstractDiagramLayouter
Collects a set of selected layoutable presentation elements in a diagram- Overrides:
getSelected
in classAbstractDiagramLayouter
- Parameters:
diagramView
- the diagram that elements were selected in- Returns:
- the selected paths and any paths that are connected to selected shapes. Paths connected by other shape element on shape edge are also included
-
getConnectedPaths
public static java.util.Set<PresentationElement> getConnectedPaths(DiagramPresentationElement diagramView)
Gets the selected paths and any paths that are connected to selected shapes. Paths connected by other shape element on shape edge are also included- Parameters:
diagramView
- diagram- Returns:
- a set of path elements that should be processed
-
getAllPaths
private static java.util.List<PathElement> getAllPaths(PresentationElement next)
- Parameters:
next
- the element to collect all paths from(collects from on edge shapes also)
-
collectShapesOnEdgeRecursively
private static void collectShapesOnEdgeRecursively(PresentationElement next, java.util.List<PresentationElement> allShapes)
- Parameters:
next
- the object to search inallShapes
- stores all objects collected recursively
-
addIfNotPresent
private static void addIfNotPresent(java.util.Collection<PresentationElement> pathsToLayout, PresentationElement el)
Adds element el to the list, if it does not exist there already- Parameters:
pathsToLayout
- the list to add toel
- the element to add
-
clearOldRectangles
protected void clearOldRectangles(UMLGraph graph)
Description copied from class:AbstractDiagramLayouter
Clears old rectangles for shapes. The old rectangle is used for link placement in movePath, MoveManager.- Parameters:
graph
- layouted graph
-
placeLegendAndInfo
protected void placeLegendAndInfo(DiagramPresentationElement diagram, UMLGraph graph)
Description copied from class:AbstractDiagramLayouter
Places diagram legends and infos.- Parameters:
diagram
- diagram
-
-