Class SwimlaneView

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

    @OpenApi
    public class SwimlaneView
    extends com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    implements com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderOwner, StereotypesDisplayModeOwner
    • Field Detail

      • SHOW_PARTITION_NAME

        public static final java.lang.String SHOW_PARTITION_NAME
        See Also:
        Constant Field Values
      • SHOW_REPRESENTED

        public static final java.lang.String SHOW_REPRESENTED
        See Also:
        Constant Field Values
      • SHOW_REPRESENTED_IF_EXISTS

        public static final java.lang.String SHOW_REPRESENTED_IF_EXISTS
        See Also:
        Constant Field Values
      • SHOW_NAME_MODES

        public static final java.util.List SHOW_NAME_MODES
      • mPartitionToHeaderMap

        private java.util.Map<ActivityPartition,​com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> mPartitionToHeaderMap
      • mVerticalSwimlanes

        private java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> mVerticalSwimlanes
      • mHorizontalSwimlanes

        private java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> mHorizontalSwimlanes
      • mHeaderToInnerSwimlanesMap

        private java.util.Map<ActivityPartition,​java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView>> mHeaderToInnerSwimlanesMap
      • mLockLayout

        private boolean mLockLayout
      • mDrawClosingBorder

        private boolean mDrawClosingBorder
        Indicates whether swimlane should be open or a closing border should be drawn.
    • Constructor Detail

      • SwimlaneView

        public SwimlaneView()
    • Method Detail

      • resetMaps

        public void resetMaps()
      • getSwimlaneStroke

        public static java.awt.BasicStroke getSwimlaneStroke​(int width)
      • internalLayoutChildren

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

        private void layoutHorizontalSwimlanes​(int deltaY,
                                               int width)
      • layoutVerticalSwimlanes

        private void layoutVerticalSwimlanes​(int deltaX,
                                             int height)
      • layoutHorizontalCells

        private void layoutHorizontalCells​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header,
                                           java.awt.Rectangle swimlaneBounds,
                                           int maxWidth)
      • layoutVerticalCells

        private void layoutVerticalCells​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header,
                                         java.awt.Rectangle swimlaneBounds,
                                         int maxHeight)
      • getSwimlanesRecursively

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getSwimlanesRecursively​(boolean vertical,
                                                                                                                   boolean onlyLeafNodes)
      • getSwimlanesRecursively

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getSwimlanesRecursively​(boolean onlyLeafNodes)
      • collectSwimlanesRecursively

        private static void collectSwimlanesRecursively​(java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> allSwimlanes,
                                                        java.lang.Iterable<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> swimlanes,
                                                        boolean onlyLeafNodes)
      • internalUpdatePresentationElement

        protected void internalUpdatePresentationElement()
        Description copied from class: PresentationElement
        Internal symbol update method for subclassing. It is called from update as part of full update action.
        Overrides:
        internalUpdatePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
        See Also:
        PresentationElement.update()
      • findParentForData

        public Element findParentForData​(PresentationElement parent,
                                         com.nomagic.uml2.ext.jmi.helpers.ElementAddContext addContext)
      • 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.ContainerShapeView
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • printSwimlaneStructure

        private void printSwimlaneStructure()
      • printHeaderStructure

        private void printHeaderStructure​(java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> swimlanes)
      • preferredDimension

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

        public void minimumDimensionForShrinking​(java.awt.Dimension size,
                                                 int locationX,
                                                 int locationY)
        Parameters:
        size - size
        locationX - location X
        locationY - location Y
      • calculateAndGetPreferredOrMinimumShrinkingSize

        private static UnmodifiableDimension calculateAndGetPreferredOrMinimumShrinkingSize​(ShapeElement shape,
                                                                                            int locationX,
                                                                                            int locationY)
      • adjustSizeByHeadersAndCells

        private void adjustSizeByHeadersAndCells​(java.awt.Dimension pref,
                                                 java.util.function.Function<ShapeElement,​UnmodifiableDimension> sizeSupplier)
      • internalAppendChildRect

        protected boolean internalAppendChildRect​(PresentationElement view)
        Overrides:
        internalAppendChildRect in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • removeSwimlaneHeader

        public void removeSwimlaneHeader​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
        Specified by:
        removeSwimlaneHeader in interface com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderOwner
      • removeSwimlaneHeaderFromStructures

        public void removeSwimlaneHeaderFromStructures​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
      • removeHeaderFromMaps

        public void removeHeaderFromMaps​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
      • removeCellsFromMaps

        private void removeCellsFromMaps​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
      • removeCellViewFromHeader

        private void removeCellViewFromHeader​(SwimlaneCellView cellView,
                                              boolean vertical)
      • removePresentationElement

        public void removePresentationElement​(PresentationElement element,
                                              boolean resizeParent)
        Overrides:
        removePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • getHorizontalSwimlanes

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getHorizontalSwimlanes()
      • getPartitionToHeaderMap

        public java.util.Map<ActivityPartition,​com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getPartitionToHeaderMap()
      • getVerticalSwimlanes

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getVerticalSwimlanes()
      • getSwimlanes

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getSwimlanes​(boolean vertical)
        Specified by:
        getSwimlanes in interface com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderOwner
      • isLastHeader

        public boolean isLastHeader​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header,
                                    boolean vertical)
      • getPreferredManipulationWidthForVerticalSwimlane

        public int getPreferredManipulationWidthForVerticalSwimlane​(ActivityPartition partition)
      • getPreferredManipulationHeightForHorizontalSwimlane

        public int getPreferredManipulationHeightForHorizontalSwimlane​(ActivityPartition partition)
      • getCellsForHeader

        public java.util.List<SwimlaneCellView> getCellsForHeader​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
      • initializeByChildren

        public void initializeByChildren​(boolean addCovered)
        Initializes all maps by children positions used after load
        Parameters:
        addCovered - add covered symbols
      • getAllCells

        public java.util.Collection<SwimlaneCellView> getAllCells()
        Gets all swimlane cells recursively.
        Returns:
        all swimlane cells recursively.
      • 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
      • canAddInstance

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

        protected boolean canBeAutosized()
      • insertSwimlaneAt

        public void insertSwimlaneAt​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header,
                                     int position)
      • insertSwimlane

        private static boolean insertSwimlane​(java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> swimlanes,
                                              com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header,
                                              int position)
      • clone

        public SwimlaneView 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.ContainerShapeView
        Returns:
        the cloned object
      • getHeaderPosition

        public int getHeaderPosition​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView header)
        Specified by:
        getHeaderPosition in interface com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderOwner
      • getPositionOfHeaderBounds

        public static int getPositionOfHeaderBounds​(com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView current,
                                                    java.awt.Rectangle bounds,
                                                    boolean vertical)
      • getProxyPresentationElementsStream

        protected java.util.stream.Stream<PresentationElement> getProxyPresentationElementsStream()
        Overrides:
        getProxyPresentationElementsStream in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • setLockLayout

        public void setLockLayout​(boolean lockLayout)
      • isLockLayout

        public boolean isLockLayout()
      • getHeaderToInnerSwimlanesMap

        public java.util.Map<ActivityPartition,​java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView>> getHeaderToInnerSwimlanesMap()
      • getChildrenInsets

        public com.nomagic.ui.UnmodifiableInsets getChildrenInsets​(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
        Overrides:
        getChildrenInsets in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
        Parameters:
        insetsLevel - describes the level of insets
        Returns:
        shape insets for children
      • getAllSwimlanes

        public java.util.List<com.nomagic.magicdraw.uml.symbols.shapes.SwimlaneHeaderView> getAllSwimlanes()
      • getRemovableChildren

        public java.util.List<PresentationElement> getRemovableChildren()
        Overrides:
        getRemovableChildren in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • internalApplyProperties

        public void internalApplyProperties​(PropertyManager man)
        Description copied from class: PresentationElement
        Applies properties from given property manager
        Parameters:
        man - new properties
      • internalSilentApply

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

        public boolean isShowElementProperties()
      • setShowElementProperties

        public void setShowElementProperties​(boolean showElementProperties)
      • sSetShowElementProperties

        public void sSetShowElementProperties​(boolean showElementProperties)
      • 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.
      • 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.
      • isShowTaggedValues

        public boolean isShowTaggedValues()
      • sSetShowTaggedValues

        public void sSetShowTaggedValues​(boolean show)
      • setShowTaggedValues

        public void setShowTaggedValues​(boolean show)
      • getShowPartitionNameMode

        public java.lang.String getShowPartitionNameMode()
      • isUseFullRepresentedElementSignature

        public boolean isUseFullRepresentedElementSignature()
      • setShowPartitionNameMode

        public void setShowPartitionNameMode​(java.lang.String mode)
      • sSetShowPartitionNameMode

        public void sSetShowPartitionNameMode​(java.lang.String mode)
      • setUseFullRepresentedElementSignature

        public void setUseFullRepresentedElementSignature​(boolean value)
      • sSetUseFullRepresentedElementSignature

        public void sSetUseFullRepresentedElementSignature​(boolean value)
      • getSecondaryImageAndStereotypeDisplayMode

        public java.lang.String getSecondaryImageAndStereotypeDisplayMode()
      • sSetSecondaryImageAndStereotypeDisplayMode

        public void sSetSecondaryImageAndStereotypeDisplayMode​(java.lang.String mode)
      • setSecondaryImageAndStereotypeDisplayMode

        public void setSecondaryImageAndStereotypeDisplayMode​(java.lang.String mode)
      • snapsToCenterlines

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

        public java.util.List<com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape> getCenterlineableInnerParts​(int orientation)
        Specified by:
        getCenterlineableInnerParts in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • isCenterlineInner

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

        public boolean isChildLayoutable​(PresentationElement child)
        Description copied from class: ShapeElement
        Check if given child is "layoutable" - it means this shape controls bounds of child inside layoutChildren() method. Not "layoutable" children are just moved together with parent, but layoutChildren() does not control their location.
        Parameters:
        child - child
        Returns:
        true if given child is layed out inside autosize method of this shape. False here
      • paintSelf

        public void paintSelf​(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      • drawClosingBorder

        private void drawClosingBorder​(java.awt.Graphics2D g)
        Draws a closing order for a swimlane.
        Parameters:
        g - graphics on which to draw.
      • internalGetPresentationElementStroke

        public java.awt.BasicStroke internalGetPresentationElementStroke​(int width)
        Description copied from class: PresentationElement
        Return a stroke used to paint symbol's main part
        Parameters:
        width - a custom stroke width. Other stroke parameters will be specific to symbol
        Returns:
        a stroke used to paint symbol's main part
      • isDrawClosingBorder

        public boolean isDrawClosingBorder()
        Indicates if closing border should be drawn for a swimlane.
        Returns:
        draw closing border flag value.
      • setDrawClosingBorder

        public void setDrawClosingBorder​(boolean drawClosingBorder)
        Sets draw closing border flag value.
        Parameters:
        drawClosingBorder - draw closing border flag value.
      • getHeaderVerticalPosition

        public com.nomagic.magicdraw.uml.symbols.shapes.TextObject.VerticalPosition getHeaderVerticalPosition()
        Returns:
        header vertical position on Y axis
      • setHeaderVerticalPosition

        public void setHeaderVerticalPosition​(com.nomagic.magicdraw.uml.symbols.shapes.TextObject.VerticalPosition headerVerticalPosition)
        Set header vertical position on Y axis
        Parameters:
        headerVerticalPosition - position
      • sSetHeaderVerticalPosition

        public void sSetHeaderVerticalPosition​(com.nomagic.magicdraw.uml.symbols.shapes.TextObject.VerticalPosition headerVerticalPosition)
        Set header vertical position on Y axis
        Parameters:
        headerVerticalPosition - position