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.AbstractShapeWithLabelsInside
com.nomagic.magicdraw.uml.symbols.shapes.TypedElementWithLabels
com.nomagic.magicdraw.uml.symbols.shapes.PortView
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, com.nomagic.magicdraw.uml.symbols.PropertyBasedPresentationElement, com.nomagic.magicdraw.uml.symbols.shapes.LabelsDisplayModeSupporter, com.nomagic.magicdraw.uml.symbols.shapes.PortOwner, StereotypesDisplayModeOwner, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, PropertyChangeListener, Cloneable, Comparable, EventListener

@OpenApi public class PortView extends com.nomagic.magicdraw.uml.symbols.shapes.TypedElementWithLabels implements com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
  • Field Details

  • Constructor Details

    • PortView

      public PortView()
    • PortView

      public PortView(@CheckForNull PresentationElement parent)
  • Method Details

    • getElement

      public Port 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.
    • getPort

      public static Port getPort(PresentationElement symbol)
      Parameters:
      symbol - symbol
      Returns:
      return element of given symbol as Port
    • isPort

      public static boolean isPort(PresentationElement element)
      Check if given symbol represents Port
      Parameters:
      element - symbol
      Returns:
      true if symbol is PortView or PartView which represents Port
    • createLabels

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

      protected void internalSpecificUpdate()
      Description copied from class: com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      Specific to every shape and model element update operation. Must be overridden in subclasses if you need to do specific tasks. !!! Important - all resizing, paths moving and so on is done in updatePresentationElement and should not be done in specific update.
      Overrides:
      internalSpecificUpdate in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabelsInside
      See Also:
      • AbstractHeaderShapeView.internalUpdatePresentationElement()
    • constructNameText

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

      public com.nomagic.magicdraw.uml.symbols.shapes.RequiredInterfaceLabelWrapper getRequiredInterfaceLabelWrapper()
    • getProvidedInterfaceLabelWrapper

      public com.nomagic.magicdraw.uml.symbols.shapes.ProvidedInterfaceLabelWrapper getProvidedInterfaceLabelWrapper()
    • getRequiredInterfacesLabelBox

      @CheckForNull public com.nomagic.magicdraw.uml.symbols.shapes.TextBoxWithIconView getRequiredInterfacesLabelBox()
    • getProvidedInterfacesLabelBox

      @CheckForNull public final com.nomagic.magicdraw.uml.symbols.shapes.TextBoxWithIconView getProvidedInterfacesLabelBox()
    • ownerValid

      public static boolean ownerValid(PresentationElement symbol)
    • getPortClassifier

      @CheckForNull public static EncapsulatedClassifier getPortClassifier(PresentationElement parent)
    • getBorderOwnerExcludingPort

      public PresentationElement getBorderOwnerExcludingPort()
      Gets owner of the border on which this port lies. Does not take into consideration nested ports.
      Returns:
      symbol on which this port lies, excluding nested ports.
    • getPort

      @OpenApi @Deprecated public Port getPort()
      Deprecated.
      use #getElement
      Gets port represented by this port symbol.
    • 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.TypedElementWithLabels
      Parameters:
      visitor - which visits this element.
      Throws:
      Exception
    • 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
    • isSnapToGrid

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

      public int getOnEdgePosition()
      Description copied from class: ShapeElement
      Returns position on edge.
      Overrides:
      getOnEdgePosition in class ShapeElement
      Returns:
      position on edge.
      See Also:
    • setOnEdge

      public void setOnEdge(int onEdge)
      Description copied from class: ShapeElement
      Sets on edge property.
      Overrides:
      setOnEdge in class ShapeElement
      Parameters:
      onEdge - the edge constant
      See Also:
    • adjustPositionForProvidedInterfacesLabel

      public void adjustPositionForProvidedInterfacesLabel()
    • adjustPositionForRequiredInterfacesLabel

      public void adjustPositionForRequiredInterfacesLabel()
    • internalGetModelElementToConnectRelationship

      @CheckForNull public com.dassault_systemes.modeler.foundation.model.ModelElement internalGetModelElementToConnectRelationship(@CheckForNull com.dassault_systemes.modeler.foundation.model.ModelElement relationship, boolean asClient)
      Description copied from class: PresentationElement
      Returns element that should be used for given relationship connecting. All possible elements are returned by method PresentationElement.getModelElementsForRelationshipConnecting().
      Overrides:
      internalGetModelElementToConnectRelationship in class PresentationElement
      Returns:
      all possible elements
      See Also:
    • internalGetModelElementsForRelationshipConnecting

      public Collection<? extends com.dassault_systemes.modeler.foundation.model.ModelElement> internalGetModelElementsForRelationshipConnecting()
      Description copied from class: PresentationElement
      Returns all possible element that can be used for some relationship connecting.
      Overrides:
      internalGetModelElementsForRelationshipConnecting in class PresentationElement
      Returns:
      all possible elements
    • createSmartListenerConfig

      protected void createSmartListenerConfig(List<SmartListenerConfig> configurations)
      Overrides:
      createSmartListenerConfig in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    • 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
    • isShowRequiredInterfaces

      public boolean isShowRequiredInterfaces()
    • isShowProvidedInterfaces

      public boolean isShowProvidedInterfaces()
    • sSetShowProvidedInterfaces

      public void sSetShowProvidedInterfaces(boolean show)
    • setShowProvidedInterfaces

      public void setShowProvidedInterfaces(boolean show)
    • sSetShowRequiredInterfaces

      public void sSetShowRequiredInterfaces(boolean show)
    • setShowRequiredInterfaces

      public void setShowRequiredInterfaces(boolean show)
    • isDrawRectangle

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

      protected Stream<PresentationElement> getProxyPresentationElementsStream()
      Overrides:
      getProxyPresentationElementsStream in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
    • getEncapsulatedClassifier

      public EncapsulatedClassifier getEncapsulatedClassifier()
      Specified by:
      getEncapsulatedClassifier in interface com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
    • getIconPositionForProvidedHorizontal

      public com.nomagic.magicdraw.uml.symbols.shapes.Alignment getIconPositionForProvidedHorizontal()
    • getIconPositionForProvidedVertical

      public com.nomagic.magicdraw.uml.symbols.shapes.Alignment getIconPositionForProvidedVertical()
    • getDefaultHorizontalPositionForProvidedLabel

      protected com.nomagic.magicdraw.uml.symbols.shapes.Alignment getDefaultHorizontalPositionForProvidedLabel()
    • getDefaultVerticalPositionForProvidedLabel

      protected com.nomagic.magicdraw.uml.symbols.shapes.Alignment getDefaultVerticalPositionForProvidedLabel()
    • isShowInheritedSign

      public boolean isShowInheritedSign()
      Returns:
      true if inherited sign is shown
    • sSetShowInheritedSign

      public void sSetShowInheritedSign(boolean showInheritedSign)
      Show inherited sign
      Parameters:
      showInheritedSign - show
    • setShowInheritedSign

      public void setShowInheritedSign(boolean showInheritedSign)
      Show inherited members sign in compartment
      Parameters:
      showInheritedSign - show
    • 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.TypedElementWithLabels
      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.TypedElementWithLabels
    • getIconPositionForRequiredHorizontal

      public com.nomagic.magicdraw.uml.symbols.shapes.Alignment getIconPositionForRequiredHorizontal()
    • getIconPositionForRequiredVertical

      public com.nomagic.magicdraw.uml.symbols.shapes.Alignment getIconPositionForRequiredVertical()
    • getDefaultHorizontalPositionForRequiredLabel

      protected com.nomagic.magicdraw.uml.symbols.shapes.Alignment getDefaultHorizontalPositionForRequiredLabel()
      Default position required lollipop. Gives if it is on the right or left according port view or, if lollipop are at the top or bottom regarding the portView, then gives right or left according PROVIDED lollipop
      Returns:
      position
      See Also:
      • Alignment.RIGHT
      • Alignment.LEFT
    • getDefaultVerticalPositionForRequiredLabel

      protected com.nomagic.magicdraw.uml.symbols.shapes.Alignment getDefaultVerticalPositionForRequiredLabel()
      Default position required lollipop. Gives if it is on the top or bottom according port view or, if lollipop are at the left or right regarding the portView, then gives right or left according PROVIDED lollipop
      Returns:
      position
      See Also:
      • Alignment.TOP
      • Alignment.BOTTOM
    • paintSelf

      public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      Overrides:
      paintSelf in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabelsInside
    • drawLinesToInterfacesLabels

      public void drawLinesToInterfacesLabels(Graphics2D g)
      Draw lines to interface labels.
      Parameters:
      g - graphics
    • drawLineToLabel

      public void drawLineToLabel(Graphics g, com.nomagic.magicdraw.uml.symbols.shapes.TextBoxWithIconView label, com.nomagic.magicdraw.uml.symbols.shapes.Alignment labelPositionHorizontal, com.nomagic.magicdraw.uml.symbols.shapes.Alignment labelPositionVertical)
    • 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
    • getEncapsulatedClassifierProvider

      public TypedElement getEncapsulatedClassifierProvider()
      Specified by:
      getEncapsulatedClassifierProvider in interface com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
    • canLabelBeInside

      public boolean canLabelBeInside(com.nomagic.magicdraw.uml.symbols.shapes.LabelWrapper labelWrapper)
      Specified by:
      canLabelBeInside in interface com.nomagic.magicdraw.uml.symbols.shapes.LabelsDisplayModeSupporter