Class NoteView

  • All Implemented Interfaces:
    BaseElement, 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.PlainTextOrHTMLChangeable, 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 NoteView
    extends com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
    implements com.nomagic.magicdraw.uml.symbols.shapes.PlainTextOrHTMLChangeable
    This class creates a note. NoteView displays note icon in UML diagrams.
    • Field Detail

      • mSmartPropertyChangeListenerElement

        @CheckForNull
        private com.nomagic.magicdraw.uml.ElementReference<Element> mSmartPropertyChangeListenerElement
      • SHOW_DOCUMENTATION

        public static final java.lang.String SHOW_DOCUMENTATION
        See Also:
        Constant Field Values
      • COMMENT_DISPLAY_MODES

        public static final java.util.List<java.lang.String> COMMENT_DISPLAY_MODES
      • FOLDER_SIZE

        private static final int FOLDER_SIZE
        Height of the top left folder
        See Also:
        Constant Field Values
      • INSETS

        private static final com.nomagic.ui.UnmodifiableInsets INSETS
    • Constructor Detail

      • NoteView

        public NoteView()
    • Method Detail

      • clone

        public NoteView 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
      • internalGetHeaderInsets

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

        protected void selfSpecificHeaderShapeDraw​(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
        Overrides:
        selfSpecificHeaderShapeDraw in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • createPolygon

        private java.awt.Polygon createPolygon​(int grow)
      • createBoundsShape

        public ContainerShape createBoundsShape​(PathElement path,
                                                BoundsTransformation transformation)
        Description copied from class: ShapeElement
        Creates bounding shape for intersection calculation.
        Overrides:
        createBoundsShape in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
        Parameters:
        path - path
        transformation - transformation
        Returns:
        shape
      • accept

        public void accept​(Visitor visitor)
                    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.HeaderShapeView
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • internalApplyProperties

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

        public boolean addConnectedPathElement​(PathElement link)
        Description copied from class: PathConnector
        Adds new path element, and recalculates its position.
        Parameters:
        link - element to be added.
        Returns:
        true if element was added
      • removeConnectedPathElement

        public boolean removeConnectedPathElement​(PathElement link)
        Description copied from class: PathConnector
        Removes path element.
        Parameters:
        link - element to remove.
        Returns:
        true if element was removed
      • internalGetSelfManipulationPreferredSize

        protected UnmodifiableDimension internalGetSelfManipulationPreferredSize()
        Overrides:
        internalGetSelfManipulationPreferredSize in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • setHTMLText

        public void setHTMLText​(boolean isHtml)
        Specified by:
        setHTMLText in interface com.nomagic.magicdraw.uml.symbols.shapes.PlainTextOrHTMLChangeable
      • sSetHTMLText

        public void sSetHTMLText​(boolean isHtml)
      • isHTMLText

        public boolean isHTMLText()
        Specified by:
        isHTMLText in interface com.nomagic.magicdraw.uml.symbols.shapes.PlainTextOrHTMLChangeable
      • getUserText

        public java.lang.String getUserText()
        Returns the pure text. If html text is presented, this method returns not tml text, but user visible text.
        Returns:
        the user visible text.
      • getHumanName

        public java.lang.String getHumanName()
        Description copied from class: PresentationElement
        Returns human representation of the data type
        Specified by:
        getHumanName in interface BaseElement
        Returns:
        the name of the data
      • createSmartListenerConfig

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

        @CheckForNull
        public PresentationElement getRelatedPresentationElement()
      • getRelatedElement

        @CheckForNull
        public Element getRelatedElement()
        Returns element to which note is connected with first (active) note anchor.
        Returns:
        related element
        See Also:
        getActiveNoteAnchorView()
      • getRelatedElement

        @CheckForNull
        public Element getRelatedElement​(@CheckForNull
                                         PresentationElement presentationElement)
        Returns element to which note is connected with first (active) note anchor.
        Parameters:
        presentationElement -
        Returns:
        related element
        See Also:
        getActiveNoteAnchorView()
      • isConnectedToDiagramFrame

        private static boolean isConnectedToDiagramFrame​(PresentationElement element)
      • getActiveNoteAnchorView

        @CheckForNull
        public NoteAnchorView getActiveNoteAnchorView()
        Returns "active" note anchor view. Note displays info of element connected with active anchor. Active anchor is first connected path.
        Returns:
        active anchor
      • setShowTaggedValues

        public void setShowTaggedValues​(boolean show)
        Overrides:
        setShowTaggedValues in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • sSetShowTaggedValues

        public void sSetShowTaggedValues​(boolean show)
        Overrides:
        sSetShowTaggedValues in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • setShowConstraints

        public void setShowConstraints​(boolean show)
        Overrides:
        setShowConstraints in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • sSetShowConstraints

        public void sSetShowConstraints​(boolean show)
        Overrides:
        sSetShowConstraints in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • isShowLineBetweenCompartments

        public boolean isShowLineBetweenCompartments()
      • sSetShowLineBetweenCompartments

        public void sSetShowLineBetweenCompartments​(boolean show)
      • updateChildrenVisibility

        public void updateChildrenVisibility()
        Overrides:
        updateChildrenVisibility in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • setShowLineBetweenCompartments

        public void setShowLineBetweenCompartments​(boolean show)
      • 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)
      • isShowDocumentationStereotypes

        public boolean isShowDocumentationStereotypes()
      • sSetShowDocumentationStereotypes

        public void sSetShowDocumentationStereotypes​(boolean show)
      • setShowDocumentationStereotypes

        public void setShowDocumentationStereotypes​(boolean show)
      • internalSpecificUpdate

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

        protected com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView.StereotypeDisplayData getStereotypesToDisplay()
        Overrides:
        getStereotypesToDisplay in class com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView
      • createCompartmentElements

        public void createCompartmentElements()
        Specified by:
        createCompartmentElements in interface com.nomagic.magicdraw.uml.CompartmentSupport
        Overrides:
        createCompartmentElements in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • getCollections

        public java.util.List<com.nomagic.magicdraw.uml.CompartmentCollection> getCollections()
        Specified by:
        getCollections in interface com.nomagic.magicdraw.uml.CompartmentSupport
        Overrides:
        getCollections in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • createSmartNoteListener

        private void createSmartNoteListener()
      • setSmartPropertyChangeListenerElement

        public void setSmartPropertyChangeListenerElement​(@CheckForNull
                                                          Element element)
        Sets smart property change listener element. This is a way to reset mSmartPropertyChangeListenerElement which lets to create new smart listener. The problem is when adding custom compartment for NoteView: there is no way to write smart listener configurator to update view because standard listener is added for related element and view is not updated.
        Parameters:
        element - element to set.
      • sSetCommentDisplayMode

        public void sSetCommentDisplayMode​(java.lang.String mode)
      • setCommentDisplayMode

        public void setCommentDisplayMode​(java.lang.String mode)
      • getCommentDisplayMode

        public java.lang.String getCommentDisplayMode()
      • setRepresentDiagramContext

        public void setRepresentDiagramContext​(boolean enable)
      • sSetRepresentDiagramContext

        public void sSetRepresentDiagramContext​(boolean enable)
      • isRepresentDiagramContext

        public boolean isRepresentDiagramContext()
      • isVerticalCenterlineProvider

        public boolean isVerticalCenterlineProvider()
        Description copied from class: ShapeElement
        Indicates whether this shape provides vertical centerlines to other shapes.
        Returns:
        true if this shape provides vertical centerlines, false otherwise.
      • isHorizontalCenterlineProvider

        public boolean isHorizontalCenterlineProvider()
        Description copied from class: ShapeElement
        Indicates whether this shape provides horizontal centerlines to other shapes.
        Returns:
        true if this shape provides horizontal centerlines, false otherwise.
      • sSetConstraintTextMode

        public void sSetConstraintTextMode​(java.lang.String mode)
        Overrides:
        sSetConstraintTextMode in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • getHeaderView

        public com.nomagic.magicdraw.uml.symbols.shapes.NoteHeaderView getHeaderView()
        Overrides:
        getHeaderView in class com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView
      • getNoteHeaderView

        @Deprecated
        public com.nomagic.magicdraw.uml.symbols.shapes.NoteHeaderView getNoteHeaderView()
        Deprecated.