Class DiagramShape

  • All Implemented Interfaces:
    BaseElement, com.nomagic.magicdraw.uml.CompartmentSupport, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.CompartmentContainer, com.nomagic.magicdraw.uml.symbols.CompartmentOwner, com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner, com.nomagic.magicdraw.uml.symbols.shapes.QualifiedNameLabelOwner, StereotypesDisplayModeOwner, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, com.nomagic.magicdraw.uml.symbols.Wrapable, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener

    @OpenApi
    public class DiagramShape
    extends com.nomagic.magicdraw.uml.symbols.shapes.FrameView
    implements com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
    • Field Detail

      • DEFAULT_DIAGRAM_OVERVIEW_SIZE

        public static final UnmodifiableDimension DEFAULT_DIAGRAM_OVERVIEW_SIZE
        Default diagram shape size when in diagram overview mode.
      • diagramTypeListener

        private com.nomagic.magicdraw.uml.symbols.shapes.DiagramShape.DiagramTypeListener diagramTypeListener
      • representedDiagramContentListener

        private com.nomagic.magicdraw.uml.symbols.shapes.DiagramShape.RepresentedDiagramContentListener representedDiagramContentListener
        Listens to the changes in a diagram shown in the content compartment. Any change in the diagram needs this shape to be re-sized or repainted.
    • Constructor Detail

      • DiagramShape

        public DiagramShape()
    • Method Detail

      • internalGetHeaderInsets

        protected com.nomagic.ui.UnmodifiableInsets internalGetHeaderInsets()
        Overrides:
        internalGetHeaderInsets in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • displayFullDiagramOverview

        public boolean displayFullDiagramOverview()
        Indicates if diagram overview displays detailed diagram frame.
        Returns:
        true if detailed diagram is displayed, false otherwise.
      • getDefaultDimension

        protected UnmodifiableDimension getDefaultDimension()
        Overrides:
        getDefaultDimension in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • isFrameCompletelySuppressed

        private boolean isFrameCompletelySuppressed()
      • accept

        public void accept​(Visitor visitor)
                    throws java.lang.Exception
        Description copied from interface: MDElement
        Method accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.
        Specified by:
        accept in interface MDElement
        Overrides:
        accept in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • getHeaderView

        public com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderView getHeaderView()
        Overrides:
        getHeaderView in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • getRepresentedDiagramView

        @CheckForNull
        public DiagramPresentationElement getRepresentedDiagramView()
        Gets diagram presentation element represented by this diagram shape.
        Returns:
        presentation element of the diagram, represented by this shape.
      • updateChildrenVisibility

        public void updateChildrenVisibility()
        Overrides:
        updateChildrenVisibility in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • setStereotypesDisplayMode

        public void setStereotypesDisplayMode​(java.lang.String mode)
        Description copied from interface: StereotypesDisplayModeOwner
        Sets stereotype display mode value.
        Specified by:
        setStereotypesDisplayMode in interface StereotypesDisplayModeOwner
        Overrides:
        setStereotypesDisplayMode in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Parameters:
        mode - stereotype display mode.
      • sSetStereotypesDisplayMode

        public void sSetStereotypesDisplayMode​(java.lang.String mode)
        Description copied from interface: StereotypesDisplayModeOwner
        Simple sets (no updates) stereotypes display mode.
        Specified by:
        sSetStereotypesDisplayMode in interface StereotypesDisplayModeOwner
        Overrides:
        sSetStereotypesDisplayMode in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Parameters:
        mode - stereotypes display mode value.
      • getStereotypesToDisplay

        protected com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView.StereotypeDisplayData getStereotypesToDisplay()
        Overrides:
        getStereotypesToDisplay in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • setStereotype

        public void setStereotype()
        Overrides:
        setStereotype in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • updateStereotypeIcon

        private void updateStereotypeIcon()
      • getStereotypeIconView

        private com.nomagic.magicdraw.uml.symbols.shapes.StereotypeIconView getStereotypeIconView()
      • isShowAbbreviatedType

        public boolean isShowAbbreviatedType()
      • sSetShowAbbreviatedType

        public void sSetShowAbbreviatedType​(boolean showAbbreviatedType)
      • setShowAbbreviatedType

        public void setShowAbbreviatedType​(boolean showAbbreviatedType)
      • isShowDiagramName

        public boolean isShowDiagramName()
        Specified by:
        isShowDiagramName in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowDiagramName

        public void sSetShowDiagramName​(boolean show)
      • setShowDiagramName

        public void setShowDiagramName​(boolean show)
      • isShowParameters

        public boolean isShowParameters()
        Specified by:
        isShowParameters in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowParameters

        public void sSetShowParameters​(boolean show)
      • setShowParameters

        public void setShowParameters​(boolean show)
      • isShowContextName

        public boolean isShowContextName()
        Specified by:
        isShowContextName in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowContextName

        public void sSetShowContextName​(boolean show)
      • setShowContextName

        public void setShowContextName​(boolean show)
      • isShowContextType

        public boolean isShowContextType()
        Specified by:
        isShowContextType in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowContextType

        public void sSetShowContextType​(boolean show)
      • setShowContextType

        public void setShowContextType​(boolean show)
      • isShowDiagramType

        public boolean isShowDiagramType()
        Specified by:
        isShowDiagramType in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowDiagramType

        public void sSetShowDiagramType​(boolean show)
      • setShowDiagramType

        public void setShowDiagramType​(boolean show)
      • isShowContextKind

        public boolean isShowContextKind()
        Specified by:
        isShowContextKind in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • sSetShowContextKind

        public void sSetShowContextKind​(boolean show)
      • setShowContextKind

        public void setShowContextKind​(boolean show)
      • sSetUseStereotypeMode

        public void sSetUseStereotypeMode​(java.lang.String mode)
        Simple set for diagram use stereotype mode property
        Parameters:
        mode - - diagram orientation mode.
      • setUseStereotypeMode

        public void setUseStereotypeMode​(java.lang.String mode)
        Sets diagram use stereotype mode.
        Parameters:
        mode - - diagram orientation mode.
      • getUseStereotypeMode

        public java.lang.String getUseStereotypeMode()
        Specified by:
        getUseStereotypeMode in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • internalSilentApply

        public void internalSilentApply()
        Description copied from class: PresentationElement
        Silently applies all properties after initialization
        Overrides:
        internalSilentApply in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • internalApplyProperties

        public void internalApplyProperties​(PropertyManager man)
        Description copied from class: PresentationElement
        Applies properties from given property manager
        Overrides:
        internalApplyProperties in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Parameters:
        man - new properties
      • isShowAbbreviatedDiagramType

        public boolean isShowAbbreviatedDiagramType()
        Specified by:
        isShowAbbreviatedDiagramType in interface com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameHeaderOwner
      • createSmartListenerConfig

        protected void createSmartListenerConfig​(java.util.List<SmartListenerConfig> configurations)
        Overrides:
        createSmartListenerConfig in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • disposeListener

        protected void disposeListener()
      • internalCreatePropertyChangeListener

        protected void internalCreatePropertyChangeListener​(com.nomagic.magicdraw.uml.symbols.PresentationElement.SmartListenerConfigData data)
      • 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 com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • atInsert

        public void atInsert()
        Description copied from class: PresentationElement
        Invalidates object at insert
        Specified by:
        atInsert in interface BaseElement
        Overrides:
        atInsert in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • registerListenerToDiagram

        private void registerListenerToDiagram()
      • unregisterListenerFromDiagram

        private void unregisterListenerFromDiagram()
      • internalSpecificUpdate

        protected void internalSpecificUpdate()
        Overrides:
        internalSpecificUpdate in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • sSetShowDiagramHeader

        public void sSetShowDiagramHeader​(boolean show)
        Sets show diagram header property value.
        Parameters:
        show - show diagram header property value.
      • isShowDiagramHeader

        public boolean isShowDiagramHeader()
        Gets show diagram header property value.
        Returns:
        show diagram header property value.
      • setShowDiagramHeader

        public void setShowDiagramHeader​(boolean show)
        Sets show diagram header property value.
        Parameters:
        show - show diagram header property value.
      • sSetShowDiagramOverviewContent

        public void sSetShowDiagramOverviewContent​(boolean show)
        Simple sets show diagram overview content symbol property value.
        Parameters:
        show - show diagram overview content value.
      • isShowDiagramOverviewContent

        public boolean isShowDiagramOverviewContent()
        Gets show diagram overview content symbol property value.
        Returns:
        show diagram overview content property value.
      • isAutoScaleDiagramOverviewContent

        public boolean isAutoScaleDiagramOverviewContent()
        Gets auto scale diagram overview content property value.
        Returns:
        auto scale diagram overview content property value.
      • sSetAutoScaleDiagramOverviewContent

        public void sSetAutoScaleDiagramOverviewContent​(boolean autoScale)
        Simple sets auto scale diagram overview content symbol property value.
        Parameters:
        autoScale - auto scale diagram overview content property value.
      • setAutoScaleDiagramOverviewContent

        public void setAutoScaleDiagramOverviewContent​(boolean autoScale)
        Sets autos cale diagram overview content symbol property value.
        Parameters:
        autoScale - auto scale diagram overview content property value.
      • setShowDiagramOverviewContent

        public void setShowDiagramOverviewContent​(boolean show)
        Sets show diagram overview content symbol property value.
        Parameters:
        show - show diagram overview content value.
      • isShowBorder

        public boolean isShowBorder()
      • setShowBorder

        public void setShowBorder​(boolean showBorder)
      • sSetShowBorder

        public void sSetShowBorder​(boolean showBorder)
      • setDiagramOverviewViews

        public void setDiagramOverviewViews​(java.util.List<PresentationElement> views)
      • isShowMoreSignInDiagramOverviewContent

        public boolean isShowMoreSignInDiagramOverviewContent()
        Returns:
        true if "more sign" should be visible in overview compartment
      • sSetShowMoreSignInDiagramOverviewContent

        public void sSetShowMoreSignInDiagramOverviewContent​(boolean showMoreSign)
        Set "more sign" visibility for overview content compartment. Update/resize shape.
        Parameters:
        showMoreSign - new flag value
      • setShowMoreSignInDiagramOverviewContent

        public void setShowMoreSignInDiagramOverviewContent​(boolean showMoreSign)
        Set "more sign" visibility for overview content compartment
        Parameters:
        showMoreSign - new flag value
      • hasRefreshAction

        public boolean hasRefreshAction()
        Indicates if this diagram shape has refresh action.
        Returns:
        true if diagram has refresh action, false otherwise.
      • drawFrameBoundary

        protected void drawFrameBoundary​(java.awt.Graphics2D g2,
                                         java.awt.Rectangle bounds)
        Overrides:
        drawFrameBoundary in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • drawFrameShadow

        protected void drawFrameShadow​(java.awt.Graphics2D g,
                                       java.awt.Rectangle bounds)
        Overrides:
        drawFrameShadow in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • paintSelfBackground

        public void paintSelfBackground​(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
        Overrides:
        paintSelfBackground in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • fill

        protected void fill​(java.awt.Graphics2D g,
                            java.awt.Rectangle bounds)
        Overrides:
        fill in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • scale

        private static int scale​(double scale,
                                 int size)
      • getDiagramFrameView

        @CheckForNull
        private DiagramFrameView getDiagramFrameView()
      • selfSpecificHeaderShapeDraw

        protected void selfSpecificHeaderShapeDraw​(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
        Overrides:
        selfSpecificHeaderShapeDraw in class com.nomagic.magicdraw.uml.symbols.shapes.FrameView
      • internalGetSelfManipulationPreferredSize

        protected UnmodifiableDimension internalGetSelfManipulationPreferredSize()
        Overrides:
        internalGetSelfManipulationPreferredSize in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • sSetAutosize

        public void sSetAutosize​(boolean s)
        Description copied from class: ShapeElement
        Simple setter for autosize flag.
        Overrides:
        sSetAutosize in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
        Parameters:
        s - value
      • getPreferredDimensionForAutosize

        public UnmodifiableDimension getPreferredDimensionForAutosize()
        Description copied from class: PresentationElement
        Returns preferable dimension of the element for autosize.This implementation simple returns preferred size.
        Overrides:
        getPreferredDimensionForAutosize in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Returns:
        preferred dimension
      • getDiagramOverviewCompartmentView

        public com.nomagic.magicdraw.uml.symbols.shapes.DiagramOverviewCompartmentView getDiagramOverviewCompartmentView()
        Gets diagram overview compartment.
        Returns:
        diagram overview compartment.
      • getDefaultDiagramOverviewSize

        public UnmodifiableDimension getDefaultDiagramOverviewSize()
        Gets default size of the diagram shape when diagram overview is turned on.
        Returns:
        default diagram shape size.
      • getFillColor

        public java.awt.Color getFillColor()
        Description copied from class: PresentationElement
        Returns fill color
      • findParentForData

        public Element findParentForData​(PresentationElement newParent,
                                         com.nomagic.uml2.ElementAddContext addContext)
      • getDisplayedViews

        public java.util.Collection<PresentationElement> getDisplayedViews()
        Returns:
        collection of presentation elements that are currently visible inside the DiagramOverviewCompartmentView
      • clone

        public DiagramShape clone()
        Description copied from class: ElementImpl
        Returns a copy of the Element.
        Specified by:
        clone in interface BaseElement
        Overrides:
        clone in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Returns:
        the cloned object