Class AbstractDiagramLayouter
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.layout.AbstractDiagramLayouter
-
- All Implemented Interfaces:
DiagramLayouter
,java.lang.Cloneable
- Direct Known Subclasses:
AbstractHierarchicDiagramLayouter
,AbstractLinkDiagramLayouter
,CircularDiagramLayouter
,GridDiagramLayouter
,OrganicDiagramLayouter
,OrthogonalDiagramLayouter
,TreeDiagramLayouter
@OpenApi public abstract class AbstractDiagramLayouter extends java.lang.Object implements DiagramLayouter, java.lang.Cloneable
Abstract diagram layouter contains post processing, preprocessing and other important methods for layouting diagrams.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDiagramLayouter(java.lang.String optionId)
Constructorprotected
AbstractDiagramLayouter(java.lang.String optionId, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effectprotected
AbstractDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths)
Constructorprotected
AbstractDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effect
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BaseGraph
createGraph(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)
Constructs a graph for layoutjava.util.Set<PresentationElement>
getSelected(AbstractDiagramPresentationElement diagramView)
Collects a set of selected layoutable presentation elements in a diagramboolean
isTypeSupported(AbstractDiagramType type)
Test the given type is supported.protected abstract boolean
layout(AbstractDiagramLayouterOptionsGroup opt, AbstractDiagramPresentationElement dpe, BaseGraph graph)
Layouts a diagram
-
-
-
Constructor Detail
-
AbstractDiagramLayouter
@OpenApi protected AbstractDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths)
Constructor- Parameters:
optionId
- layouter options idnodes
- true if should layout nodespaths
- true if should layout edges
-
AbstractDiagramLayouter
@OpenApi @Deprecated protected AbstractDiagramLayouter(java.lang.String optionId, boolean nodes, boolean paths, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effect
-
AbstractDiagramLayouter
@OpenApi protected AbstractDiagramLayouter(java.lang.String optionId)
Constructor- Parameters:
optionId
- layouter options id
-
AbstractDiagramLayouter
@OpenApi @Deprecated protected AbstractDiagramLayouter(java.lang.String optionId, boolean supportsSubgraph)
Deprecated.supportsSubgraph has no effect- Parameters:
optionId
- layouter options id
-
-
Method Detail
-
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 java.util.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
@OpenApi public boolean isTypeSupported(AbstractDiagramType type)
Test the given type is supported.- Parameters:
type
- The given type.- Returns:
- true, if diagram type is supported
-
-