Class LifeLineLineView

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.LifeLineLineView
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 LifeLineLineView extends com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
Life line line in sequence diagram.
  • Field Details

  • Constructor Details

    • LifeLineLineView

      public LifeLineLineView()
      Creates a new life line view.
    • LifeLineLineView

      public LifeLineLineView(@CheckForNull PresentationElement parent)
      Creates and initializes a new life line view from specified parameter.
      Parameters:
      parent - this life line view parent object.
  • Method Details

    • getStateInvariants

      public List<StateInvariantView> getStateInvariants()
      Gets state invariants lying on this lifeline line.
      Returns:
      a list of state invariants.
    • hasStateInvariants

      public boolean hasStateInvariants()
      Indicates if this life line has any state invariants on it.
      Returns:
      true if this life line has any state invariants, false otherwise.
    • getLastStateInvariantPosition

      public int getLastStateInvariantPosition()
      Calculates y coordinate of this lifeline line to cover the last state invariant lying on it.
      Returns:
      last state invariant y position.
    • paintSelf

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

      public void paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      Overrides:
      paintChildren in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    • internalGetPresentationElementStroke

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

      public BasicStroke dynamicStroke(BasicStroke stroke)
      Overrides:
      dynamicStroke in class PresentationElement
    • calculateDestroyTimePoint

      public Point calculateDestroyTimePoint()
    • getMiddlePointX

      public int getMiddlePointX()
      Overrides:
      getMiddlePointX in class ShapeElement
    • canAddInstance

      public boolean canAddInstance(PresentationElement symbol)
      Checks can this life line view add specified object or not. LifeLineView can add Activation and SequenceBaseMessageView objects.
      Overrides:
      canAddInstance in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      symbol - specified PresentationElement object.
      Returns:
      true if this object can add specified object otherwise false
    • canAddChild

      public boolean canAddChild(PresentationElement symbol)
      Description copied from class: PresentationElement
      Check of given symbol can be added as child into this symbol.
      Overrides:
      canAddChild in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      symbol - symbol
      Returns:
      true if symbol can be added
    • selectPathsForMoving

      protected List<PathElement> selectPathsForMoving(List<PresentationElement> subPresentationElements)
      Description copied from class: PresentationElement
      Select paths to move with current symbol from deep structure. Some paths can be connected to current symbol, but owned in some deep child of this symbol.
      Overrides:
      selectPathsForMoving in class PathConnector
      Parameters:
      subPresentationElements - sub children of this symbol
      Returns:
      paths to move together with current symbol
    • setPosition

      public void setPosition()
      Sets life line view position depending on this object parent position. Moves all links and connection points.
    • moveChild

      public void moveChild(PresentationElement view, int dx, int dy)
      Overrides:
      moveChild in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    • simpleSetBounds

      public void simpleSetBounds(Rectangle rct, boolean moveChildren, boolean calculatePrefSize)
      Description copied from class: com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Sets bounds for this container shape view and all its components
      Overrides:
      simpleSetBounds in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      rct - container shape view bounding rectangle
      moveChildren - if moveChildren equals true then this method calls
      calculatePrefSize - calculate preferred size
    • getNotZoomedTolerance

      protected int getNotZoomedTolerance()
      Overrides:
      getNotZoomedTolerance in class PresentationElement
    • coversPoint

      public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      checks if object covers provided point
      Overrides:
      coversPoint in class ShapeElement
      Returns:
      true if object covers this point
    • needAdjustToPreferred

      protected boolean needAdjustToPreferred()
      Description copied from class: ShapeElement
      Check if shape can be resized to a preferred size. Usually it is true if shape is manipulated and isAutosize is true.
      Overrides:
      needAdjustToPreferred in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Returns:
      true if adjustments are necessary
    • getManipulationBounds

      public Rectangle getManipulationBounds(@CheckForNull Point relativePoint)
      Description copied from class: PresentationElement
      Gets manipulation bounds of the symbol. Manipulation bounds might differ from symbol bounds, they can be larger or smaller to help user manipulate the symbol.
      Overrides:
      getManipulationBounds in class PresentationElement
      Parameters:
      relativePoint - active user point to construct manipulation bounds.
      Returns:
      symbol manipulation bounds.
    • getBoundsToRepaint

      public Rectangle getBoundsToRepaint()
      Return bounds of the symbol that must be repainted. throws NoRectangleDefinedException
      Overrides:
      getBoundsToRepaint in class PresentationElement
      Returns:
      rectangle of bounds
    • movePathElement

      protected void movePathElement(PathElement lnk, PathConnector requestor)
      Description copied from class: PathConnector
      Calculates position of a path element.
      Overrides:
      movePathElement in class ShapeElement
      Parameters:
      lnk - element which position will be calculated.
      requestor - the requestor of this path moving. Implementations may check to avoid endless loops.
    • getPresentationElementAt

      public PresentationElement getPresentationElementAt(Point point, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Searches and returns object that covers given point.
      Overrides:
      getPresentationElementAt in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      point - given point
      kind - intersection kind to check for
      Returns:
      PresentationElement that covers specified point
    • getSortedActivations

      public List<ActivationView> getSortedActivations()
      Returns:
      sorted activations by y ascending.
    • getMiddlePointY

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

      public LifeLineLineView clone()
      Clones this object.
      Specified by:
      clone in interface BaseElement
      Overrides:
      clone in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Returns:
      copy of this object.
    • getActivationsIterator

      public Iterator<ActivationView> getActivationsIterator()
      Returns:
      all activations
    • getLastActivation

      @CheckForNull public ActivationView getLastActivation()
      Returns last activation.
      Returns:
      Activation object.
    • getLastStateInvariant

      @CheckForNull public StateInvariantView getLastStateInvariant()
      Returns last state invariant.
      Returns:
      state invariant symbol;
    • getActivationAt

      @CheckForNull public ActivationView getActivationAt(int y)
      Returns Activation at specified point.
      Parameters:
      y - point y
      Returns:
      activation what covers specified point
    • getClosestActivationAt

      @CheckForNull public ActivationView getClosestActivationAt(int ptY)
      Finds closest activation on this lifeline line at a given point.
      Parameters:
      ptY - Y of point closest to which an activation should be found
      Returns:
      closest activation at a given point
    • 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
    • atInsert

      public void atInsert()
      Description copied from class: PresentationElement
      Invalidates object at insert
      Specified by:
      atInsert in interface BaseElement
      Overrides:
      atInsert in class PresentationElement
    • editName

      public void editName(@CheckForNull KeyEvent evt, @CheckForNull Map<String,Boolean> textEditorOptions)
      Does nothing -- prevent from editing name box, which is an attribute of container.
      Overrides:
      editName in class PresentationElement
      Parameters:
      evt - first key event or null
      textEditorOptions - boolean options for text editor. Passed when creating text editor with TextEditorFactory
    • 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
    • mustShowContextMenu

      public boolean mustShowContextMenu()
      Overrides:
      mustShowContextMenu 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
    • disposeChildren

      protected void disposeChildren()
      Removes all children from itself. Such removing causes calling dispose for every child.
      Overrides:
      disposeChildren in class PresentationElement
    • adjustBounds

      public void adjustBounds(Rectangle r)
      Adjust bounds 1. if lifeline is not concurrent, y must be seq bottom 2. (Disabled) if lifeline is concurrent y must be below parent life line upper point disabled because adjust bounds for moving does it 3. if lifeline is concurrent. x must be same as parent x+parent.width
      Overrides:
      adjustBounds in class ShapeElement
      Parameters:
      r - bounds
    • setConcurrent

      public void setConcurrent(boolean concurrent)
    • isConcurrent

      public boolean isConcurrent()
    • correctInnerStateInvariantBounds

      public void correctInnerStateInvariantBounds()
      Adjust bounds of inner state invariants according bounds of this lifeline.
    • correctStateInvariantBounds

      public boolean correctStateInvariantBounds(Rectangle bounds)
      Adjusts bounds of a given state invariant so that it lies correctly on this lifeline line.
      Parameters:
      bounds - bounds of state invariant to adjust.
      Returns:
      true if bounds were adjusted, false otherwise.
    • preferredDimension

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

      public boolean useParentStyle()
      Use parent font always
      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
    • getUpperPointY

      public int getUpperPointY()
    • setHidden

      public void setHidden(boolean hidden)
    • isHidden

      public boolean isHidden()
    • calculateActivationsBounds

      @CheckForNull public Rectangle calculateActivationsBounds()
    • adjustBoundsBeforeChange

      public Rectangle adjustBoundsBeforeChange(Rectangle rec, boolean autosizeOperation, Collection<PresentationElement> movedTogether)
      validate bounds for moving
      Overrides:
      adjustBoundsBeforeChange in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    • calculateAutosizeDimension

      public void calculateAutosizeDimension(Dimension size, int locationX, int locationY, int prefSizeWidth, int prefSizeHeight)
      Description copied from class: ShapeElement
      Calculates size of shape to be at least as preferred and fit all children
      Overrides:
      calculateAutosizeDimension in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      size - size
      locationX - x location
      locationY - y location
      prefSizeWidth - preferred size width
      prefSizeHeight - preferred size height
    • getObject

      public SequenceLifelineView getObject()
      Returns:
      owner - SequenceLifelineView
    • getAllMessages

      public List<com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView> getAllMessages()
    • getIncomingMessageWithType

      @CheckForNull public com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView getIncomingMessageWithType(MessageSort type)
      Parameters:
      type - message type
      Returns:
      incoming message of give sort type
    • getElement

      public Lifeline getElement()
      returns parent data
      Specified by:
      getElement in interface ModelElementProvider
      Overrides:
      getElement in class PresentationElement
      Returns:
      model element of this presentation element.
    • getLifeline

      public Lifeline getLifeline()
    • isSnapToGrid

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

      public void sSetElement(Element el)
      Overrides:
      sSetElement in class PresentationElement
    • setElement

      public void setElement(Element el)
      Overrides:
      setElement in class PresentationElement
    • getActualElement

      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
    • 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
      See Also:
    • isUseEntireActivation

      public boolean isUseEntireActivation()
    • 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:
    • 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
    • removePresentationElement

      public void removePresentationElement(PresentationElement element, boolean resizeParent)
      Description copied from class: com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Removes object view from container.
      Overrides:
      removePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      element - object to remove
      resizeParent - resize parent
    • checkElementOwnerOnChange

      public boolean checkElementOwnerOnChange(PresentationElement child)
      Overrides:
      checkElementOwnerOnChange in class PresentationElement
    • 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
    • getNestedLines

      public List<LifeLineLineView> getNestedLines()
      Returns nested lifeline lines.
      Returns:
      a list of nested lifeline list or empty list
    • getNestedLinesIterator

      public Iterator<LifeLineLineView> getNestedLinesIterator()
      Returns:
      nested lifeline lines
    • getActivations

      public List<ActivationView> getActivations()
      Gets activations placed on this lifeline line.
      Returns:
      a list of activations placed on this line.
    • isDestroyed

      public boolean isDestroyed()
      Gets destroyed value.
      Returns:
      destroyed value
    • ensureDestructionOccurrence

      public boolean ensureDestructionOccurrence(boolean destruct)
      Ensures that a proper destruction occurrence is in the model on this lifeline.
      Parameters:
      destruct - indicates whether lifeline is destructed or not.
      Returns:
      true if destruction event was changed
    • isNested

      public boolean isNested()
      Indicates if this lifeline line is nested (not root).
      Returns:
      true if this lifeline line is nested, false otherwise.
    • internalLayoutChildren

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

      public void sRemovePresentationElement(PresentationElement element)
      Description copied from class: PresentationElement
      Removes given child
      Overrides:
      sRemovePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      element - child
    • addPresentationElement

      public void addPresentationElement(PresentationElement element, int index, boolean resize)
      Description copied from class: com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      If a specified object not inserted in this container then adds a new object view to the container.
      Overrides:
      addPresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
      Parameters:
      element - new PresentationElement object
      index - index to add at
      resize - resize parent
    • createBoundsShape

      public ContainerShape createBoundsShape(@CheckForNull PathElement path, BoundsTransformation transformation)
      Description copied from class: ShapeElement
      Creates bounding shape for intersection calculation.
      Overrides:
      createBoundsShape in class ShapeElement
      Parameters:
      path - path
      transformation - transformation
      Returns:
      shape