Class ShapeElement

  • All Implemented Interfaces:
    BaseElement, MDElement, ModelElementProvider, com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider, NameOwner, java.beans.PropertyChangeListener, java.lang.Cloneable, java.lang.Comparable, java.util.EventListener
    Direct Known Subclasses:
    com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView, NNaryAssociationView

    @OpenApi
    public abstract class ShapeElement
    extends PathConnector
    implements com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
    Base class for all shapes. For example Class, Package is represented in diagram with some kind of rectangular shape.
    • Field Detail

      • SPACE

        public static final int SPACE
        Space between bounds and some inner object.
        See Also:
        Constant Field Values
      • SPACE_INSETS

        public static final com.nomagic.ui.UnmodifiableInsets SPACE_INSETS
        Insets with all location equal to SPACE
        See Also:
        SPACE
      • SPACE_INSETS_EMPTY_TOP_BOTTOM

        public static final com.nomagic.ui.UnmodifiableInsets SPACE_INSETS_EMPTY_TOP_BOTTOM
        Insets with top/bottom equals to zero and right/left equals to SPACE
        See Also:
        SPACE
      • NULL_INSETS

        public static final com.nomagic.ui.UnmodifiableInsets NULL_INSETS
        Insets with all location equal to 0
      • NEED_AUTOSIZE_FULL

        public static final byte NEED_AUTOSIZE_FULL
        Flag for doing full autosize - calculation of preferred size and children layout
        See Also:
        Constant Field Values
      • NEED_AUTOSIZE_LAYOUT

        public static final byte NEED_AUTOSIZE_LAYOUT
        Flag for doing only children layout during autosize
        See Also:
        Constant Field Values
      • NEED_AUTOSIZE_NONE

        public static final byte NEED_AUTOSIZE_NONE
        Flag for ignoring autosize
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_ALL

        public static final java.lang.String BORDER_ELEMENT_MARGIN_ALL
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_LEFT

        public static final java.lang.String BORDER_ELEMENT_MARGIN_LEFT
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_RIGHT

        public static final java.lang.String BORDER_ELEMENT_MARGIN_RIGHT
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_TOP

        public static final java.lang.String BORDER_ELEMENT_MARGIN_TOP
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_BOTTOM

        public static final java.lang.String BORDER_ELEMENT_MARGIN_BOTTOM
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_LEFT_RIGHT

        public static final java.lang.String BORDER_ELEMENT_MARGIN_LEFT_RIGHT
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_TOP_BOTTOM

        public static final java.lang.String BORDER_ELEMENT_MARGIN_TOP_BOTTOM
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_NONE

        public static final java.lang.String BORDER_ELEMENT_MARGIN_NONE
        See Also:
        Constant Field Values
      • BORDER_ELEMENT_MARGIN_MODES

        public static final java.util.List<java.lang.String> BORDER_ELEMENT_MARGIN_MODES
      • SUSPEND_SHAPE_AUTO_RESIZE_SAME_AS_DIAGRAM

        public static final java.lang.String SUSPEND_SHAPE_AUTO_RESIZE_SAME_AS_DIAGRAM
        See Also:
        Constant Field Values
      • SUSPEND_SHAPE_AUTO_RESIZE_TRUE

        public static final java.lang.String SUSPEND_SHAPE_AUTO_RESIZE_TRUE
        See Also:
        Constant Field Values
      • SUSPEND_SHAPE_AUTO_RESIZE_FALSE

        public static final java.lang.String SUSPEND_SHAPE_AUTO_RESIZE_FALSE
        See Also:
        Constant Field Values
      • SUSPEND_SHAPE_AUTO_RESIZE_MODES

        public static final java.util.List<java.lang.String> SUSPEND_SHAPE_AUTO_RESIZE_MODES
        Possible values of diagrams symbols freeze mode for symbol size
      • CALCULATE_PREFERRED_REGARDING_CHILDREN

        private static boolean CALCULATE_PREFERRED_REGARDING_CHILDREN
        Flag for calculating/not calculating preferred shape size regarding children. If this value is modified, it must be reverted to the original value. It is mainly used for auto layout.
      • SNAP_SHAPES_ON_BORDER_TO_GRID

        private static boolean SNAP_SHAPES_ON_BORDER_TO_GRID
        Experimental property added by Mindaugas Genutis request for Acorn customer. Acorn sees a value in having ports snap to grid. They have a large number of ports on left/right and it is very hard for them to align ports manually pixel by pixel. Snapping ports makes drawing consistent shapes easier.
      • needAutosize

        private byte needAutosize
        Need autosize flag is used to check if we need to do explicit autosize during bounds setting or not. Flag has few values: a) none - autosize is not needed, b ) full - we need to calculate pref size and also layout children c) layout - we need just children layout, calculation of pref size is not needed
      • preferredDimension

        private UnmodifiableDimension preferredDimension
        Preferred size of this text shape view object
      • rectangle

        private java.awt.Rectangle rectangle
        Specifies shapes position and size
      • oldRect

        @CheckForNull
        private java.awt.Rectangle oldRect
        Shapes bounds before changing bounds. used in moveLink Method.
      • loadedDimension

        @CheckForNull
        private UnmodifiableDimension loadedDimension
        Shape size at load time. Used for proxy as preferred size
      • onEdge

        private int onEdge
        Border type on which this shape resides
      • reshapeMode

        private com.nomagic.magicdraw.uml.symbols.ReshapeMode reshapeMode
      • reshapeModeUsedForPrefDimension

        private com.nomagic.magicdraw.uml.symbols.ReshapeMode reshapeModeUsedForPrefDimension
    • Constructor Detail

      • ShapeElement

        public ShapeElement()
    • Method Detail

      • isAutosized

        public boolean isAutosized()
        Returns autosize flag.
        Returns:
        value of autosize flag.
      • setAutosize

        public void setAutosize​(boolean val)
        Sets autosize flag.
        Parameters:
        val - new value of flag.
      • sSetAutosize

        public void sSetAutosize​(boolean val)
        Simple setter for autosize flag.
        Parameters:
        val - value
      • getSuspendShapeAutoResizeMode

        public java.lang.String getSuspendShapeAutoResizeMode()
        Specified by:
        getSuspendShapeAutoResizeMode in interface com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
      • sSetSuspendShapeAutoResizeMode

        public void sSetSuspendShapeAutoResizeMode​(java.lang.String mode)
      • setSuspendShapeAutoResizeMode

        public void setSuspendShapeAutoResizeMode​(java.lang.String mode)
      • getNotCopyBounds

        public java.awt.Rectangle getNotCopyBounds()
        Description copied from class: PresentationElement
        get not copy bounds of object throws NoRectangleDefinedException
        Returns:
        rectangle of bounds
      • getMiddlePoint

        public final java.awt.Point getMiddlePoint​(java.awt.Point rel)
        Description copied from class: PresentationElement
        Gets middle point of this view,
        Parameters:
        rel - relative point
        Returns:
        middle point
      • getMiddlePointX

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

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

        public final java.awt.Point getMiddlePoint()
        Description copied from class: PresentationElement
        Returns middle point of this element. Middle point for shapes usually will be center point of bounds, middle point for paths will be center of path curve.
        Overrides:
        getMiddlePoint in class PresentationElement
        Returns:
        point that is considered as middle for this element.
      • getMiddlePointX

        public int getMiddlePointX()
      • getMiddlePointY

        public int getMiddlePointY()
      • sSetBounds

        public void sSetBounds​(java.awt.Rectangle bounds)
        Description copied from class: PresentationElement
        Sets bounds of this object view only.
        Parameters:
        bounds - rectangle of bounds.
      • adjustBounds

        public void adjustBounds​(java.awt.Rectangle bounds)
        Validates bounds
        Parameters:
        bounds - bounds
      • setBounds

        public void setBounds​(java.awt.Rectangle bounds)
        Description copied from class: PresentationElement
        sets bounds of this object view
        Parameters:
        bounds - rectangle of bounds
      • coversPoint

        public boolean coversPoint​(int x,
                                   int y)
        Description copied from class: PresentationElement
        checks if object covers provided point
        Returns:
        true if object covers this point
      • intersects

        public boolean intersects​(int x,
                                  int y,
                                  int width,
                                  int height)
        Description copied from class: PresentationElement
        checks whether object intersects with given rectangle
        Returns:
        true if object and rectangle intersects
      • movePathElements

        public void movePathElements()
      • clearOldRect

        public final void clearOldRect()
      • getOldRect

        @CheckForNull
        private java.awt.Rectangle getOldRect()
      • setOldRect

        public final void setOldRect​(java.awt.Rectangle old)
      • 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.
      • sMoveLink

        private void sMoveLink​(PathElement link)
        Recalculates link end points. Does not removes breakPoints
        Parameters:
        link - the link.
      • getFixedLocationPoint

        private java.awt.Point getFixedLocationPoint​(java.awt.Point thisPoint,
                                                     java.awt.Point nextPoint,
                                                     boolean wasTranslation)
      • findPointForRectPath

        private java.awt.Point findPointForRectPath​(PathElement link,
                                                    PresentationElement supplier,
                                                    PresentationElement client,
                                                    java.awt.Point supplierPoint,
                                                    java.awt.Point clientPoint,
                                                    java.awt.Point connectionPoint,
                                                    java.awt.Rectangle bounds,
                                                    java.awt.Point nextPoint,
                                                    int nIndex)
      • getIntersection

        public java.awt.Point getIntersection​(int x,
                                              int y,
                                              @CheckForNull
                                              PathElement path)
      • getIntersection

        public java.awt.Point getIntersection​(int x1,
                                              int y1,
                                              int x2,
                                              int y2,
                                              @CheckForNull
                                              PathElement path)
        Gets intersection point between shape view bounding rectangle and line.
        Parameters:
        x1 - first point of the line
        y1 - first point of the line
        x2 - second point of the line
        y2 - second point of the line
        path - path
        Returns:
        intersection point
      • getIntersection

        public static java.awt.Point getIntersection​(int x1,
                                                     int y1,
                                                     int x2,
                                                     int y2,
                                                     java.awt.Rectangle bounds,
                                                     ContainerShape boundingShape)
        Gets intersection point between bounding shape (or rectangle) and line.
        Parameters:
        x1 - first point of the line
        y1 - first point of the line
        x2 - second point of the line
        y2 - second point of the line
        bounds - shape bounds
        boundingShape - bounding shape
        Returns:
        intersection point
      • accept

        @OpenApi
        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 PathConnector
        Parameters:
        visitor - which visits this element.
        Throws:
        java.lang.Exception
      • setPreferredDimension

        public final void setPreferredDimension​(int width,
                                                int height)
      • simpleSetBounds

        public final void simpleSetBounds​(java.awt.Rectangle rect)
        Description copied from class: PresentationElement
        Sets bounding rectangle.
        Parameters:
        rect - new bounding rectangle.
      • simpleSetBounds

        public final void simpleSetBounds​(int x,
                                          int y,
                                          int width,
                                          int height,
                                          boolean calculatePrefSize)
      • simpleSetBounds

        public void simpleSetBounds​(java.awt.Rectangle rect,
                                    boolean calculatePrefSize)
        Sets the bounding rectangle of this shape view to the specified value for bounds. Moves all links connected to this shape connection points.

        Parameters:
        rect - the new bounds for the shape view.
        calculatePrefSize - need to calculate preferred size
      • calculateEdge

        public void calculateEdge()
      • edgeChanged

        public void edgeChanged()
      • autosize

        public final void autosize()
      • autosize

        public void autosize​(boolean calculatePrefSize)
        Calculate preferred size and make this shape size at least as preferred(if size is smaller)
        Parameters:
        calculatePrefSize - calculate preferred size
      • autosizeAndResizeParent

        public void autosizeAndResizeParent()
        Description copied from class: PresentationElement
        Resize itself and initiate parent resize
      • moveLinksToSelf

        protected void moveLinksToSelf()
        Move links to self.
      • moveLinkToSelf

        private void moveLinkToSelf​(@CheckForNull
                                    java.awt.Rectangle r,
                                    PathElement link)
        Moves one link to self.
        Parameters:
        r - bounds
        link - path
      • addBreakPoints

        protected void addBreakPoints​(PathElement link)
        Adds break points to link to self.
        Parameters:
        link - path
      • recalculateLinkToSelf

        private void recalculateLinkToSelf​(@CheckForNull
                                           java.awt.Rectangle oldBounds,
                                           PathElement lnk)
        Move link to self.
        Parameters:
        oldBounds - old bounds
        lnk - path
      • calculateAutosizeDimension

        protected void calculateAutosizeDimension​(java.awt.Dimension size,
                                                  int locationX,
                                                  int locationY,
                                                  int prefSizeWidth,
                                                  int prefSizeHeight)
        Calculates size of shape to be at least as preferred and fit all children
        Parameters:
        size - size
        locationX - x location
        locationY - y location
        prefSizeWidth - preferred size width
        prefSizeHeight - preferred size height
      • maximumDimension

        protected void maximumDimension​(java.awt.Dimension size)
      • ensureDimension

        public final void ensureDimension​(boolean rememberBounds)
        If size is smaller than preferred size, makes shape larger.
        Parameters:
        rememberBounds - remember bounds flag
      • needAdjustToPreferred

        protected boolean needAdjustToPreferred()
        Check if shape can be resized to a preferred size. Usually it is true if shape is manipulated and isAutosize is true.
        Returns:
        true if need adjustments
      • needAdjustToMaximumDimension

        protected boolean needAdjustToMaximumDimension()
        Check if shape should be resized to a maximum size.
        Returns:
        true if need adjustments
      • 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
      • 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.
      • calculateMinimumDimension

        public final void calculateMinimumDimension()
        calculates minimum size
      • minimumDimension

        protected void minimumDimension​(java.awt.Dimension min)
        calculates minimum size
        Parameters:
        min - minimum size
      • setMinimumDimension

        public final void setMinimumDimension​(int width,
                                              int height)
        Sets min size
        Parameters:
        width - width
        height - height
      • getManipulatedElementAt

        public PresentationElement getManipulatedElementAt​(java.awt.Point pt)
        Description copied from class: PresentationElement
        Gets manipulated symbol at specified point pt.
        Parameters:
        pt - Point
        Returns:
        manipulate symbol
      • calculatePreferredDimension

        public final void calculatePreferredDimension()
      • calculatePreferredDimension

        public final void calculatePreferredDimension​(int locationX,
                                                      int locationY)
      • preferredDimension

        protected void preferredDimension​(java.awt.Dimension pref,
                                          int locationX,
                                          int locationY)
      • prefDimensionByManipulatedChildren

        protected void prefDimensionByManipulatedChildren​(java.awt.Dimension pref,
                                                          int locationX,
                                                          int locationY)
      • canHavePaths

        public boolean canHavePaths()
        Returns:
        true if symbol can have connected paths. Return false here.
      • createBoundsShape

        public ContainerShape createBoundsShape​(@CheckForNull
                                                PathElement path,
                                                BoundsTransformation transformation)
        Creates bounding shape for intersection calculation.
        Parameters:
        path - path
        transformation - transformation
        Returns:
        shape
      • internalGetBoundsShape

        @CheckForNull
        public java.awt.Shape internalGetBoundsShape​(ConverterToShape converterToShape)
      • internalApplyProperties

        public void internalApplyProperties​(PropertyManager man)
        Description copied from class: PresentationElement
        Applies properties from given property manager
        Parameters:
        man - new properties
      • canBeAutosized

        protected boolean canBeAutosized()
      • isSnapToGrid

        protected boolean isSnapToGrid()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.nomagic.magicdraw.uml.MDElementImpl
      • getFixedConnectionPoints

        public java.awt.Point[] getFixedConnectionPoints()
        -----1------ | | | | 4 2 | | | | ----3-------
        Returns:
        array of 4 points used to connect paths to fixed points.
      • getIntersectionPoint

        private static java.awt.Point getIntersectionPoint​(java.awt.Point p1,
                                                           java.awt.Point p2,
                                                           ContainerShape shape)
      • isUseFixedConnectionPoints

        public boolean isUseFixedConnectionPoints()
      • setUseFixedConnectionPoints

        public void setUseFixedConnectionPoints​(boolean useFixed)
      • internalSilentApply

        public void internalSilentApply()
        Description copied from class: PresentationElement
        Silently applies all properties after initialization
      • getChildrenInsets

        @CheckForNull
        public com.nomagic.ui.UnmodifiableInsets getChildrenInsets​(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
        Parameters:
        insetsLevel - describes the level of insets
        Returns:
        shape insets for children
      • setOnEdge

        public void setOnEdge​(int onEdge)
        Sets on edge property.
        Parameters:
        onEdge - the edge constant
        See Also:
        getOnEdge()
      • onChildEdgeChange

        protected void onChildEdgeChange​(ShapeElement child)
      • getOnEdgeCornerDistance

        public int getOnEdgeCornerDistance()
        Returns:
        inset from corner
      • adjustOnEdge

        public void adjustOnEdge()
        Adjust shape on the edge of its parent.
      • calculateAdjustOnEdgeLocation

        @CheckForNull
        public java.awt.Point calculateAdjustOnEdgeLocation​(java.awt.Rectangle bounds)
        Calculates on edge location for a shape.
        Parameters:
        bounds - bounds
        Returns:
        location on edge or null if shape is not on edge
      • getOnEdgeBounds

        private java.awt.Rectangle getOnEdgeBounds()
        Calculates bounds used to place element on parent edge. By default symbol is placed in way middle of symbol is on boundary.
        Returns:
        bounds used to place element on parent edge
      • isOnEdge

        public boolean isOnEdge()
        Returns true if symbol is on edge
        Returns:
        true if on edge
      • adjustOnEdgeChildren

        public void adjustOnEdgeChildren()
        Adjust on edge all children
      • adjustOnEdge

        public java.awt.Point adjustOnEdge​(java.awt.Rectangle bounds,
                                           int edge,
                                           int position,
                                           int cornerDistance)
        Calculates location of given rectangle according given parent edge and position on edge.
        Parameters:
        bounds - the given rectangle
        edge - the parent bounds
        position - the position on edge
        cornerDistance - distance from corner
        Returns:
        adjusted point
      • adjustBoundsForMoving

        public java.awt.Rectangle adjustBoundsForMoving​(java.awt.Rectangle rec,
                                                        java.util.Collection<PresentationElement> movedTogether)
        Description copied from class: PresentationElement
        validate bounds for moving
      • getNearestEdge

        public int getNearestEdge​(java.awt.Rectangle r)
        Return nearest edge to given rectangle.
        Parameters:
        r - the given rectangle.
        Returns:
        nearest edge
        See Also:
        TOP_EDGE, BOTTOM_EDGE, LEFT_EDGE, RIGHT_EDGE
      • getNearestEdge

        public int getNearestEdge​(int x,
                                  int y)
        Return nearest edge to given point.
        Parameters:
        x - the given point x
        y - the given point y
        Returns:
        nearest edge
        See Also:
        TOP_EDGE, BOTTOM_EDGE, LEFT_EDGE, RIGHT_EDGE
      • setLoadedDimension

        public void setLoadedDimension​(@CheckForNull
                                       UnmodifiableDimension loadedDimension)
      • updateLater

        public void updateLater()
        Description copied from class: PresentationElement
        If it is possible method adds view to update list. View will be updated when all other commands are executed. If this is not possible updates immediately.
      • getInsetsForOnEdgeShapes

        protected java.awt.Insets getInsetsForOnEdgeShapes()
      • calculateInsetsForOnEdgeShapes

        private void calculateInsetsForOnEdgeShapes​(java.awt.Insets insets)
      • calculateOnEdgeBounds

        protected com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds calculateOnEdgeBounds()
      • getHeaderInsetReduce

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

        private boolean satisfiesGeneralCenterlineCondition()
      • isVerticalCenterlineProvider

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

        public boolean isHorizontalCenterlineProvider()
        Indicates whether this shape provides horizontal centerlines to other shapes.
        Returns:
        true if this shape provides horizontal centerlines, false otherwise.
      • prepareForShadowDrawing

        protected boolean prepareForShadowDrawing​(java.awt.Graphics2D g)
        Description copied from class: PresentationElement
        Prepares graphics for symbol shadow drawing. If diagram allows shadows, sets darker diagram background color to given graphics.
        Parameters:
        g - the given graphics
      • shouldDrawShadow

        protected boolean shouldDrawShadow()
      • getEdgeLine

        @CheckForNull
        public Line getEdgeLine​(int edge)
        Returns a line representing a specified edge.
        Parameters:
        edge - - edge of the shape element.
        Returns:
        a line that represents an edge.
      • getCenterlineableInnerParts

        public java.util.List<com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape> getCenterlineableInnerParts​(int orientation)
        Specified by:
        getCenterlineableInnerParts in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • findFreePlaceForShapeOnBorder

        public java.awt.Point findFreePlaceForShapeOnBorder​(ShapeElement shape,
                                                            java.awt.Rectangle shapeB)
        Looks for available position slot for given shape on border
        Parameters:
        shape - shape added on some border
        shapeB - bounds of shape. This method can be used while drawing a new shape, so we cannot take bounds from shape
        Returns:
        new location for shape
      • findFreePlaceForShapeOnHorizontalBorder

        private java.awt.Point findFreePlaceForShapeOnHorizontalBorder​(java.awt.Rectangle shapeBounds,
                                                                       java.util.List<ShapeElement> onTheSameEdge)
      • findFreePlaceForShapeOnVerticalBorder

        private java.awt.Point findFreePlaceForShapeOnVerticalBorder​(java.awt.Rectangle shapeBounds,
                                                                     java.util.List<ShapeElement> onTheSameEdge)
      • getAvailableLocationVerticallyBetween

        private static int getAvailableLocationVerticallyBetween​(int[] line,
                                                                 java.awt.Rectangle bounds)
      • getAvailableLocationHorizontallyBetween

        private static int getAvailableLocationHorizontallyBetween​(int[] line,
                                                                   java.awt.Rectangle bounds)
      • providesVerticalCenterline

        public boolean providesVerticalCenterline()
        Specified by:
        providesVerticalCenterline in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • providesHorizontalCenterline

        public boolean providesHorizontalCenterline()
        Specified by:
        providesHorizontalCenterline in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • snapsToCenterlines

        public boolean snapsToCenterlines()
        Specified by:
        snapsToCenterlines in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • isCenterlineInner

        public boolean isCenterlineInner()
        Specified by:
        isCenterlineInner in interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
      • getNeedAutosizeFlag

        public byte getNeedAutosizeFlag()
      • setNeedAutosizeFlag

        public void setNeedAutosizeFlag​(byte needAutosize)
      • sSetVisibility

        public void sSetVisibility​(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
        Description copied from class: PresentationElement
        Sets element visibility flag.
        Parameters:
        visibility - flag value
      • layoutChildren

        public void layoutChildren()
        Layout children of this shape. This method declared final in order to control layout flag. Subclasses must override internalLayoutChildren
      • layoutChildren

        public void layoutChildren​(boolean calculatePrefSize)
        Layout children of this shape. This method declared final in order to control layout flag. Subclasses must override internalLayoutChildren
        Parameters:
        calculatePrefSize - calculate preferred size
      • isChildLayoutable

        public boolean isChildLayoutable​(PresentationElement child)
        Check if given child is "layoutable" - it means this shape controls bounds of child inside layoutChildren() method. Not "layoutable" children are just moved together with parent, but layoutChildren() does not control their location.
        Parameters:
        child - child
        Returns:
        true if given child is layed out inside autosize method of this shape. False here
      • setCalculatePreferredRegardingChildren

        public void setCalculatePreferredRegardingChildren​(boolean flag)
        Sets the CALCULATE_PREFERRED_REGARDING_CHILDREN value. By default this value is true. If it was changed, it must be reverted, so put the resetting to default in finally block. For resetting to default value use: resetCalculatePreferredRegardingChildren()
        Parameters:
        flag - the value to set
      • resetCalculatePreferredRegardingChildren

        public void resetCalculatePreferredRegardingChildren()
        Resets the CALCULATE_PREFERRED_REGARDING_CHILDREN value to the default.
      • getBorderElementMargin

        public java.lang.String getBorderElementMargin()
      • sSetBorderElementMargin

        public void sSetBorderElementMargin​(java.lang.String value)
      • setBorderElementMargin

        public void setBorderElementMargin​(java.lang.String value)
      • hasManipulator

        public boolean hasManipulator()
        Description copied from class: PresentationElement
        Returns true, if view has manipulator (is selectable)
      • getReshapeMode

        public com.nomagic.magicdraw.uml.symbols.ReshapeMode getReshapeMode()
        Returns:
        current symbol reshape mode
      • setReshapeMode

        public void setReshapeMode​(com.nomagic.magicdraw.uml.symbols.ReshapeMode mode)
        Set symbol reshape mode
        Parameters:
        mode - reshape mode
      • getManipulationPreferredDimension

        public UnmodifiableDimension getManipulationPreferredDimension()
        Returns:
        size for manipulator manipulations
      • minimumOrMinimumShrinkableDimension

        protected void minimumOrMinimumShrinkableDimension​(java.awt.Dimension size)
      • minimumDimensionForShrinking

        public void minimumDimensionForShrinking​(java.awt.Dimension size,
                                                 int locationX,
                                                 int locationY)
        Parameters:
        size - size
        locationX - location X
        locationY - location Y
      • getDimensionForShrinking

        public UnmodifiableDimension getDimensionForShrinking​(int width,
                                                              int height)
      • isShrinkable

        public boolean isShrinkable()
      • ensurePreferredDimensionIfShrinkable

        public void ensurePreferredDimensionIfShrinkable()
      • ensurePreferredDimensionIfShrinkable

        public void ensurePreferredDimensionIfShrinkable​(java.awt.Rectangle bounds)
      • calculateAndGetMinimumShrinkingDimension

        public UnmodifiableDimension calculateAndGetMinimumShrinkingDimension​(int locationX,
                                                                              int locationY)
      • getPreferredDimensionForAutosize

        public UnmodifiableDimension getPreferredDimensionForAutosize()
        Description copied from class: PresentationElement
        Returns preferable dimension of the element for autosize.This implementation simple returns preferred size.
        Returns:
        preferred dimension
      • isSnapShapesOnBorderToGrid

        public static boolean isSnapShapesOnBorderToGrid()
      • setSnapShapesOnBorderToGrid

        public static void setSnapShapesOnBorderToGrid​(boolean snapShapesOnBorderToGrid)