Class AbstractDiagramPresentationElement

java.lang.Object
com.nomagic.magicdraw.uml.MDElementImpl
com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElement
All Implemented Interfaces:
com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer, BaseElement, MDElement, ModelElementProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, EventListener
Direct Known Subclasses:
DiagramPresentationElement

@OpenApi public abstract class AbstractDiagramPresentationElement extends PresentationElement implements com.nomagic.magicdraw.core.diagram.DiagramPresentationImplementer
  • Field Details

    • DIAGRAM_ORIENTATION_VERTICAL

      public static final String DIAGRAM_ORIENTATION_VERTICAL
      Vertical diagram orientation mode.
      See Also:
    • DIAGRAM_ORIENTATION_HORIZONTAL

      public static final String DIAGRAM_ORIENTATION_HORIZONTAL
      Horizontal diagram orientation mode.
      See Also:
    • DIAGRAM_ORIENTATION_MODES

      public static final List<String> DIAGRAM_ORIENTATION_MODES
      Diagram orientation modes.
    • FORCE_CONTENT_SAVE_PROPERTY

      public static final String FORCE_CONTENT_SAVE_PROPERTY
      See Also:
    • MIN_GRID_SIZE

      public static final int MIN_GRID_SIZE
      See Also:
    • MAX_GRID_SIZE

      public static final int MAX_GRID_SIZE
      See Also:
    • CANVAS_SIZE

      public static final int CANVAS_SIZE
      See Also:
    • DIAGRAM_CONTENT_LOADED_PROPERTY

      public static final String DIAGRAM_CONTENT_LOADED_PROPERTY
      See Also:
    • DEFAULT_GRID_SIZE

      public static final int DEFAULT_GRID_SIZE
      See Also:
  • Constructor Details

    • AbstractDiagramPresentationElement

      public AbstractDiagramPresentationElement()
  • Method Details

    • setDiagramRepresentationObject

      public void setDiagramRepresentationObject(com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject repObject)
      Initializes all persistent data from it's DiagramRepresentationObject except for diagram contents.
      Parameters:
      repObject - object
    • setID

      public void setID(String id)
      Description copied from interface: BaseElement
      Sets the specified ID to the Element.
      Specified by:
      setID in interface BaseElement
      Overrides:
      setID in class com.nomagic.magicdraw.uml.MDElementImpl
      Parameters:
      id - the id to be set.
    • getID

      public String getID()
      Description copied from interface: BaseElement
      Returns the ID of the Element. If the ID is null, new id for an element is generated. Element id is persistence and does not change during project save/load.
      Specified by:
      getID in interface BaseElement
      Overrides:
      getID in class com.nomagic.magicdraw.uml.MDElementImpl
      Returns:
      the ID of the Element.
    • internalAddToCache

      protected void internalAddToCache(AbstractDiagramPresentationElement diagram, @CheckForNull String oldType, @CheckForNull String newType)
    • internalRemoveFromCache

      protected void internalRemoveFromCache(AbstractDiagramPresentationElement diagram)
    • hasNoRegisteredRealTypeDescriptor

      protected boolean hasNoRegisteredRealTypeDescriptor()
    • internalSetDiagramType

      protected abstract void internalSetDiagramType(String type, String umlType)
    • getRepresentation

      public com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject getRepresentation()
    • canAddInstance

      public boolean canAddInstance(PresentationElement symbol)
      Description copied from class: PresentationElement
      Object view has no children.
      Overrides:
      canAddInstance in class PresentationElement
    • getAbstractDiagramPresentationElement

      public AbstractDiagramPresentationElement getAbstractDiagramPresentationElement()
      Description copied from class: PresentationElement
      Returns diagram of this presentation element.
      Overrides:
      getAbstractDiagramPresentationElement in class PresentationElement
      Returns:
      diagram of this presentation element.
    • getCenterlineManager

      public com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineManager getCenterlineManager()
      Gets centerline manager for this diagram.
      Returns:
      centerline manager for this diagram.
    • getContainer

      public com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElementContainer getContainer()
      Returns:
      diagram container
    • resetContainer

      public void resetContainer()
      In case diagram type changes in way AbstractDiagramPresentationElementContainer needs to be changed it should be reset and new one will be created on getContainer() first call.
    • paintSelf

      public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      Specified by:
      paintSelf in class PresentationElement
    • paintChildren

      public void paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      Specified by:
      paintChildren in class PresentationElement
    • intersects

      public boolean intersects(int x, int y, int width, int height, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      checks whether object intersects with given rectangle
      Specified by:
      intersects in class PresentationElement
      Returns:
      true if object and rectangle intersects
    • coversPoint

      public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      checks if object covers provided point
      Specified by:
      coversPoint in class PresentationElement
      Returns:
      true if object covers this point
    • sAddPresentationElement

      public void sAddPresentationElement(PresentationElement element, int index)
      Description copied from class: PresentationElement
      Add given child to this symbol at given index
      Overrides:
      sAddPresentationElement in class PresentationElement
      Parameters:
      element - child to add
      index - index to add at. Can be -1
    • addPresentationElement

      public void addPresentationElement(PresentationElement element, int index)
      Description copied from class: PresentationElement
      Add given child to this symbol at given index
      Overrides:
      addPresentationElement in class PresentationElement
      Parameters:
      element - child to add
      index - index to add at. Can be -1
    • isEmpty

      public boolean isEmpty()
    • getPresentationElements

      public List<PresentationElement> getPresentationElements()
      Description copied from class: PresentationElement
      Returns all children of this element
      Overrides:
      getPresentationElements in class PresentationElement
      Returns:
      all children of this element. The collection is unmodifiable.
    • setPresentationElements

      public void setPresentationElements(List<PresentationElement> elements)
      Description copied from class: PresentationElement
      Sets children of this element
      Overrides:
      setPresentationElements in class PresentationElement
      Parameters:
      elements - children
    • sSetPresentationElements

      public void sSetPresentationElements(List<PresentationElement> elements)
      Description copied from class: PresentationElement
      Sets children of this element
      Overrides:
      sSetPresentationElements in class PresentationElement
      Parameters:
      elements - children
    • setBounds

      public void setBounds(Rectangle r) throws NoRectangleDefinedException
      Description copied from class: PresentationElement
      sets bounds of this object view
      Specified by:
      setBounds in class PresentationElement
      Parameters:
      r - rectangle of bounds
      Throws:
      NoRectangleDefinedException - always
    • sSetBounds

      public void sSetBounds(Rectangle r) throws NoRectangleDefinedException
      Description copied from class: PresentationElement
      Sets bounds of this object view only.
      Specified by:
      sSetBounds in class PresentationElement
      Parameters:
      r - rectangle of bounds.
      Throws:
      NoRectangleDefinedException - always
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener l)
      Just hack, registers the same listener to the container
      Specified by:
      addPropertyChangeListener in interface BaseElement
      Overrides:
      addPropertyChangeListener in class com.nomagic.magicdraw.uml.MDElementImpl
      Parameters:
      l - the PropertyChangeListener to be added.
      See Also:
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener l)
      Just hack, unregister the same listener from the container
      Specified by:
      removePropertyChangeListener in interface BaseElement
      Overrides:
      removePropertyChangeListener in class com.nomagic.magicdraw.uml.MDElementImpl
      Parameters:
      l - the PropertyChangeListener to be removed.
      See Also:
    • getGridSize

      public int getGridSize()
      Returns:
      grid size
    • setGridSize

      public void setGridSize(int grid)
      Sets grid size.
      Parameters:
      grid - grid size
    • snapViewToGrid

      public void snapViewToGrid(PresentationElement el)
      Snaps given symbol to grid
      Parameters:
      el - symbol
    • getPathGridSize

      public float getPathGridSize()
      Returns:
      path grid size
    • sSetGridSize

      public void sSetGridSize(int grid)
      Sets grid size.
      Parameters:
      grid - grid size
    • setShowGrid

      public void setShowGrid(boolean showGrid)
      Sets grid flag
      Parameters:
      showGrid - show grid
    • sSetShowGrid

      public void sSetShowGrid(boolean showGrid)
      Sets grid flag
      Parameters:
      showGrid - show grid value
    • isShowGrid

      public boolean isShowGrid()
      Returns:
      grid flag
    • setSnapToGridPaths

      public void setSnapToGridPaths(boolean snap)
    • sSetSnapToGridPaths

      public void sSetSnapToGridPaths(boolean snap)
    • isSnapToGridPaths

      public boolean isSnapToGridPaths()
    • setSnapToGridShapes

      public void setSnapToGridShapes(boolean snap)
      Snaps symbols to grid.
      Parameters:
      snap - snap value
    • sSetSnapToGridShapes

      public void sSetSnapToGridShapes(boolean snap)
      Snaps symbols to grid.
      Parameters:
      snap - snap value
    • isSnapToGridShapes

      public boolean isSnapToGridShapes()
      Returns:
      snap to grid value
    • getDynamicStyleProviders

      public Collection<com.dassault_systemes.modeler.magic.diagram.DynamicStyleProvider> getDynamicStyleProviders()
    • addDynamicStyleProvider

      public final void addDynamicStyleProvider(com.dassault_systemes.modeler.magic.diagram.DynamicStyleProvider dynamicStyleProvider)
    • removeDynamicStyleProvider

      public final void removeDynamicStyleProvider(com.dassault_systemes.modeler.magic.diagram.DynamicStyleProvider dynamicStyleProvider)
    • addDynamicRepresentationProvider

      public final void addDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
    • removeDynamicRepresentationProvider

      public final void removeDynamicRepresentationProvider(com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider dynamicRepresentationProvider)
    • getDynamicRepresentationProviders

      public Collection<com.nomagic.magicdraw.uml.symbols.DynamicRepresentationProvider> getDynamicRepresentationProviders()
    • getSortManagers

      public List<com.dassault_systemes.modeler.magic.diagram.SortManager> getSortManagers(boolean create)
      Gets sort managers registered for this diagram.
      Parameters:
      create - indicates if sort managers should be created if they aren't created yet.
      Returns:
      sort managers registered for this diagram.
    • getSortManager

      public com.dassault_systemes.modeler.magic.diagram.SortManager getSortManager()
      Returns sort manager for this diagram view.
      Returns:
      symbol sort manager.
    • getManipulationSortManager

      public com.dassault_systemes.modeler.magic.diagram.SortManager getManipulationSortManager()
      Returns manipulation sort manager for this diagram view.
      Returns:
      manipulation symbol sort manager.
    • hasManipulationSortManager

      protected boolean hasManipulationSortManager()
    • getPresentationElementAt

      @CheckForNull public PresentationElement getPresentationElementAt(Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      Gets object view at point.
      Overrides:
      getPresentationElementAt in class PresentationElement
      Parameters:
      relativePoint - object view at point location.
      sortManagerProvider - sort manager for searching elements.
      kind - intersection kind to check for
      Returns:
      object view at this point.
    • getPresentationElementAt

      @CheckForNull public PresentationElement getPresentationElementAt(Point relativePoint, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Searches and returns symbol that covers given point.
      Overrides:
      getPresentationElementAt in class PresentationElement
      Parameters:
      relativePoint - point where searching for symbol
      kind - intersection kind to check for
      Returns:
      symbol that covers given point, null if no objects found
    • getPresentationElementsAt

      public List<PresentationElement> getPresentationElementsAt(Point pt, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Searches and returns all symbols that covers given point.
      Overrides:
      getPresentationElementsAt in class PresentationElement
      Parameters:
      pt - point where searching for symbol
      kind - intersection kind to check for
      Returns:
      object that covers given point, null if no objects found
    • getPresentationElementsAt

      @CheckForNull public List<PresentationElement> getPresentationElementsAt(Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
      Description copied from class: PresentationElement
      Gets object view at point.
      Overrides:
      getPresentationElementsAt in class PresentationElement
      Parameters:
      relativePoint - object view at point location.
      sortManagerProvider - sort manager for searching elements.
      Returns:
      object view at this point.
    • getPresentationElementsAt

      @CheckForNull public List<PresentationElement> getPresentationElementsAt(Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      Gets object view at point.
      Overrides:
      getPresentationElementsAt in class PresentationElement
      Parameters:
      relativePoint - object view at point location.
      sortManagerProvider - sort manager for searching elements.
      kind - intersection kind to check for
      Returns:
      object view at this point.
    • getManipulatedElementAt

      @CheckForNull public PresentationElement getManipulatedElementAt(Point relativePoint, com.nomagic.magicdraw.uml.symbols.SortManagerProvider sortManagerProvider)
      Description copied from class: PresentationElement
      Gets manipulate symbol at specified point pt.
      Overrides:
      getManipulatedElementAt in class PresentationElement
      Parameters:
      relativePoint - Point
      sortManagerProvider - provides sort manager in which to search.
      Returns:
      manipulate symbol
    • getManipulatedElementAt

      @CheckForNull public PresentationElement getManipulatedElementAt(Point pt, com.nomagic.magicdraw.uml.symbols.IntersectionKind intersectionKind)
      Gets manipulate object view at specified point pt.
      Overrides:
      getManipulatedElementAt in class PresentationElement
      Parameters:
      pt - Point
      intersectionKind - intersection kind to check for
      Returns:
      manipulate object view
    • hasSelectableSymbols

      public boolean hasSelectableSymbols()
    • getVisibleBounds

      @CheckForNull public Rectangle getVisibleBounds()
      Returns user visible bounds of the diagram.
      Returns:
      visible bounds or null if the diagram is not opened.
    • atInsert

      public void atInsert()
      Description copied from class: PresentationElement
      Invalidates object at insert
      Specified by:
      atInsert in interface BaseElement
      Overrides:
      atInsert in class PresentationElement
    • dispose

      public void dispose()
      Description copied from class: PresentationElement
      disposes ends of links when link is deleted
      Specified by:
      dispose in interface BaseElement
      Overrides:
      dispose in class PresentationElement
    • firePropertyChange

      public void firePropertyChange(String propertyName, @CheckForNull Object oldValue, @CheckForNull Object newValue)
      Description copied from interface: BaseElement
      Delegates firePropertyChange to the PropertyChangeSupport, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.
      Specified by:
      firePropertyChange in interface BaseElement
      Overrides:
      firePropertyChange in class PresentationElement
      Parameters:
      propertyName - the programmatic name of the property that was changed.
      oldValue - the old value of the property
      newValue - the new value of the property
      See Also:
    • fireContentPropertyChange

      protected void fireContentPropertyChange(PresentationElement source, String propertyName, @CheckForNull Object oldValue, @CheckForNull Object newValue)
      Delegates firePropertyChange to the PropertyChangeSupport, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.
      Parameters:
      source - source element
      propertyName - the programmatic name of the property that was changed.
      oldValue - the old value of the property
      newValue - the new value of the property
      See Also:
    • clearCaches

      protected void clearCaches()
    • collectShowingManipulatedElementsRecursively

      @OpenApi public Collection<PresentationElement> collectShowingManipulatedElementsRecursively()
      Collects all visible manipulated elements in this diagram recursively.
      Returns:
      manipulated elements in this diagram
    • collectShowingPresentationElementsRecursively

      @OpenApi public Collection<PresentationElement> collectShowingPresentationElementsRecursively()
      Collects all visible elements in this diagram recursively.
      Returns:
      visible elements in this diagram
    • collectPresentationElementsRecursively

      @OpenApi public Collection<PresentationElement> collectPresentationElementsRecursively()
      Collects all elements in this diagram recursively.
      Returns:
      elements in this diagram
    • addContentPropertyChangeListener

      @OpenApi public boolean addContentPropertyChangeListener(PropertyChangeListener listener)
      Registers the listener for changes in all symbols contained in the diagram.
      Parameters:
      listener - the PropertyChangeListener to be added
      Returns:
      true if listener was added - it wasn't there yet, otherwise false
    • removeContentPropertyChangeListener

      @OpenApi public boolean removeContentPropertyChangeListener(PropertyChangeListener listener)
      Unregister the given listener from the diagram.
      Parameters:
      listener - the PropertyChangeListener to be removed
      Returns:
      true if listener was removed
    • clone

      Specified by:
      clone in interface BaseElement
      Overrides:
      clone in class PresentationElement
    • isDummyMode

      public boolean isDummyMode()
    • setDummyMode

      public void setDummyMode(boolean dummyMode)
    • canDeleteChild

      public boolean canDeleteChild(BaseElement obj)
      Description copied from interface: BaseElement
      Checks if given element can be deleted from this element. Following rules must be true to have result true: 1.this element must be editable. 2.project must be editable. 3.the type of given child must be valid for teamwork lock for edit operation (for example, class, package etc., not Attribute).
      Specified by:
      canDeleteChild in interface BaseElement
      Overrides:
      canDeleteChild in class com.nomagic.magicdraw.uml.MDElementImpl
      Parameters:
      obj - a given child
      Returns:
      true, if the given element can be deleted from the current element.
    • useParentStyle

      public boolean useParentStyle()
      Description copied from class: PresentationElement
      Does this element uses parent style or has it's own?
      Overrides:
      useParentStyle in class PresentationElement
      Returns:
      true, if element does not have style and uses parent's style.
    • getSurfaces

      public final com.dassault_systemes.modeler.magic.diagram.DiagramSurfaces getSurfaces()
    • isSymbolDiagram

      @OpenApi public boolean isSymbolDiagram()
      Checks if diagram displays symbols as its contents. Another type of diagrams may be tables, matrices.
      Returns:
      true if diagram displays symbols
    • accept

      @OpenApi public void accept(Visitor visitor) throws Exception
      Description copied from interface: MDElement
      Method accepts a visitor, and calls method "visit<class name>(this)" of a visitor. See "Visitor" pattern for more details.
      Specified by:
      accept in interface MDElement
      Overrides:
      accept in class com.nomagic.magicdraw.uml.MDElementImpl
      Parameters:
      visitor - which visits this element.
      Throws:
      Exception
    • unloadDiagram

      public void unloadDiagram() throws Exception
      Disposes all symbols and creates not loaded data.
      Throws:
      Exception - in case of some error
    • internalClearOnUnload

      protected void internalClearOnUnload()
    • recalculateInternalDataRequired

      public void recalculateInternalDataRequired()
    • isLoaded

      @OpenApi public boolean isLoaded()
      Check if the diagram is loaded.
      Returns:
      true if diagram contents is loaded
    • getContentState

      public final com.nomagic.magicdraw.uml.symbols.DiagramContentState getContentState()
    • ensureLoaded

      @OpenApi public void ensureLoaded()
      Ensures that the diagram is loaded. If the diagram is not loaded, load it. Make sure the project is active before invoking this method. Otherwise, the diagram may not be loaded.
    • loadContents

      public void loadContents(@CheckForNull ProgressStatus status)
      Loads diagram to memory. This method should be used only when the diagram is not loaded. Make sure the project is active before invoking this method. Otherwise, the diagram may not be loaded.
      Parameters:
      status - progress status.
    • cleanupAfterLoad

      public void cleanupAfterLoad()
    • isForceStoreContentOnSave

      public boolean isForceStoreContentOnSave()
    • setForceStoreContentOnSave

      public void setForceStoreContentOnSave(boolean forceStoreContentOnSave)
    • sSetForceStoreContentOnSave

      protected void sSetForceStoreContentOnSave(boolean forceStoreContentOnSave)
    • getDiagramTypeAsString

      public abstract String getDiagramTypeAsString()
    • getRealType

      @CheckForNull public String getRealType()
      Returns real diagram type. Real diagram type is a diagram type that is not registered but was persisted before.
      Returns:
      real type
    • isUseFlowLayoutLogic

      public boolean isUseFlowLayoutLogic()
    • layout

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) public final boolean layout(boolean useCommands)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Layouting.layout(AbstractDiagramPresentationElement) or com.nomagic.magicdraw.uml.symbols.layout.Layouting#layoutNoSession(AbstractDiagramPresentationElement)
      Layout the diagram using default layouter. Only selected symbols in the diagram are layouted. All symbols are layouted if selection is empty. Use PresentationElement.setSelected(java.util.List)} to select symbols in the diagram.
      Parameters:
      useCommands - true to create commands. If true, this command will be available in the project's command history.
      Returns:
      true if layout was performed.
    • layout

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) public abstract boolean layout(boolean useCommands, DiagramLayouter layouter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Layouting.layout(AbstractDiagramPresentationElement, String) or com.nomagic.magicdraw.uml.symbols.layout.Layouting#layoutNoSession(AbstractDiagramPresentationElement, String)
      Layouts the diagram with the specified layouter. Only selected symbols in the diagram are layouted. All symbols are layouted if selection is empty. Use PresentationElement.setSelected(java.util.List)} to select symbols in the diagram.
      Parameters:
      useCommands - true to create commands. If true, this command will be available in the project's command history
      layouter - layouter to be used for layouting
      Returns:
      true if layout was performed.
    • layout

      @OpenApi @Deprecated(since="2024x Refresh3", forRemoval=true) public boolean layout(boolean useCommands, DiagramLayouter diagramLayouter, AbstractDiagramLayouterOptionsGroup options)
      Deprecated, for removal: This API element is subject to removal in a future version.
      use Layouting.layout(AbstractDiagramPresentationElement, String, AbstractDiagramLayouterOptionsGroup) or com.nomagic.magicdraw.uml.symbols.layout.Layouting#layoutNoSession(AbstractDiagramPresentationElement, String, AbstractDiagramLayouterOptionsGroup)
      Layout the diagram. Only selected symbols in the diagram are layouted. All symbols are layouted if selection is empty. Use PresentationElement.setSelected(java.util.List)} to select symbols in the diagram.
      Parameters:
      useCommands - true to create commands. If true, this command will be available in the project's command history
      diagramLayouter - layouter to use
      options - layout options
      Returns:
      true if layout was performed
    • getDefaultDiagramLayouter

      public abstract DiagramLayouter getDefaultDiagramLayouter()
    • isShowDiagramFrame

      public boolean isShowDiagramFrame()
    • getDiagramFrame

      @CheckForNull public abstract com.nomagic.magicdraw.uml.symbols.shapes.BaseHeaderShapeView getDiagramFrame()
    • sSetDiagramFrame

      public void sSetDiagramFrame(@CheckForNull com.nomagic.magicdraw.uml.symbols.shapes.BaseHeaderShapeView symbol)
    • updateFrameSize

      public void updateFrameSize(PresentationElement element)
    • applyForcedProperties

      public abstract void applyForcedProperties()
    • getRepresentationFromModelElement

      public abstract com.nomagic.magicdraw.core.diagram.DiagramRepresentationObject getRepresentationFromModelElement()
    • registerInProject

      public void registerInProject()
    • unregisterFromProject

      public void unregisterFromProject()
    • getDiagramType

      public abstract AbstractDiagramType getDiagramType()
    • postOpenFromCommand

      public void postOpenFromCommand()
    • getZoom

      public float getZoom()
    • getPathToMoveCache

      public com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElement.PathToMoveCache getPathToMoveCache()
      Returns:
      paths to move cache
    • getContentHash

      @CheckForNull public String getContentHash()
    • setContentHash

      public void setContentHash(@CheckForNull String contentHash)
      Sets identifier of contents.
      Parameters:
      contentHash - content hash
    • isShapesAutoResizeSuspended

      public boolean isShapesAutoResizeSuspended()
    • sSetShapesAutoResizeSuspended

      public void sSetShapesAutoResizeSuspended(boolean enabled)
    • setShapesAutoResizeSuspended

      public void setShapesAutoResizeSuspended(boolean enabled)
    • autosizeSuspendedSymbolsWithHiddenContent

      public void autosizeSuspendedSymbolsWithHiddenContent()
    • isLabelsAutoDisplaySuspended

      public boolean isLabelsAutoDisplaySuspended()
    • sSetLabelsAutoDisplaySuspended

      public void sSetLabelsAutoDisplaySuspended(boolean enabled)
    • setLabelsAutoDisplaySuspended

      public void setLabelsAutoDisplaySuspended(boolean enabled)
    • getSuspendShapeAutoResizeMode

      public String getSuspendShapeAutoResizeMode()
    • sSetSuspendShapeAutoResizeMode

      public void sSetSuspendShapeAutoResizeMode(String mode)
    • setSuspendShapeAutoResizeMode

      public void setSuspendShapeAutoResizeMode(String mode)
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Description copied from class: PresentationElement
      Listens for property change it can be: data was edited text box was edited
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class PresentationElement
    • isModified

      public boolean isModified()
    • setModified

      public void setModified(boolean modified)
    • canAddChild

      public boolean canAddChild(PresentationElement symbol)
      Description copied from class: PresentationElement
      Check of given symbol can be added as child into this symbol.
      Overrides:
      canAddChild in class PresentationElement
      Parameters:
      symbol - symbol
      Returns:
      true if symbol can be added
    • findPresentationElement

      @OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull Element element, @CheckForNull Class presentationElementClass)
      Finds a presentation element for a given model element of a given symbol type in this diagram. Does recursive search in the diagram.
      Parameters:
      element - the given ModelElement.
      presentationElementClass - the class of presentation element or null if any.
      Returns:
      found presentation element or null if given ModelElement does not have a presentation element in this diagram.
    • findPresentationElement

      @OpenApi @CheckForNull public final PresentationElement findPresentationElement(@CheckForNull com.dassault_systemes.modeler.foundation.model.ModelElement element, @CheckForNull Class presentationElementClass)
      Finds a presentation element for a given model element of the given symbol type in this diagram. Does recursive search in the diagram.
      Parameters:
      element - the given ModelElement.
      presentationElementClass - the class of presentation element or null if any.
      Returns:
      found presentation element or null if given ModelElement does not have a presentation element in this diagram.
    • findPresentationElements

      public final Collection<PresentationElement> findPresentationElements(Predicate<PresentationElement> predicate)
      Finds manipulated presentation elements matching given predicate. Does recursive search in the diagram.
      Parameters:
      predicate - predicate
      Returns:
      found presentation element or null if given ModelElement does not have a presentation element in this diagram.
    • findPresentationElements

      public final <S extends PresentationElement> Collection<S> findPresentationElements(Class<S> classType)
      Finds manipulated presentation elements matching given class type. Does recursive search in the diagram.
      Parameters:
      classType - class type
      Returns:
      found presentation element or null if given ModelElement does not have a presentation element in this diagram.
    • findPresentationElementForPathConnecting

      @CheckForNull @OpenApi public final PresentationElement findPresentationElementForPathConnecting(BaseElement element, Class presentationElementClass)
      Finds a presentation element to connect some PathElement for given model element of the given type in this diagram. Does recursive search.
      Parameters:
      element - the given ModelElement
      presentationElementClass - the class of presentation element or null if any.
      Returns:
      found presentation element or null if given ModelElement does not have a presentation element in this diagram.
    • findPresentationElementsForPathConnecting

      @OpenApi public final Stream<PresentationElement> findPresentationElementsForPathConnecting(Element element, Class presentationElementClass)
      Finds all symbols to connect some PathElement for a given model element of a given type in this diagram. Does recursive search.
      Parameters:
      element - the given ModelElement
      presentationElementClass - the class of presentation element or null if any.
      Returns:
      a stream of presentation elements
    • getBounds

      public Rectangle getBounds()
      Delegate bounds request to its container.
      Overrides:
      getBounds in class PresentationElement
      Returns:
      bounds
      See Also:
      • PresentationElementsManager.reshapeShapeElement
    • setOpenConfigurator

      public void setOpenConfigurator(@CheckForNull com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElement.OpenConfigurator openConfigurator)
      Sets open configurator.
      Parameters:
      openConfigurator - open configurator.
    • getOpenConfigurator

      @CheckForNull public com.nomagic.magicdraw.uml.symbols.AbstractDiagramPresentationElement.OpenConfigurator getOpenConfigurator()
    • initialize

      public void initialize()
      Description copied from class: PresentationElement
      Initialize symbol and its children state. Symbol must be initialized before doing any resize, painting and etc. These operations can lead to unpredictable results otherwise.
      Overrides:
      initialize in class PresentationElement
    • setInitializer

      public void setInitializer(com.nomagic.magicdraw.uml.symbols.DiagramPresentationElementInitializer initializer)
      Sets custom diagram presentation element initializer.
      Parameters:
      initializer - custom diagram presentation element initializer.
    • open

      @OpenApi public void open()
      Open the diagram
    • open

      @OpenApi public void open(boolean showProgress)
      Open the diagram in a new diagram tab, or activates diagram tab if this diagram is already open
      Parameters:
      showProgress - show progress dialog
    • open

      public void open(boolean loadContent, boolean showProgress)
      Open the diagram.
      Parameters:
      loadContent - load diagram content
      showProgress - show progress dialog
    • openInActiveTab

      @OpenApi public void openInActiveTab(boolean showProgress)
      Open diagram in currently active diagram tab If no other diagram is opened yet, creates a new tab If this diagram is already opened, simply activates that tab
      Parameters:
      showProgress - show progress dialog
    • open

      public void open(boolean loadContent, boolean showProgress, boolean inActiveTab)
      Open the diagram.
      Parameters:
      loadContent - load diagram content
      showProgress - show progress dialog
    • isOpening

      public boolean isOpening()
      Returns:
      true if the diagram is in opening mode at the moment
    • close

      @OpenApi public final void close()
      Closes diagram window.
    • close

      public void close(boolean closeWindow)
      Closes opened diagram If closeWindow is 'false' and there is a possibility to back to the previous diagram in that window, when the previous diagram is opened Otherwise, diagram window is closed
      Parameters:
      closeWindow - if a window should be closed
    • getLineJumpPlace

      public com.nomagic.magicdraw.uml.symbols.LineJumpPlace getLineJumpPlace()
      Returns current line jump place value of the diagram.
      Returns:
      line jump place mode
    • sSetLineJumpPlace

      public void sSetLineJumpPlace(com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)
      Sets value of line jump place.
      Parameters:
      lineJumpPlace - line jump place mode
    • getDiagramOrientationMode

      public String getDiagramOrientationMode()
      Gets diagram orientation mode.
      Returns:
      diagram orientation mode.
    • hasVerticalOrientation

      public boolean hasVerticalOrientation()
      Returns true if diagram has vertical orientation.
      Returns:
      true if the diagram has vertical orientation, false otherwise.
    • getBackgroundColor

      public Color getBackgroundColor()
      Returns:
      background color
    • setUseGradientForFill

      public void setUseGradientForFill(boolean use)
      Sets elements gradient fill option. Will presentation element use gradient fill, or not for painting.
      Parameters:
      use - true to use.
    • isUseGradientForFill

      public boolean isUseGradientForFill()
      Do we need to use gradient for fill color? Returns value of fill gradient property.
      Overrides:
      isUseGradientForFill in class PresentationElement
      Returns:
      True, when use gradient fill property is true.
    • internalSilentApply

      public void internalSilentApply()
      Description copied from class: PresentationElement
      Silently applies all properties after initialization
      Overrides:
      internalSilentApply in class PresentationElement
    • internalApplyProperties

      public void internalApplyProperties(com.dassault_systemes.modeler.magic.diagram.styledelegates.PresentationElementStyleChanger changer)
      Description copied from class: PresentationElement
      Applies properties from given property manager
      Overrides:
      internalApplyProperties in class PresentationElement
      Parameters:
      changer - new properties
    • preferredSize

      public void preferredSize(Dimension dim)
    • recursiveAutosize

      public void recursiveAutosize()
      Description copied from class: PresentationElement
      Resize recursively all symbols. Method must be called if something is changed in symbol (for example minimum size) and you want to resize (autosize) all hierarchy
      Overrides:
      recursiveAutosize in class PresentationElement
    • calculateInitialDiagramFrameBounds

      @CheckForNull protected Rectangle calculateInitialDiagramFrameBounds()
      Gets bounds which should be set for the diagram's frame.
    • adjustInitialDiagramFrameBounds

      public static void adjustInitialDiagramFrameBounds(Rectangle bounds)
      Adjust initial diagram frame bounds.
      Parameters:
      bounds - bounds
    • setInitialDiagramFrameBounds

      public void setInitialDiagramFrameBounds()
      Sets initial diagram frame bounds for this diagram's frame.
    • getOwnStyleDelegate

      public com.dassault_systemes.modeler.foundation.diagram.style.DiagramStylePropertyDelegate getOwnStyleDelegate()
      Overrides:
      getOwnStyleDelegate in class PresentationElement
      Returns:
      the own style property delegate
    • setZoomProvider

      public static void setZoomProvider(Function<AbstractDiagramPresentationElement,Float> provider)
    • setValue

      public <T> void setValue(Object key, @CheckForNull T value)
    • getValue

      @CheckForNull public <T> T getValue(Object key)
    • getValueOrCompute

      public <T> T getValueOrCompute(Object key, Supplier<T> valueSupplier)