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 @Deprecated public abstract class AbstractDiagramLayouter extends Object implements DiagramLayouter, Cloneable
Deprecated.
use Layouting class for layouting a diagram
Abstract diagram layouter contains post-processing, preprocessing and other important methods for layouting diagrams.
  • Field Details

    • layoutParameters

      protected Map<String,Object> layoutParameters
      Deprecated.
  • Constructor Details

    • AbstractDiagramLayouter

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected AbstractDiagramLayouter(String optionId, boolean nodes, boolean paths)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor
      Parameters:
      optionId - layouter options id
      nodes - true if should layout nodes
      paths - true if should layout edges
    • AbstractDiagramLayouter

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected AbstractDiagramLayouter(String optionId, boolean nodes, boolean paths, boolean supportsSubgraph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      supportsSubgraph has no effect
    • AbstractDiagramLayouter

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected AbstractDiagramLayouter(String optionId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor
      Parameters:
      optionId - layouter options id
    • AbstractDiagramLayouter

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected AbstractDiagramLayouter(String optionId, boolean supportsSubgraph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      supportsSubgraph has no effect
      Parameters:
      optionId - layouter options id
  • Method Details

    • layout

      @Deprecated(since="2024x Refresh3", forRemoval=true) public final boolean layout(AbstractDiagramLayouterOptionsGroup options, AbstractDiagramPresentationElement dpe, @CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Layouting class for layouting a diagram
      Description copied from interface: DiagramLayouter
      Layouts diagram.
      Specified by:
      layout in interface DiagramLayouter
      Parameters:
      options - defined layouter options
      dpe - diagram
      mc - macro command to add layouting to
      Returns:
      true if layout was a success, false otherwise
    • setDefaultLayoutParameters

      protected void setDefaultLayoutParameters()
      Deprecated.
    • clearOldRectangles

      protected void clearOldRectangles(BaseGraph graph)
      Deprecated.
      Clears old rectangles for shapes. The old rectangle is used for link placement in movePath, MoveManager.
      Parameters:
      graph - layouted graph
    • createGraph

      @CheckForNull @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected BaseGraph createGraph(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup)
      Deprecated, for removal: This API element is subject to removal in a future version.
      will be removed without direct replacement
      Constructs a graph for layout
      Parameters:
      dpe - shapes and edges are taken from this diagram
      optionsGroup - layouter options
      Returns:
      a created graph
    • createGraph

      @CheckForNull protected BaseGraph createGraph(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup, Set<PresentationElement> selected)
      Deprecated.
    • createGraph

      @CheckForNull public BaseGraph createGraph(AbstractDiagramPresentationElement dpe, AbstractDiagramLayouterOptionsGroup optionsGroup, Set<PresentationElement> selected, boolean initializeData)
      Deprecated.
    • setLabelConsiderationMode

      protected void setLabelConsiderationMode(AbstractDiagramLayouterOptionsGroup optionsGroup, BaseGraph graph)
      Deprecated.
    • containsSelectedFromTheSameParent

      protected boolean containsSelectedFromTheSameParent(AbstractDiagramPresentationElement dpe)
      Deprecated.
      Checks if selected elements have the same parent. if nothing is selected return true
    • createCommands

      protected void createCommands(@CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc, BaseGraph graph)
      Deprecated.
      Draws the graph shapes on diagram frame
      Parameters:
      mc - macro command to store commands in
      graph - this graph will be taken as data for elements
    • placeLegendAndInfo

      protected void placeLegendAndInfo(AbstractDiagramPresentationElement diagram, BaseGraph graph)
      Deprecated.
      Places diagram legends and infos.
      Parameters:
      diagram - diagram
    • postprocessing

      protected void postprocessing(BaseGraph graph, @CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc)
      Deprecated.
      Does some post-processing after layout. Moves the graph, layouts swimlanes.
      Parameters:
      graph - the graph data for post-processing
    • getSelected

      @OpenApi @Deprecated(since="2024x Refresh3") public Set<PresentationElement> getSelected(AbstractDiagramPresentationElement diagramView)
      Deprecated.
      should not be used directly, select symbols using PresentationElement.setSelected(List)
      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.
    • afterLayout

      protected void afterLayout(AbstractDiagramLayouterOptionsGroup options, AbstractDiagramPresentationElement dpe, BaseGraph graph, @CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc)
      Deprecated.
    • preProcessing

      protected void preProcessing(AbstractDiagramLayouterOptionsGroup options, AbstractDiagramPresentationElement dpe, @CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc)
      Deprecated.
    • layout

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) protected abstract boolean layout(AbstractDiagramLayouterOptionsGroup opt, AbstractDiagramPresentationElement dpe, BaseGraph graph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Layouting class for layouting a diagram
      Layouts a diagram
      Parameters:
      opt - layouter options
      dpe - diagram to layout
      graph - a constructed graph from the diagram
      Returns:
      true if it was layouted successfully , false otherwise.
    • layoutGraph

      public final boolean layoutGraph(AbstractDiagramLayouterOptionsGroup opt, AbstractDiagramPresentationElement dpe, BaseGraph graph)
      Deprecated.
    • canLayout

      public boolean canLayout(AbstractDiagramPresentationElement dpe)
      Deprecated.
      Description copied from interface: DiagramLayouter
      Checks is diagram can be layouted
      Specified by:
      canLayout in interface DiagramLayouter
      Parameters:
      dpe - diagram to layout
      Returns:
      true if it can be layouted, false otherwise
    • resizeOuterBoundaryIfNecessary

      protected void resizeOuterBoundaryIfNecessary(AbstractDiagramPresentationElement dpe, BaseGraph graph, @CheckForNull com.dassault_systemes.modeler.foundation.editing.CompositeCommand mc)
      Deprecated.
      Resizes outer bondary according to graph
      Parameters:
      dpe - diagram
      mc - macro command
    • isTypeSupported

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) public boolean isTypeSupported(AbstractDiagramType type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      will no longer check anything
      Test the given type is supported.
      Parameters:
      type - The given type.
      Returns:
      true, if diagram type is supported
    • dispose

      protected void dispose(BaseGraph graph)
      Deprecated.
    • drawLayoutResults

      public void drawLayoutResults(BaseGraph graph)
      Deprecated.
      Description copied from interface: DiagramLayouter
      Draws layout results
      Specified by:
      drawLayoutResults in interface DiagramLayouter
      Parameters:
      graph - current graph that is layouted
    • getOptionsID

      @Deprecated(since="2024x Refresh3", forRemoval=true) public String getOptionsID()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getOptionsID in interface DiagramLayouter
      Returns:
      options ID
    • setAnchoredPresentationElement

      public void setAnchoredPresentationElement(PresentationElement shape, boolean makePreferred)
      Deprecated.
      Sets a shape element that should be anchored to, and saves the set preferred option, so that it can be restored after layout.
      Parameters:
      shape - the shape that should be anchored while layouting.
      makePreferred - sets make preferred size option. For related elements should be set to false.
    • getAnchoredPresentationElement

      @CheckForNull public PresentationElement getAnchoredPresentationElement()
      Deprecated.
      Returns:
      the shape that should be anchored and not moved anywhere after layout. Returns null if shape was not set.
    • getDiagramLayouterAbortHandler

      public com.dassault_systemes.modeler.magic.diagram.ylayout.DiagramLayouterAbortHandler getDiagramLayouterAbortHandler()
      Deprecated.
    • setLayoutParameter

      public void setLayoutParameter(String key, Object value)
      Deprecated.
      The need to reset the values back must be taken into consideration if a layouter is reused in few places
    • getLayoutParameter

      @CheckForNull public Object getLayoutParameter(String key)
      Deprecated.
    • clone

      public AbstractDiagramLayouter clone()
      Deprecated.
      Overrides:
      clone in class Object
    • afterLayout

      public void afterLayout(AbstractDiagramLayouterOptionsGroup optionsGroup, AbstractDiagramPresentationElement dpe, BaseGraph graph)
      Deprecated.