Class ContainmentLinkView

All Implemented Interfaces:
BaseElement, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, EventListener

@OpenApi public class ContainmentLinkView extends PathElement implements com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
Containment relationship symbol
  • Constructor Details

    • ContainmentLinkView

      public ContainmentLinkView(@CheckForNull PresentationElement parent)
    • ContainmentLinkView

      public ContainmentLinkView()
  • Method Details

    • asPathElement

      public PathElement asPathElement()
      Specified by:
      asPathElement in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • createTreeShape

      public com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape createTreeShape()
      Specified by:
      createTreeShape in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • paintChildren

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

      public Point getActualClientDrawPoint()
      Description copied from class: PathElement
      Returns actual client side draw point.
      Overrides:
      getActualClientDrawPoint in class PathElement
      Returns:
      actual client draw point.
    • getActualSupplierDrawPoint

      public Point getActualSupplierDrawPoint()
      Description copied from class: PathElement
      Returns actual supplier side draw point.
      Overrides:
      getActualSupplierDrawPoint in class PathElement
      Returns:
      actual supplier draw point.
    • drawAnchor

      public Point drawAnchor(Graphics2D g, int ix1, int iy1, int ix2, int iy2, int size, boolean fill, Color fillColor)
      Specified by:
      drawAnchor in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • accept

      public void accept(Visitor visitor) throws Exception
      accept method for Visitor
      Specified by:
      accept in interface MDElement
      Overrides:
      accept in class PathElement
      Parameters:
      visitor - - the Visitor
      Throws:
      Exception
    • setSupplier

      public void setSupplier(PresentationElement shape)
      Description copied from class: PathElement
      Sets supplier end for link. Removes this link from old shape. Inserts this link to new shape. Method also sets supplier point to the middle point of shape.
      Overrides:
      setSupplier in class PathElement
      Parameters:
      shape - new supplier.
    • setClient

      public void setClient(PresentationElement obj)
      Description copied from class: PathElement
      Sets client for this link. Changes parent object to the parent of client. Client's parent will always contain incoming links.
      Overrides:
      setClient in class PathElement
      Parameters:
      obj - shape to check
    • setChildElement

      public void setChildElement(@CheckForNull NamedElement newChild)
      Change child element of this containment link. Registers listener to a new child (removes listener from the old one)
      Parameters:
      newChild - child
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Description copied from class: PresentationElement
      Listens for property change it can be: data was edited text box was edited
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class PresentationElement
    • preDisposeOnUpdate

      protected boolean preDisposeOnUpdate()
      Description copied from class: PresentationElement
      Validate symbol against model and try to fix it before actual symbol update. If symbol is not valid and can not be fixed, request symbol dispose by returning true. Check if symbol should be disposed, because model does not correspond to symbol. This may happen for example if path supplier or client in model is changed, but path still is connected to symbols of old ends.

      Method also can fix symbol if possible - for example reconnect path to other symbols in diagram and etc.

      Overrides:
      preDisposeOnUpdate in class PathElement
      Returns:
      true if symbol must be disposed
    • isRectilinear

      public boolean isRectilinear()
      Overrides:
      isRectilinear in class PathElement
      Returns:
      true if link path style is rectilinear.
    • setSimple

      public void setSimple(boolean simple)
      Specified by:
      setSimple in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • sSetSimple

      public void sSetSimple(boolean simple)
      Specified by:
      sSetSimple in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • isSimple

      public boolean isSimple()
      Specified by:
      isSimple in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • setTreeShape

      public void setTreeShape(com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape tree)
      Sets new tree view.
      Specified by:
      setTreeShape in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
      Parameters:
      tree - new tree of this link.
    • sSetTreeShape

      public void sSetTreeShape(com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape tree)
      Sets new tree view.
      Specified by:
      sSetTreeShape in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
      Parameters:
      tree - new tree of this link.
    • getTreeShape

      @CheckForNull public com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape getTreeShape()
      Specified by:
      getTreeShape in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • dispose

      public void dispose()
      Description copied from class: PathElement
      Disconnect this link from shapes.
      Specified by:
      dispose in interface BaseElement
      Overrides:
      dispose in class PathElement
    • retrieveDataFromTreeView

      public void retrieveDataFromTreeView(com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape tree)
      Specified by:
      retrieveDataFromTreeView in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector
    • internalGetPresentationElementStroke

      public BasicStroke internalGetPresentationElementStroke(boolean line, int width)
      Description copied from class: PathElement
      This method must be overridden, if you need to use DASHED_STROKE or another one.
      Overrides:
      internalGetPresentationElementStroke in class PathElement
      Parameters:
      line - true if for line, false if for adornments also
      width - width
      Returns:
      the stroke for line drawing ( by default SOLID_STROKE).
    • getInternalStroke

      public BasicStroke getInternalStroke(boolean line, int width)
      Specified by:
      getInternalStroke in interface com.nomagic.magicdraw.uml.symbols.paths.TreeShapeConnector