Class PartView

  • All Implemented Interfaces:
    BaseElement, CompartmentElement, com.nomagic.magicdraw.uml.CompartmentSupport, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.CompartmentContainer, com.nomagic.magicdraw.uml.symbols.CompartmentOwner, com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, com.nomagic.magicdraw.uml.symbols.shapes.PortOwner, com.nomagic.magicdraw.uml.symbols.shapes.QualifiedNameLabelOwner, StereotypesDisplayModeOwner, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, com.nomagic.magicdraw.uml.symbols.Wrapable, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener

    @OpenApi
    public class PartView
    extends com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
    implements CompartmentElement, com.nomagic.magicdraw.uml.symbols.shapes.PortOwner
    • Field Detail

      • nestedPath

        @CheckForNull
        private java.util.List<Property> nestedPath
    • Constructor Detail

      • PartView

        public PartView()
    • Method Detail

      • getStructureCompartment

        public com.nomagic.magicdraw.uml.symbols.shapes.StructureCompartmentView getStructureCompartment()
      • getClassifier

        public Classifier getClassifier()
        Specified by:
        getClassifier in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
      • sSetClassifiers

        public void sSetClassifiers​(java.util.List<Classifier> type)
        Specified by:
        sSetClassifiers in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
      • getMetaClassifiersQPropertyName

        public java.lang.String getMetaClassifiersQPropertyName()
        Specified by:
        getMetaClassifiersQPropertyName in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
      • internalGetHeaderInsets

        protected com.nomagic.ui.UnmodifiableInsets internalGetHeaderInsets()
        Overrides:
        internalGetHeaderInsets in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • getProperty

        @Deprecated
        public Property getProperty()
        Deprecated.
        use #getElement
      • accept

        public void accept​(Visitor o)
                    throws java.lang.Exception
        Description copied from interface: MDElement
        Method accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.
        Specified by:
        accept in interface MDElement
        Overrides:
        accept in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
        Parameters:
        o - which visits this element.
        Throws:
        java.lang.Exception
      • createSmartListenerConfig

        protected void createSmartListenerConfig​(java.util.List<SmartListenerConfig> configurations)
        Overrides:
        createSmartListenerConfig in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • isShowRakeIcon

        public boolean isShowRakeIcon()
        Overrides:
        isShowRakeIcon in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • internalGetPresentationElementStroke

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

        @CheckForNull
        public Element findParentForData​(PresentationElement newParent,
                                         com.nomagic.uml2.ext.jmi.helpers.ElementAddContext addContext)
      • getElementToMove

        public Element getElementToMove()
        Description copied from class: PresentationElement
        Returns element that should be used for during "move" operation. In most cases this is the same as getElement(), but some symbols maybe override and return some other related element.
        Returns:
        element to move
        See Also:
        PresentationElement.getElement()
      • internalSpecificUpdate

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

        private boolean isInheritedPart()
      • containsProperty

        private static boolean containsProperty​(Classifier classifier,
                                                Property property)
      • fixNestedPath

        private void fixNestedPath()
        Fix nested path if possible. After structure change in the model sometimes we can remove nested path and do not remove part itself. In such case nested path is set to null. Usually such situation happens if part with nested path is moved to other structure.
      • getProxyElementFromParentSymbol

        @CheckForNull
        private static Element getProxyElementFromParentSymbol​(PresentationElement parent)
      • isValid

        public boolean isValid​(PresentationElement parent,
                               boolean changeElementParent)
        Checks if part is valid by symbol ownership in it's current context.
        Parameters:
        parent - the owner of part
        changeElementParent - check if valid for a move operation
        Returns:
        true if part ownership is valid
      • getElementFromParentSymbol

        @CheckForNull
        public Element getElementFromParentSymbol()
      • isDrawSeparator

        protected boolean isDrawSeparator()
        Overrides:
        isDrawSeparator in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
      • getTaggedValuesDisplayMode

        public java.lang.String getTaggedValuesDisplayMode()
      • sSetTaggedValuesDisplayMode

        public void sSetTaggedValuesDisplayMode​(java.lang.String mode)
      • setTaggedValuesDisplayMode

        public void setTaggedValuesDisplayMode​(java.lang.String mode)
      • getShowSlotTypeMode

        public java.lang.String getShowSlotTypeMode()
        Gets value of slot showing property. Default is NONE
        Returns:
        mode
        See Also:
        SlotView.SHOW_TYPE_MODE_NONE, SlotView.SHOW_TYPE_MODE_NAME, SlotView.SHOW_TYPE_MODE_QUALIFIED_NAME
      • sSetShowSlotTypeMode

        public void sSetShowSlotTypeMode​(java.lang.String mode)
        Sets value of slot showing property. Just changes property, but no update is done
        Parameters:
        mode - mode
        See Also:
        SlotView.SHOW_TYPE_MODE_NONE, SlotView.SHOW_TYPE_MODE_NAME, SlotView.SHOW_TYPE_MODE_QUALIFIED_NAME
      • setShowSlotTypeMode

        public void setShowSlotTypeMode​(java.lang.String mode)
        Sets value of slot showing property. Calls view update
        Parameters:
        mode - mode
        See Also:
        SlotView.SHOW_TYPE_MODE_NONE, SlotView.SHOW_TYPE_MODE_NAME, SlotView.SHOW_TYPE_MODE_QUALIFIED_NAME
      • 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
      • isShowMultiplicity

        public boolean isShowMultiplicity()
      • setShowMultiplicity

        public void setShowMultiplicity​(boolean showMultiplicity)
      • sSetShowMultiplicity

        public void sSetShowMultiplicity​(boolean showMultiplicity)
      • isShowDefaultValueCompartmentName

        public boolean isShowDefaultValueCompartmentName()
        Indicates if default value compartment name should be displayed.
        Returns:
        true if default value compartment name should be displayed, false otherwise.
      • sSetShowDefaultValueCompartmentName

        public void sSetShowDefaultValueCompartmentName​(boolean show)
        Simple sets show default value compartment name flag value.
        Parameters:
        show - value to set.
      • setShowDefaultValueCompartmentName

        public void setShowDefaultValueCompartmentName​(boolean show)
        Sets show default value compartment name flag value.
        Parameters:
        show - value to set.
      • internalApplyProperties

        public void internalApplyProperties​(PropertyManager propertyManager)
        Description copied from class: PresentationElement
        Applies properties from given property manager
        Overrides:
        internalApplyProperties in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView
        Parameters:
        propertyManager - 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.TypedElementView
      • setSuppressStructureCompartment

        public void setSuppressStructureCompartment​(boolean b)
      • sSetSuppressStructureCompartment

        public void sSetSuppressStructureCompartment​(boolean b)
      • isSuppressStructureCompartment

        public boolean isSuppressStructureCompartment()
      • isShowTaggedValuesStereotypes

        public boolean isShowTaggedValuesStereotypes()
      • sSetShowTaggedValuesStereotypes

        public void sSetShowTaggedValuesStereotypes​(boolean show)
      • setShowTaggedValuesStereotypes

        public void setShowTaggedValuesStereotypes​(boolean show)
      • isShowQualifiedNameInTaggedValues

        public boolean isShowQualifiedNameInTaggedValues()
      • sSetShowQualifiedNameInTaggedValues

        public void sSetShowQualifiedNameInTaggedValues​(boolean show)
      • setShowQualifiedNameInTaggedValues

        public void setShowQualifiedNameInTaggedValues​(boolean show)
      • isShowDefaultValue

        public boolean isShowDefaultValue()
        Returns show default value flag. Default value can be shown in separate compartment if it is InstanceValue or after = sign in signature.
        Returns:
        flag value
      • sSetShowDefaultValue

        public void sSetShowDefaultValue​(boolean show)
        Set show default value flag. Default value can be shown in separate compartment if it is InstanceValue or after = sign in signature.
        Parameters:
        show - new value
      • setShowDefaultValue

        public void setShowDefaultValue​(boolean show)
        Set show default value flag. Default value can be shown in separate compartment if it is InstanceValue or after = sign in signature.
        Parameters:
        show - new value
      • isInOtherPart

        public boolean isInOtherPart()
      • getNestedPath

        @CheckForNull
        public java.util.List<Property> getNestedPath()
      • setNestedPath

        public void setNestedPath​(@CheckForNull
                                  java.util.List<Property> nestedPath)
      • sSetNestedPath

        public void sSetNestedPath​(@CheckForNull
                                   java.util.List<Property> nestedPart,
                                   boolean disposeOldListeners)
      • propertyChange

        public void propertyChange​(java.beans.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 java.beans.PropertyChangeListener
        Overrides:
        propertyChange in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • clone

        public PartView clone()
        Description copied from class: ElementImpl
        Returns a copy of the Element.
        Specified by:
        clone in interface BaseElement
        Overrides:
        clone in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Returns:
        the cloned object
      • canAddInstance

        public boolean canAddInstance​(PresentationElement obj)
        Description copied from class: PresentationElement
        Object view has no children.
        Overrides:
        canAddInstance in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • canAddChild

        public boolean canAddChild​(PresentationElement obj)
        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.HeaderShapeView
        Parameters:
        obj - symbol
        Returns:
        true if symbol can be added
      • addThisIntoStructureCompartment

        private boolean addThisIntoStructureCompartment​(PresentationElement obj)
      • addPresentationElement

        public void addPresentationElement​(PresentationElement element,
                                           int index,
                                           boolean resize)
        Overrides:
        addPresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • sAddPresentationElement

        public void sAddPresentationElement​(PresentationElement element,
                                            int index)
        Description copied from class: PresentationElement
        Add given child to this symbol at given index
        Overrides:
        sAddPresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
        Parameters:
        element - child to add
        index - index to add at. Can be -1
      • removePresentationElement

        public void removePresentationElement​(PresentationElement element,
                                              boolean resizeParent)
        Overrides:
        removePresentationElement in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • 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
      • getEncapsulatedClassifier

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

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

        public boolean setDummyResizeMode​(boolean b)
        Description copied from class: PresentationElement
        In dummy resize mode symbol may not resize according it children or move children on bounds changed and etc. This is more as hack for resize problems during load or diagram layout
        Overrides:
        setDummyResizeMode in class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
        Parameters:
        b - new value
      • preferredSizeIgnoringOrientation

        protected void preferredSizeIgnoringOrientation​(java.awt.Dimension pref,
                                                        int locationX,
                                                        int locationY)
        Overrides:
        preferredSizeIgnoringOrientation in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • internalLayoutChildren

        public void internalLayoutChildren​(boolean calculatePrefSize)
        Overrides:
        internalLayoutChildren in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • canChangeParent

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

        @CheckForNull
        public Element getExpectedDataParent​(PresentationElement child)
        Description copied from class: PresentationElement
        Returns expected element parent. Some views "SimpleActivityRegionView" has no element but it should accept drag and drop of other presentation element
        Returns:
        Most suitable element parent for given child element
      • createChangedCompartmentVisibilityProperty

        public Property createChangedCompartmentVisibilityProperty​(com.nomagic.magicdraw.uml.symbols.shapes.Compartment compartment,
                                                                   boolean showCompartment)
        Specified by:
        createChangedCompartmentVisibilityProperty in interface com.nomagic.magicdraw.uml.symbols.CompartmentOwner
        Overrides:
        createChangedCompartmentVisibilityProperty in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • findPresentationElement

        @CheckForNull
        public static PresentationElement findPresentationElement​(java.util.List<PresentationElement> elements,
                                                                  Element element,
                                                                  @CheckForNull
                                                                  java.util.List<Property> nestedPath)
        Finds existing symbol among the given ones with a given Element and given nestedPath
        Parameters:
        elements - symbols
        element - element
        nestedPath - nested path of the Part
        Returns:
        found presentation element or null
      • isPartPort

        public boolean isPartPort()
        Returns:
        true if PartView represents Port.
      • isPart

        public static boolean isPart​(@CheckForNull
                                     PresentationElement obj)
        Parameters:
        obj - symbol
        Returns:
        true if given symbol is pure Part, does not represent Port
      • isPartPort

        public static boolean isPartPort​(PresentationElement obj)
        Parameters:
        obj - symbol
        Returns:
        true if given symbol is Part, but it represents Port
      • getHeaderInsetReduce

        protected int getHeaderInsetReduce​(int edge,
                                           com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds bounds)
      • getHeaderView

        public com.nomagic.magicdraw.uml.symbols.shapes.PartHeaderView getHeaderView()
        Overrides:
        getHeaderView in class com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView