Class ActivationView

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

    @OpenApi
    public class ActivationView
    extends com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    Creates activation object in sequence diagram.
    • Field Detail

      • DISTANCE_FROM_NESTED

        public static final int DISTANCE_FROM_NESTED
        Distance by which parent activations extend inner activations.
        See Also:
        Constant Field Values
      • resizedByUser

        private boolean resizedByUser
    • Constructor Detail

      • ActivationView

        public ActivationView()
    • Method Detail

      • moveLinksToSelf

        public void moveLinksToSelf()
        Description copied from class: ShapeElement
        Move links to self.
      • sSetElement

        public void sSetElement​(@CheckForNull
                                Element element)
      • paintSelf

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

        public boolean isUseGradientForFill()
        Description copied from class: PresentationElement
        Do we need to use gradient for fill color? Checks diagram property.
        Returns:
        diagram gradient fill color value.
      • getMiddlePointY

        public int getMiddlePointY​(java.awt.Point relativePoint)
      • adjustBoundsForMoving

        public java.awt.Rectangle adjustBoundsForMoving​(java.awt.Rectangle rect,
                                                        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
      • 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.
      • moveMessage

        private void moveMessage​(com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView message)
      • setBounds

        public void setBounds​(java.awt.Rectangle bounds)
        Description copied from class: PresentationElement
        sets bounds of this object view
        Overrides:
        setBounds in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
        Parameters:
        bounds - rectangle of bounds
      • internalLayoutChildren

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

        @CheckForNull
        protected java.awt.Rectangle internalGetManipulatedChildrenRect​(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
        Overrides:
        internalGetManipulatedChildrenRect in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      • 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
      • findUpperMessage

        @CheckForNull
        public com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView findUpperMessage()
        Returns:
        finds the top message. If there is incoming and outgoing message and the same y coordinate, then the incoming one will be selected as the upper, in order for findParentMessage() method to work correctly in such case
      • findLowerMessage

        @CheckForNull
        public com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView findLowerMessage()
        Returns:
        finds the lower message
      • findParentMessage

        @CheckForNull
        public com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView findParentMessage()
        Returns:
        first incoming non asynchronous message from top
      • isMovable

        public boolean isMovable​(java.util.Collection msg)
        Parameters:
        msg - message
        Returns:
        true if activation must be moved together with given messages
      • autoResize

        public void autoResize()
      • getActualElement

        @CheckForNull
        public Element getActualElement()
        Description copied from class: PresentationElement
        Because some views returns theirs parent model element, we do not know have they this member set or not.
      • sDispose

        public void sDispose()
        dispose without adding container for re-layout. Used to dispose symbols during container re-layout
      • disposeConnectedPaths

        protected void disposeConnectedPaths()
      • getVisibility

        public com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility getVisibility()
        Returns:
        element visibility
      • 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.
      • representsExecutionSpecification

        public boolean representsExecutionSpecification()
      • setResizedByUser

        public void setResizedByUser​(boolean resizedByUser)
      • isResizedByUser

        public boolean isResizedByUser()
      • isSnapToGrid

        protected boolean isSnapToGrid()
      • canChangeParent

        public boolean canChangeParent​(java.util.Collection<? extends PresentationElement> movedTogether,
                                       @CheckForNull
                                       BaseElement newParent,
                                       boolean changeElementParent)
        Description copied from class: PresentationElement
        Returns true, if element can change parent.
        Parameters:
        movedTogether - collection of the elements, whose will change the parent together with this.
        newParent - new symbol parent
        changeElementParent - change element parent
        Returns:
        true if parent of symbol can be changed
      • isMovableByMoveManager

        public boolean isMovableByMoveManager()
        Description copied from class: PresentationElement
        Method indicates if object of this instance must be registered in move manager.
      • getSeqContainer

        public com.nomagic.magicdraw.uml.symbols.SequenceObjectViewContainer getSeqContainer()
      • rememberBounds

        public void rememberBounds()
        Description copied from class: PresentationElement
        Remember old bounds
      • rememberBounds

        public void rememberBounds​(java.awt.Rectangle bounds)
      • checkElementParentOnAdd

        public boolean checkElementParentOnAdd​(PresentationElement child)
      • getNestingLevel

        public int getNestingLevel()
        Returns nesting level of this activation (counted from 0).
        Returns:
        nesting level.
      • getMaxYOfNestedActivation

        private int getMaxYOfNestedActivation()
        Gets maximum y position of the nested activations lying on this activation.
        Returns:
        maximum y coordinate.
      • getNestedActivations

        public java.util.List<ActivationView> getNestedActivations()
        Retrieves a list of nested activations placed on this activation.
        Returns:
        a list of nested activations.
      • isNested

        public boolean isNested()
        Indicates if this activation is nested.
        Returns:
        true if activation is nested, false otherwise.
      • hasSameNestingLevel

        public boolean hasSameNestingLevel​(ActivationView activation)
        Indicates if this activation has same nesting level as a given one.
        Parameters:
        activation - - activation to which nesting level is compared.
        Returns:
        true if nesting levels of activations are the same.
      • hasNestedActivations

        public boolean hasNestedActivations()
        Indicates if this activation has nested activations.
        Returns:
        true if this activation has nested activations, false otherwise.
      • getParentActivation

        @CheckForNull
        public ActivationView getParentActivation()
        Returns parent activation if this activation is nested.
        Returns:
        parent activation if nested, null otherwise.
      • getLifelineView

        @CheckForNull
        public SequenceLifelineView getLifelineView()
        Returns SequenceLifelineView to which this activation belongs.
        Returns:
        SequenceLifelineView to which this activation belongs.
      • 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
      • adjustBounds

        public void adjustBounds​(java.awt.Rectangle bounds)
        Description copied from class: ShapeElement
        Validates bounds
        Parameters:
        bounds - bounds
      • getPreferredDimensionForAutosize

        public UnmodifiableDimension getPreferredDimensionForAutosize()
        Description copied from class: PresentationElement
        Returns preferable dimension of the element for autosize.This implementation simple returns preferred size.
        Returns:
        preferred dimension
      • canBeAutosized

        protected boolean canBeAutosized()