Class AbstractDiagramLayouter
java.lang.Object
com.nomagic.magicdraw.uml.symbols.layout.AbstractDiagramLayouter
- All Implemented Interfaces:
DiagramLayouter
,Cloneable
- Direct Known Subclasses:
AbstractHierarchicDiagramLayouter
,AbstractLinkDiagramLayouter
,CircularDiagramLayouter
,GridDiagramLayouter
,OrganicDiagramLayouter
,OrthogonalDiagramLayouter
,TreeDiagramLayouter
@OpenApi
public abstract class AbstractDiagramLayouter
extends Object
implements DiagramLayouter, Cloneable
Abstract diagram layouter contains post processing, preprocessing and other important methods for
layouting diagrams.
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDiagramLayouter
(String optionId) Constructorprotected
AbstractDiagramLayouter
(String optionId, boolean supportsSubgraph) Deprecated.supportsSubgraph has no effectprotected
AbstractDiagramLayouter
(String optionId, boolean nodes, boolean paths) Constructorprotected
AbstractDiagramLayouter
(String optionId, boolean nodes, boolean paths, boolean supportsSubgraph) Deprecated.supportsSubgraph has no effect -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseGraph
createGraph
(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup) Constructs a graph for layoutgetSelected
(AbstractDiagramPresentationElement diagramView) Collects a set of selected layoutable presentation elements in a diagramboolean
Test the given type is supported.protected abstract boolean
layout
(AbstractDiagramLayouterOptionsGroup opt, AbstractDiagramPresentationElement dpe, BaseGraph graph) Layouts a diagram
-
Constructor Details
-
AbstractDiagramLayouter
Constructor- Parameters:
optionId
- layouter options idnodes
- true if should layout nodespaths
- true if should layout edges
-
AbstractDiagramLayouter
@OpenApi @Deprecated protected AbstractDiagramLayouter(String optionId, boolean nodes, boolean paths, boolean supportsSubgraph) Deprecated.supportsSubgraph has no effect -
AbstractDiagramLayouter
Constructor- Parameters:
optionId
- layouter options id
-
AbstractDiagramLayouter
Deprecated.supportsSubgraph has no effect- Parameters:
optionId
- layouter options id
-
-
Method Details
-
createGraph
@CheckForNull @OpenApi protected BaseGraph createGraph(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup) Constructs a graph for layout- Parameters:
dpe
- shapes and edges are taken from this diagramoptionsGroup
- layouter options- Returns:
- a created graph
-
getSelected
@OpenApi public Set<PresentationElement> getSelected(AbstractDiagramPresentationElement diagramView) Collects a set of selected layoutable presentation elements in a diagram- Parameters:
diagramView
- the diagram that elements were selected in- Returns:
- a set of selected layoutable presentation elements in a diagram. Empty if whole diagram is layouted.
-
layout
@OpenApi protected abstract boolean layout(AbstractDiagramLayouterOptionsGroup opt, AbstractDiagramPresentationElement dpe, BaseGraph graph) Layouts a diagram- Parameters:
opt
- layouter optionsdpe
- diagram to layoutgraph
- a constructed graph from the diagram- Returns:
- true if it was layouted successfully , false otherwise.
-
isTypeSupported
Test the given type is supported.- Parameters:
type
- The given type.- Returns:
- true, if diagram type is supported
-