Class DiagramFrameView

  • 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.PortOwner, 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 DiagramFrameView
    extends com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
    implements com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
    • Field Detail

      • SHAPE_DISTANCE_FROM_EDGE

        public static final int SHAPE_DISTANCE_FROM_EDGE
        See Also:
        Constant Field Values
      • FRAME_DISTANCE_FROM_EDGE

        public static final int FRAME_DISTANCE_FROM_EDGE
        See Also:
        Constant Field Values
      • DIAGRAM_TYPES_FOR_PORTS_ON_FRAME

        public static final java.util.List<java.lang.String> DIAGRAM_TYPES_FOR_PORTS_ON_FRAME
      • frameElementsBounds

        private java.awt.Rectangle frameElementsBounds
      • diagramTypeListener

        private final java.beans.PropertyChangeListener diagramTypeListener
    • Constructor Detail

      • DiagramFrameView

        public DiagramFrameView()
    • Method Detail

      • 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.HeaderShapeView
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • selfSpecificHeaderShapeDraw

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

        protected boolean canFill()
        Returns:
        true if symbol can be filled with some color
      • getFillColor

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

        private int getCornerArcSize()
      • hasRoundedCorners

        private boolean hasRoundedCorners()
      • getResourceID

        public java.lang.String getResourceID()
        Specified by:
        getResourceID in interface MDElement
        Overrides:
        getResourceID in class com.nomagic.magicdraw.uml.MDElementImpl
      • useParentProperties

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

        public PresentationElement getParentSymbolPropertyOwner()
        Description copied from class: PresentationElement
        Returns parent symbol property manager to which this symbol delegates symbol property related functionality.
        Returns:
        parent parent symbol to delegate or null if this symbol does not delegate.
      • mustShowContextMenu

        public boolean mustShowContextMenu()
      • intersects

        public boolean intersects​(int x,
                                  int y,
                                  int width,
                                  int height)
        Description copied from class: PresentationElement
        checks whether object intersects with given rectangle
        Returns:
        true if object and rectangle intersects
      • coversPoint

        public boolean coversPoint​(int x,
                                   int y)
        Description copied from class: PresentationElement
        checks if object covers provided point
        Overrides:
        coversPoint in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
        Returns:
        true if object covers this point
      • adjustBoundsForMoving

        public java.awt.Rectangle adjustBoundsForMoving​(java.awt.Rectangle rec,
                                                        java.util.Collection<PresentationElement> movedTogether)
        Description copied from class: PresentationElement
        validate bounds for moving
        Overrides:
        adjustBoundsForMoving in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • canAddInstance

        public boolean canAddInstance​(PresentationElement obj)
        Description copied from class: PresentationElement
        Object view has no children.
        Overrides:
        canAddInstance in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • getEncapsulatedClassifier

        public EncapsulatedClassifier getEncapsulatedClassifier()
        Specified by:
        getEncapsulatedClassifier in interface com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
      • getEncapsulatedClassifierProvider

        public TypedElement getEncapsulatedClassifierProvider()
        Specified by:
        getEncapsulatedClassifierProvider in interface com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
      • createSmartListenerConfig

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

        protected void preferredSizeIgnoringOrientation​(java.awt.Dimension pref,
                                                        int locationX,
                                                        int locationY)
        Overrides:
        preferredSizeIgnoringOrientation in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • prefSizeByFrameElementBounds

        private void prefSizeByFrameElementBounds​(java.awt.Dimension pref)
      • minimumOrMinimumShrinkableDimension

        protected void minimumOrMinimumShrinkableDimension​(java.awt.Dimension size)
      • minimumSizeForShrinkingIgnoringOrientation

        public void minimumSizeForShrinkingIgnoringOrientation​(java.awt.Dimension size,
                                                               int locationX,
                                                               int locationY)
        Overrides:
        minimumSizeForShrinkingIgnoringOrientation in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • adjustToAspectRatio

        private void adjustToAspectRatio​(java.awt.Dimension size)
      • calculateAspectRatio

        @CheckForNull
        private static java.lang.Double calculateAspectRatio​(java.lang.String value)
      • canMoveChildOutside

        protected boolean canMoveChildOutside​(PresentationElement element)
        Overrides:
        canMoveChildOutside in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • internalLayoutChildren

        public void internalLayoutChildren​(boolean calculatePrefSize)
        Overrides:
        internalLayoutChildren in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • providesVerticalCenterline

        public boolean providesVerticalCenterline()
        Specified by:
        providesVerticalCenterline in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • providesHorizontalCenterline

        public boolean providesHorizontalCenterline()
        Specified by:
        providesHorizontalCenterline in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • isHorizontalCenterlineProvider

        public boolean isHorizontalCenterlineProvider()
        Description copied from class: ShapeElement
        Indicates whether this shape provides horizontal centerlines to other shapes.
        Returns:
        true if this shape provides horizontal centerlines, false otherwise.
      • isVerticalCenterlineProvider

        public boolean isVerticalCenterlineProvider()
        Description copied from class: ShapeElement
        Indicates whether this shape provides vertical centerlines to other shapes.
        Returns:
        true if this shape provides vertical centerlines, false otherwise.
      • movePathElement

        protected void movePathElement​(PathElement link,
                                       @CheckForNull
                                       PathConnector requestor)
        Description copied from class: PathConnector
        Calculates position of path element.
        Parameters:
        link - element which position will be calculated.
        requestor - the requestor of this path moving. Implementations may check in order to avoid endless loops.
      • getStereotypesToDisplay

        protected com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView.StereotypeDisplayData getStereotypesToDisplay()
        Overrides:
        getStereotypesToDisplay in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • 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
      • internalSpecificUpdate

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

        public boolean snapsToCenterlines()
        Specified by:
        snapsToCenterlines in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • getFrameElementBounds

        public java.awt.Rectangle getFrameElementBounds()
      • calculateFrameElementBounds

        public void calculateFrameElementBounds()
      • hasBoundaryDetails

        public boolean hasBoundaryDetails()
        Returns true if frame carries details on its border. If the frame is plain, false is returned.
        Returns:
        true if frame carries details on border, false otherwise.
      • getFramePresentationElements

        private java.lang.Iterable<PresentationElement> getFramePresentationElements​(com.nomagic.magicdraw.uml.symbols.DiagramObjectViewContainer container)
      • isShapeOnBorder

        private boolean isShapeOnBorder​(ShapeElement shape)
        Parameters:
        shape - shape
        Returns:
        true if shape is on frame border or shape is a child of another shape on frame border
      • isPathConnectedToShapeOnBorder

        private boolean isPathConnectedToShapeOnBorder​(PathElement path)
        Parameters:
        path - path
        Returns:
        true if path connected directly or indirectly to some shape on border. Indirectly can be few cases - a) connected to child of shape on border or b) connected to another link which is connected to shape on border
      • layoutFrame

        public void layoutFrame()
      • autosizeShapesOnEdge

        private void autosizeShapesOnEdge()
      • calculatePreferredFrameBounds

        private com.nomagic.magicdraw.uml.symbols.shapes.DiagramFrameView.FrameBounds calculatePreferredFrameBounds()
      • fixFrameTop

        private void fixFrameTop​(java.awt.Rectangle frameBounds,
                                 java.awt.Rectangle elementBounds,
                                 int childDistanceTop)
      • fixFrameLeft

        private void fixFrameLeft​(java.awt.Rectangle frameBounds,
                                  java.awt.Rectangle elementBounds,
                                  int childDistanceLeft)
      • fixFrameRight

        private static void fixFrameRight​(java.awt.Rectangle frameBounds,
                                          java.awt.Rectangle elementBounds)
      • fixFrameBottom

        private static void fixFrameBottom​(java.awt.Rectangle frameBounds,
                                           java.awt.Rectangle elementBounds)
      • getHumanType

        public java.lang.String getHumanType()
        Description copied from class: PresentationElement
        Returns human representation of the data type
        Specified by:
        getHumanType in interface BaseElement
        Returns:
        the name of the data
      • getHumanName

        public java.lang.String getHumanName()
        Description copied from class: PresentationElement
        Returns human representation of the data type
        Specified by:
        getHumanName in interface BaseElement
        Returns:
        the name of the data
      • internalPostUpdatePresentationElement

        protected void internalPostUpdatePresentationElement()
        Overrides:
        internalPostUpdatePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • getHeaderView

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