Class BarView

  • 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, StereotypesDisplayModeOwner, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener

    @OpenApi
    public class BarView
    extends com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
    Creates synchronization bar view object in activity diagram.
    • Field Detail

      • INNER_RECT_GAP

        public static final int INNER_RECT_GAP
        Distance from outer to inner rectangular
        See Also:
        Constant Field Values
      • BAR_ORIENTATION

        public static final java.util.List<java.lang.String> BAR_ORIENTATION
      • mOrientation

        private java.lang.String mOrientation
      • DEFAULT_HORIZONTAL_SIZE

        private static final java.awt.Dimension DEFAULT_HORIZONTAL_SIZE
      • DEFAULT_VERTICAL_SIZE

        private static final java.awt.Dimension DEFAULT_VERTICAL_SIZE
      • DEFAULT_PATH_DISTANCE_FROM_CORNER

        private static final int DEFAULT_PATH_DISTANCE_FROM_CORNER
        Smart path layout uses this constant to find a usable connection point for paths.
        See Also:
        Constant Field Values
      • PREFERRED_BREAKPOINT_DISTANCE

        private static final int PREFERRED_BREAKPOINT_DISTANCE
        Smart path layout uses this constant to create a breakpoint for layouted path.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BarView

        public BarView()
    • Method Detail

      • minimumSizeIgnoringOrientation

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

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

        public void paintSelf​(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
      • isSeparateJoinForkNotation

        private boolean isSeparateJoinForkNotation()
      • 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.ShapeWithLabels
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • getMiddlePointX

        public int getMiddlePointX​(java.awt.Point rel)
      • getMiddlePointY

        public int getMiddlePointY​(java.awt.Point rel)
      • sSetOrientation

        public void sSetOrientation​(java.lang.String o)
        Sets orientation for the bar
        Parameters:
        o - orientation
      • 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
      • setOrientation

        public void setOrientation​(java.lang.String o)
      • getOrientation

        public java.lang.String getOrientation()
        Returns:
        orientation of the bar
      • findParentForData

        public Element findParentForData​(PresentationElement parent,
                                         com.nomagic.uml2.ext.jmi.helpers.ElementAddContext addContext)
      • internalApplyProperties

        public void internalApplyProperties​(PropertyManager man)
        Applies properties
        Overrides:
        internalApplyProperties in class com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels
        Parameters:
        man - new properties
      • movePathElement

        protected void movePathElement​(PathElement link,
                                       @CheckForNull
                                       PathConnector requestor)
        Description copied from class: PathConnector
        Calculates position of path element.
        Parameters:
        link - element which position will be calculated.
        requestor - the requestor of this path moving. Implementations may check in order to avoid endless loops.
      • smartLayoutPathOnAllowedEdges

        private void smartLayoutPathOnAllowedEdges​(PathElement link)
        Smart layouts path on bar edges. Horizontal bar cannot have paths on vertical sides and vertical bar cannot have paths on horizontal sides.
        Parameters:
        link - - path which should be layouted.
      • findUsableConnectionPoint

        private java.awt.Point findUsableConnectionPoint​(int edge,
                                                         java.awt.Point corner)
        Finds a usable connection point for paths on a specified edge close to the specified corner.
        Parameters:
        edge - - edge on which a point should be found.
        corner - - a point close to which a point should be found
        Returns:
        a usable path connection point.
      • calculatePathDistanceFromCorner

        private int calculatePathDistanceFromCorner​(int nearestPathDistance)
        Calculates path connection distance from bar corner.
        Parameters:
        nearestPathDistance - - distance to the nearest path from corner.
        Returns:
        preferred path distance from corner.
      • getConnectedPathPointsOnEdge

        private java.util.List getConnectedPathPointsOnEdge​(int edge)
        Gets all path connection points on the specified edge.
        Parameters:
        edge - - edge on which connection points have to be round.
        Returns:
        a list of connection points.
      • isForkNode

        public boolean isForkNode()
        Indicates if this symbol represents fork node.
        Returns:
        true if this symbol represents fork node, false otherwise.
      • isJoinNode

        public boolean isJoinNode()
        Indicates if this symbol represents join node.
        Returns:
        true if this symbol represents join node, false otherwise.
      • isJoinPseudostate

        private boolean isJoinPseudostate()
      • hasSharedData

        public boolean hasSharedData()
        Description copied from class: PresentationElement
        Returns true if data of this object can be shared. If data is not shared data can be deleted with del key. Or it must be deleted with CRL+D
        Returns:
        true if data of this object can be shared.