Class ActivationView

java.lang.Object
com.nomagic.magicdraw.uml.MDElementImpl
com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.paths.PathConnector
com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement
com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
com.nomagic.magicdraw.uml.symbols.shapes.ActivationView
All Implemented Interfaces:
BaseElement, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, EventListener

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

    • BOTTOM_LENGTH

      public static final int BOTTOM_LENGTH
      See Also:
    • DEFAULT_HEIGHT

      public static final int DEFAULT_HEIGHT
      See Also:
    • DEFAULT_WIDTH

      public static final int DEFAULT_WIDTH
      See Also:
    • DISTANCE_FROM_NESTED

      public static final int DISTANCE_FROM_NESTED
      Distance by which parent activations extend inner activations.
      See Also:
  • Constructor Details

    • ActivationView

      public ActivationView()
    • ActivationView

      public ActivationView(@CheckForNull PresentationElement parent)
  • Method Details

    • moveLinksToSelf

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

      public void sSetElement(@CheckForNull Element element)
      Overrides:
      sSetElement in class PresentationElement
    • paintSelf

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

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

      public int getMiddlePointY(Point relativePoint)
      Overrides:
      getMiddlePointY in class ShapeElement
    • adjustBoundsBeforeChange

      public Rectangle adjustBoundsBeforeChange(Rectangle rect, boolean autosizeOperation, Collection<PresentationElement> movedTogether)
      Description copied from class: PresentationElement
      Validate bounds before bounds change operation
      Overrides:
      adjustBoundsBeforeChange 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 a path element.
      Overrides:
      movePathElement in class ShapeElement
      Parameters:
      link - element which position will be calculated.
      requestor - the requestor of this path moving. Implementations may check to avoid endless loops.
    • setBounds

      public void setBounds(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 Rectangle internalGetManipulatedChildrenRect(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
      Description copied from class: com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Calculate union area of owned manipulated children added not on a shape border
      Overrides:
      internalGetManipulatedChildrenRect in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      insetsLevel - include insets if shape has manipulated children
      Returns:
      rectangle of children or null if there are no children
    • accept

      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.symbols.shapes.ContainerShapeView
      Parameters:
      visitor - which visits this element.
      Throws:
      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(Collection msg)
      Parameters:
      msg - message
      Returns:
      true if activation must be moved together with given messages
    • setParent

      public void setParent(PresentationElement parent)
      Description copied from class: PresentationElement
      Overrides:
      setParent in class PathConnector
      Parameters:
      parent - parent view
    • autoResize

      public void autoResize()
    • getElement

      public Element getElement()
      Description copied from class: PresentationElement
      Returns model element of this presentation element. Some presentation elements (for example TextBoxes) do not have model elements.
      Specified by:
      getElement in interface ModelElementProvider
      Overrides:
      getElement in class PresentationElement
      Returns:
      model element of this presentation element.
    • 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.
      Overrides:
      getActualElement 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 PathConnector
    • sDispose

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

      protected void disposeConnectedPaths()
      Overrides:
      disposeConnectedPaths in class PathConnector
    • getLine

      public LifeLineLineView getLine()
    • getVisibility

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

      public PresentationElement getParentSymbolStyleOwner()
      Description copied from class: PresentationElement
      Returns parent to which this symbol delegates style attributes related functionality.
      Overrides:
      getParentSymbolStyleOwner in class PresentationElement
      Returns:
      parent symbol to delegate or null if this symbol does not delegate.
    • getDynamicStyleOwner

      @CheckForNull public PresentationElement getDynamicStyleOwner()
      Overrides:
      getDynamicStyleOwner in class PresentationElement
    • representsExecutionSpecification

      public boolean representsExecutionSpecification()
    • setResizedByUser

      public void setResizedByUser(boolean resizedByUser)
    • isResizedByUser

      public boolean isResizedByUser()
    • isSnapToGrid

      protected boolean isSnapToGrid()
      Overrides:
      isSnapToGrid in class ShapeElement
    • canChangeParent

      public boolean canChangeParent(Collection<? extends PresentationElement> movedTogether, @CheckForNull BaseElement newParent, boolean changeElementParent)
      Description copied from class: PresentationElement
      Returns true, if element can change parent.
      Overrides:
      canChangeParent in class PresentationElement
      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.
      Overrides:
      isMovableByMoveManager in class PresentationElement
    • getSeqContainer

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

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

      public void rememberBounds(Rectangle bounds)
      Overrides:
      rememberBounds in class PresentationElement
    • checkElementOwnerOnChange

      public boolean checkElementOwnerOnChange(PresentationElement child)
      Overrides:
      checkElementOwnerOnChange in class PresentationElement
    • getNestingLevel

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

      public 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 symbol)
      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(Rectangle bounds)
      Description copied from class: ShapeElement
      Validates bounds
      Overrides:
      adjustBounds in class ShapeElement
      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.
      Overrides:
      getPreferredDimensionForAutosize in class ShapeElement
      Returns:
      preferred dimension
    • canBeAutosized

      protected boolean canBeAutosized()
      Overrides:
      canBeAutosized in class ShapeElement
    • supportsVisibleConnectedPathElementsIfSelfInvisible

      protected boolean supportsVisibleConnectedPathElementsIfSelfInvisible()
      Overrides:
      supportsVisibleConnectedPathElementsIfSelfInvisible in class PathConnector