Class MessageView

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.AbstractHeaderShapeView
com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabels
com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
com.nomagic.magicdraw.uml.symbols.shapes.MessageView
All Implemented Interfaces:
BaseElement, com.nomagic.magicdraw.uml.CompartmentSupport, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.LabelOwner, com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, NumberedMessageView, com.nomagic.magicdraw.uml.symbols.paths.PathCustomDraw, com.nomagic.magicdraw.uml.symbols.PropertyBasedPresentationElement, StereotypesDisplayModeOwner, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, EventListener

@OpenApi public class MessageView extends com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels implements NumberedMessageView, com.nomagic.magicdraw.uml.symbols.paths.PathCustomDraw
The MessageView class is used for displaying the message icon in Communication diagram of UML Drawing Tool.

This class has the reference to the data class - MessageData.

Version:
1.0
  • Field Details

  • Constructor Details

    • MessageView

      public MessageView()
    • MessageView

      public MessageView(@CheckForNull PresentationElement parent)
  • Method Details

    • createNameLabelWrapper

      protected com.nomagic.magicdraw.uml.symbols.shapes.NameLabelWrapper createNameLabelWrapper()
      Overrides:
      createNameLabelWrapper in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • createLabels

      protected void createLabels()
      Overrides:
      createLabels in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • getNameLabelWrapper

      public com.nomagic.magicdraw.uml.symbols.shapes.MessageNameLabelWrapper getNameLabelWrapper()
      Overrides:
      getNameLabelWrapper in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabels
    • getMessageSignatureLabelBox

      public com.nomagic.magicdraw.uml.symbols.shapes.MessageSignatureView getMessageSignatureLabelBox()
      Returns the signature view from the container of this message. Data flows are contained in it too.
      Returns:
      the MessageSignatureView
    • updateNameBox

      public void updateNameBox()
      Overrides:
      updateNameBox in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • constructNameText

      @CheckForNull public String constructNameText()
      Overrides:
      constructNameText in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • constructMessageText

      public static String constructMessageText(@CheckForNull Message message, boolean showAttributesAndParameters)
    • setMessageLabelNumberText

      public static void setMessageLabelNumberText(PresentationElement owner, com.nomagic.magicdraw.uml.symbols.shapes.MessageNameLabelWrapper nameLabelWrapper)
    • preferredSizeIgnoringOrientation

      protected void preferredSizeIgnoringOrientation(Dimension pref, int locationX, int locationY)
      Overrides:
      preferredSizeIgnoringOrientation in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
    • minimumSizeIgnoringOrientation

      protected void minimumSizeIgnoringOrientation(Dimension min)
      Overrides:
      minimumSizeIgnoringOrientation in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
    • simpleSetBounds

      public void simpleSetBounds(Rectangle rect, 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.AbstractShapeWithLabels
      Parameters:
      rect - container shape view bounding rectangle
      moveChildren - if moveChildren equals true then this method calls
      calculatePrefSize - calculate preferred size
    • getNearestLinkPart

      public Line getNearestLinkPart(int x, int y)
      Returns nearest link part to specified point.
    • 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
    • dynamicPathIcon

      @CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon()
    • dynamicPathIcon

      public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon(@CheckForNull com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon pathIcon)
    • getPathIcon

      @CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon getPathIcon()
      Description copied from interface: com.nomagic.magicdraw.uml.symbols.paths.PathCustomDraw
      get definition of custom path ending (arrow, circle, icon, etc.) and stroke (dashed, solid, etc.)
      Specified by:
      getPathIcon in interface com.nomagic.magicdraw.uml.symbols.paths.PathCustomDraw
      Returns:
      custom path end draw, null if not specified
      See Also:
      • PathIcon
    • paintSelf

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

      public MessageView clone()
      Specified by:
      clone in interface BaseElement
      Overrides:
      clone in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • 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.AbstractShapeWithLabels
    • canHavePaths

      public boolean canHavePaths()
      Overrides:
      canHavePaths in class ShapeElement
      Returns:
      true if symbol can have connected paths. Return false here.
    • coversPoint

      public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      checks if object covers provided point
      Overrides:
      coversPoint in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      Returns:
      true if object covers this 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.ShapeWithLabels
      Parameters:
      visitor - which visits this element.
      Throws:
      Exception
    • hasSharedModelElement

      public boolean hasSharedModelElement()
      Description copied from class: PresentationElement
      Returns true if ModelElement of this symbol can represented with other symbol. If ModelElement is not shared, it can be deleted together with symbol deleting.
      Overrides:
      hasSharedModelElement in class PresentationElement
      Returns:
      true if element of this symbol can be represented with other symbol.
    • resizeParent

      public void resizeParent()
      Description copied from class: PresentationElement
      Method that initiates parent resize to accommodate children if some child's bounds are changed.
      Overrides:
      resizeParent in class PresentationElement
    • prefDimensionByManipulatedChildren

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

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

      public void autosize(boolean calculatePrefSize)
      Description copied from class: ShapeElement
      Calculate preferred size and make this shape size at least as preferred (if size is smaller)
      Overrides:
      autosize in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      Parameters:
      calculatePrefSize - calculate preferred size
    • initialize

      public void initialize()
      Description copied from class: PresentationElement
      Initialize symbol and its children state. Symbol must be initialized before doing any resize, painting and etc. These operations can lead to unpredictable results otherwise.
      Overrides:
      initialize in class ShapeElement
    • recursiveAutosize

      public void recursiveAutosize()
      Description copied from class: PresentationElement
      Resize recursively all symbols. Method must be called if something is changed in symbol (for example minimum size) and you want to resize (autosize) all hierarchy
      Overrides:
      recursiveAutosize in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    • setDirection

      public void setDirection(int direction)
    • getDirection

      public int getDirection()
    • intersects

      public boolean intersects(int x, int y, int width, int height, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind)
      Description copied from class: PresentationElement
      checks whether object intersects with given rectangle
      Overrides:
      intersects in class ShapeElement
      Returns:
      true if object and rectangle intersects
    • getBoundsToRepaint

      public Rectangle getBoundsToRepaint() throws NoRectangleDefinedException
      Description copied from class: PresentationElement
      Return bounds of the symbol that must be repainted. throws NoRectangleDefinedException
      Overrides:
      getBoundsToRepaint in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabels
      Returns:
      rectangle of bounds
      Throws:
      NoRectangleDefinedException
    • internalApplyProperties

      public void internalApplyProperties(com.dassault_systemes.modeler.magic.diagram.styledelegates.PresentationElementStyleChanger changer)
      Description copied from class: PresentationElement
      Applies properties from given property manager
      Overrides:
      internalApplyProperties in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
      Parameters:
      changer - new properties
    • internalSilentApply

      public void internalSilentApply()
      Description copied from class: PresentationElement
      Silently applies all properties after initialization
      Overrides:
      internalSilentApply in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • sSetShowPredecessors

      public void sSetShowPredecessors(boolean show)
    • setShowPredecessors

      public void setShowPredecessors(boolean show)
      Sets show predecessors list.
      Parameters:
      show - show list
    • isShowPredecessors

      public boolean isShowPredecessors()
      Returns:
      show predecessors property value.
    • 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
    • resetMessagePositions

      public static void resetMessagePositions(PathElement path)
    • getElement

      public Message 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 com.nomagic.magicdraw.uml.symbols.LabelOwner
      Specified by:
      getElement in interface ModelElementProvider
      Overrides:
      getElement in class PresentationElement
      Returns:
      model element of this presentation element.
    • findOwnerForElement

      public com.dassault_systemes.modeler.foundation.model.ModelElement findOwnerForElement(PresentationElement newParent, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext)
      Overrides:
      findOwnerForElement in class PresentationElement
    • getMessage

      public Message getMessage()
      Description copied from interface: NumberedMessageView
      Message represented by the view.
      Specified by:
      getMessage in interface NumberedMessageView
      Returns:
      message represented by the view
    • getNumber

      public List<String> getNumber()
      Description copied from interface: NumberedMessageView
      Returns number of the message
      Specified by:
      getNumber in interface NumberedMessageView
      Returns:
      nested number of the message
    • getNumberManager

      public com.nomagic.magicdraw.uml.symbols.MessageNumberManager getNumberManager()
    • setNumberManager

      public void setNumberManager(com.nomagic.magicdraw.uml.symbols.MessageNumberManager numberManager)
    • getSender

      public PresentationElement getSender()
    • getReceiver

      public PresentationElement getReceiver()
    • setReceiver

      public void setReceiver(PresentationElement receiver)
    • setSender

      public void setSender(PresentationElement sender)
    • getConnector

      public ConnectorView getConnector()
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      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
    • checkShowsProxy

      protected boolean checkShowsProxy()
      Overrides:
      checkShowsProxy in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
    • 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
    • getStroke

      public BasicStroke getStroke(boolean line, int lineStyle)
      This method must be overridden, if you need to use DASHED_STROKE or another one.
      Returns:
      the stroke for line drawing ( by default SOLID_STROKE).
    • prepareForLineDrawing

      protected boolean prepareForLineDrawing(Graphics2D g, boolean line)
      Prepares graphics for line drawing. Calls super prepareForLineDrawing and sets stroke.
    • getStroke

      public BasicStroke getStroke(boolean line)
      This method must be overridden, if you need to use DASHED_STROKE or another one.
      Returns:
      the stroke for line drawing ( by default SOLID_STROKE).
    • createSmartListenerConfig

      protected void createSmartListenerConfig(List<SmartListenerConfig> configurations)
      Overrides:
      createSmartListenerConfig in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels