Class ShapeElement
- java.lang.Object
-
- com.nomagic.magicdraw.uml.MDElementImpl
-
- com.nomagic.magicdraw.uml.ElementImpl
-
- com.nomagic.magicdraw.uml.symbols.PresentationElement
-
- com.nomagic.magicdraw.uml.symbols.paths.PathConnector
-
- com.nomagic.magicdraw.uml.symbols.shapes.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds
-
Nested classes/interfaces inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.PresentationElement.SmartListenerConfigData, com.nomagic.magicdraw.uml.symbols.PresentationElement.StructureCache
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BORDER_ELEMENT_MARGIN_ALL
static java.lang.String
BORDER_ELEMENT_MARGIN_BOTTOM
static java.lang.String
BORDER_ELEMENT_MARGIN_LEFT
static java.lang.String
BORDER_ELEMENT_MARGIN_LEFT_RIGHT
static java.util.List<java.lang.String>
BORDER_ELEMENT_MARGIN_MODES
static java.lang.String
BORDER_ELEMENT_MARGIN_NONE
static java.lang.String
BORDER_ELEMENT_MARGIN_RIGHT
static java.lang.String
BORDER_ELEMENT_MARGIN_TOP
static java.lang.String
BORDER_ELEMENT_MARGIN_TOP_BOTTOM
static int
BOTTOM_EDGE
private static boolean
CALCULATE_PREFERRED_REGARDING_CHILDREN
Flag for calculating/not calculating preferred shape size regarding children.static int
INSIDE_EDGE_POSITION
static int
LEFT_EDGE
private UnmodifiableDimension
loadedDimension
Shape size at load time.private UnmodifiableDimension
minimumDimension
Minimum size of this objectstatic byte
NEED_AUTOSIZE_FULL
Flag for doing full autosize - calculation of preferred size and children layoutstatic byte
NEED_AUTOSIZE_LAYOUT
Flag for doing only children layout during autosizestatic byte
NEED_AUTOSIZE_NONE
Flag for ignoring autosizeprivate byte
needAutosize
Need autosize flag is used to check if we need to do explicit autosize during bounds setting or not.static int
NO_EDGE
static com.nomagic.ui.UnmodifiableInsets
NULL_INSETS
Insets with all location equal to 0private java.awt.Rectangle
oldRect
Shapes bounds before changing bounds.static int
ON_EDGE_POSITION
private int
onEdge
Border type on which this shape residesstatic int
OUTSIDE_EDGE_POSITION
private UnmodifiableDimension
preferredDimension
Preferred size of this text shape view objectprivate java.awt.Rectangle
rectangle
Specifies shapes position and sizeprivate com.nomagic.magicdraw.uml.symbols.ReshapeMode
reshapeMode
private com.nomagic.magicdraw.uml.symbols.ReshapeMode
reshapeModeUsedForPrefDimension
static int
RIGHT_EDGE
private static boolean
SNAP_SHAPES_ON_BORDER_TO_GRID
Experimental property added by Mindaugas Genutis request for Acorn customer.static int
SPACE
Space between bounds and some inner object.static com.nomagic.ui.UnmodifiableInsets
SPACE_INSETS
Insets with all location equal to SPACEstatic com.nomagic.ui.UnmodifiableInsets
SPACE_INSETS_EMPTY_TOP_BOTTOM
Insets with top/bottom equals to zero and right/left equals to SPACEstatic java.lang.String
SUSPEND_SHAPE_AUTO_RESIZE_FALSE
static java.util.List<java.lang.String>
SUSPEND_SHAPE_AUTO_RESIZE_MODES
Possible values of diagrams symbols freeze mode for symbol sizestatic java.lang.String
SUSPEND_SHAPE_AUTO_RESIZE_SAME_AS_DIAGRAM
static java.lang.String
SUSPEND_SHAPE_AUTO_RESIZE_TRUE
static int
TOP_EDGE
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
showsProxy
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DEFAULT_LINE_WIDTH, DOTTED_STROKE, HANDLE_SIZE, MAX_LINE_WIDTH, MIN_LINE_WIDTH, SHADOW_WIDTH, SOLID_STROKE
-
-
Constructor Summary
Constructors Constructor Description ShapeElement()
ShapeElement(PresentationElement parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
Method accepts visitor, and calls method visit<class name>(this) of visitor .protected void
addBreakPoints(PathElement link)
Adds break points to link to self.void
adjustBounds(java.awt.Rectangle bounds)
Validates boundsjava.awt.Rectangle
adjustBoundsForMoving(java.awt.Rectangle rec, java.util.Collection<PresentationElement> movedTogether)
validate bounds for movingvoid
adjustOnEdge()
Adjust shape on the edge of its parent.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.void
adjustOnEdgeChildren()
Adjust on edge all childrenvoid
autosize()
void
autosize(boolean calculatePrefSize)
Calculate preferred size and make this shape size at least as preferred(if size is smaller)void
autosizeAndResizeParent()
Resize itself and initiate parent resizejava.awt.Point
calculateAdjustOnEdgeLocation(java.awt.Rectangle bounds)
Calculates on edge location for a shape.UnmodifiableDimension
calculateAndGetMinimumShrinkingDimension(int locationX, int locationY)
UnmodifiableDimension
calculateAndGetPreferredDimension()
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 childrenvoid
calculateEdge()
private void
calculateInsetsForOnEdgeShapes(java.awt.Insets insets)
void
calculateMinimumDimension()
calculates minimum sizeprotected com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds
calculateOnEdgeBounds()
void
calculatePreferredDimension()
void
calculatePreferredDimension(int locationX, int locationY)
protected boolean
canBeAutosized()
boolean
canHavePaths()
void
clearOldRect()
ShapeElement
clone()
Returns a copy of theElement
.boolean
coversPoint(int x, int y)
checks if object covers provided pointContainerShape
createBoundsShape(PathElement path, BoundsTransformation transformation)
Creates bounding shape for intersection calculation.void
edgeChanged()
void
ensureDimension(boolean rememberBounds)
If size is smaller than preferred size, makes shape larger.void
ensurePreferredDimensionIfShrinkable()
void
ensurePreferredDimensionIfShrinkable(java.awt.Rectangle bounds)
java.awt.Point
findFreePlaceForShapeOnBorder(ShapeElement shape, java.awt.Rectangle shapeB)
Looks for available position slot for given shape on borderprivate java.awt.Point
findFreePlaceForShapeOnHorizontalBorder(java.awt.Rectangle shapeBounds, java.util.List<ShapeElement> onTheSameEdge)
private java.awt.Point
findFreePlaceForShapeOnVerticalBorder(java.awt.Rectangle shapeBounds, java.util.List<ShapeElement> onTheSameEdge)
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)
private static int
getAvailableLocationHorizontallyBetween(int[] line, java.awt.Rectangle bounds)
private static int
getAvailableLocationVerticallyBetween(int[] line, java.awt.Rectangle bounds)
java.lang.String
getBorderElementMargin()
java.awt.Rectangle
getBounds()
Method returns bounds of this element.java.util.List<com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape>
getCenterlineableInnerParts(int orientation)
com.nomagic.ui.UnmodifiableInsets
getChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
protected UnmodifiableDimension
getDefaultDimension()
UnmodifiableDimension
getDimensionForShrinking(int width, int height)
Line
getEdgeLine(int edge)
Returns a line representing a specified edge.java.awt.Point[]
getFixedConnectionPoints()
-----1------ | | | | 4 2 | | | | ----3-------private java.awt.Point
getFixedLocationPoint(java.awt.Point thisPoint, java.awt.Point nextPoint, boolean wasTranslation)
protected int
getHeaderInsetReduce(int edge, com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds bounds)
protected java.awt.Insets
getInsetsForOnEdgeShapes()
java.awt.Point
getIntersection(int x1, int y1, int x2, int y2, PathElement path)
Gets intersection point between shape view bounding rectangle and line.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.java.awt.Point
getIntersection(int x, int y, PathElement path)
private static java.awt.Point
getIntersectionPoint(java.awt.Point p1, java.awt.Point p2, ContainerShape shape)
UnmodifiableDimension
getLoadedDimension()
PresentationElement
getManipulatedElementAt(java.awt.Point pt)
Gets manipulated symbol at specified point pt.UnmodifiableDimension
getManipulationPreferredDimension()
java.awt.Point
getMiddlePoint()
Returns middle point of this element.java.awt.Point
getMiddlePoint(java.awt.Point rel)
Gets middle point of this view,int
getMiddlePointX()
int
getMiddlePointX(java.awt.Point rel)
int
getMiddlePointY()
int
getMiddlePointY(java.awt.Point rel)
UnmodifiableDimension
getMinimumDimension()
get minimum possible size for objectint
getNearestEdge(int x, int y)
Return nearest edge to given point.int
getNearestEdge(java.awt.Rectangle r)
Return nearest edge to given rectangle.byte
getNeedAutosizeFlag()
java.awt.Rectangle
getNotCopyBounds()
get not copy bounds of object throws NoRectangleDefinedExceptionprivate java.awt.Rectangle
getOldRect()
int
getOnEdge()
Returns some edge constant if this shape must be on its parent edge.private java.awt.Rectangle
getOnEdgeBounds()
Calculates bounds used to place element on parent edge.int
getOnEdgeCornerDistance()
int
getOnEdgePosition()
Returns position on edge.UnmodifiableDimension
getPreferredDimension()
Returns preferable dimension of the element.UnmodifiableDimension
getPreferredDimensionForAutosize()
Returns preferable dimension of the element for autosize.This implementation simple returns preferred size.com.nomagic.magicdraw.uml.symbols.ReshapeMode
getReshapeMode()
java.lang.String
getSuspendShapeAutoResizeMode()
boolean
hasManipulator()
Returns true, if view has manipulator (is selectable)void
initialize()
Initialize symbol and its children state.void
internalApplyProperties(PropertyManager man)
Applies properties from given property managerjava.awt.Shape
internalGetBoundsShape(ConverterToShape converterToShape)
void
internalSilentApply()
Silently applies all properties after initializationboolean
intersects(int x, int y, int width, int height)
checks whether object intersects with given rectangleboolean
isAutosized()
Returns autosize flag.boolean
isCenterlineInner()
boolean
isChildLayoutable(PresentationElement child)
Check if given child is "layoutable" - it means this shape controls bounds of child inside layoutChildren() method.boolean
isHorizontalCenterlineProvider()
Indicates whether this shape provides horizontal centerlines to other shapes.boolean
isOnEdge()
Returns true if symbol is on edgeboolean
isShrinkable()
static boolean
isSnapShapesOnBorderToGrid()
protected boolean
isSnapToGrid()
boolean
isUseFixedConnectionPoints()
boolean
isVerticalCenterlineProvider()
Indicates whether this shape provides vertical centerlines to other shapes.void
layoutChildren()
Layout children of this shape.void
layoutChildren(boolean calculatePrefSize)
Layout children of this shape.protected void
maximumDimension(java.awt.Dimension size)
protected void
minimumDimension(java.awt.Dimension min)
calculates minimum sizevoid
minimumDimensionForShrinking(java.awt.Dimension size, int locationX, int locationY)
protected void
minimumOrMinimumShrinkableDimension(java.awt.Dimension size)
protected void
moveLinksToSelf()
Move links to self.private void
moveLinkToSelf(java.awt.Rectangle r, PathElement link)
Moves one link to self.protected void
movePathElement(PathElement link, PathConnector requestor)
Calculates position of path element.void
movePathElements()
protected boolean
needAdjustToMaximumDimension()
Check if shape should be resized to a maximum size.protected boolean
needAdjustToPreferred()
Check if shape can be resized to a preferred size.protected void
onChildEdgeChange(ShapeElement child)
protected void
prefDimensionByManipulatedChildren(java.awt.Dimension pref, int locationX, int locationY)
protected void
preferredDimension(java.awt.Dimension pref, int locationX, int locationY)
protected boolean
prepareForShadowDrawing(java.awt.Graphics2D g)
Prepares graphics for symbol shadow drawing.boolean
providesHorizontalCenterline()
boolean
providesVerticalCenterline()
private void
recalculateLinkToSelf(java.awt.Rectangle oldBounds, PathElement lnk)
Move link to self.void
recursiveAutosize()
Resize recursively all symbols.void
resetCalculatePreferredRegardingChildren()
Resets the CALCULATE_PREFERRED_REGARDING_CHILDREN value to the default.private boolean
satisfiesGeneralCenterlineCondition()
void
setAutosize(boolean val)
Sets autosize flag.void
setBorderElementMargin(java.lang.String value)
void
setBounds(java.awt.Rectangle bounds)
sets bounds of this object viewvoid
setCalculatePreferredRegardingChildren(boolean flag)
Sets the CALCULATE_PREFERRED_REGARDING_CHILDREN value.void
setLoadedDimension(UnmodifiableDimension loadedDimension)
void
setMinimumDimension(int width, int height)
Sets min sizevoid
setNeedAutosizeFlag(byte needAutosize)
void
setOldRect(java.awt.Rectangle old)
void
setOnEdge(int onEdge)
Sets on edge property.void
setPreferredDimension(int width, int height)
void
setReshapeMode(com.nomagic.magicdraw.uml.symbols.ReshapeMode mode)
Set symbol reshape modestatic void
setSnapShapesOnBorderToGrid(boolean snapShapesOnBorderToGrid)
void
setSuspendShapeAutoResizeMode(java.lang.String mode)
void
setUseFixedConnectionPoints(boolean useFixed)
protected boolean
shouldDrawShadow()
void
simpleSetBounds(int x, int y, int width, int height, boolean calculatePrefSize)
void
simpleSetBounds(java.awt.Rectangle rect)
Sets bounding rectangle.void
simpleSetBounds(java.awt.Rectangle rect, boolean calculatePrefSize)
Sets the bounding rectangle of this shape view to the specified value forbounds
.private void
sMoveLink(PathElement link)
Recalculates link end points.boolean
snapsToCenterlines()
void
sSetAutosize(boolean val)
Simple setter for autosize flag.void
sSetBorderElementMargin(java.lang.String value)
void
sSetBounds(java.awt.Rectangle bounds)
Sets bounds of this object view only.void
sSetSuspendShapeAutoResizeMode(java.lang.String mode)
void
sSetVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
Sets element visibility flag.java.lang.String
toString()
void
updateLater()
If it is possible method adds view to update list.-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
addConnectedPathElement, checkShowsProxy, clearShowsProxy, createSmartListenerConfig, dispose, disposeConnectedPaths, findSymbolForEnd, findSymbolForEnd, getConnectedPathElement, getConnectedPathElementCount, getConnectedPathElements, getConnectedPathElements, getConnectedPathElements, getPreferredArrowLength, isShowsProxy, movePathElement, removeConnectedPathElement, sAddConnectedPathElement, selectPathsForMoving, setParent, setVisibility, sRemoveConnectedPathElement, sSetConnectedPathElements
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addPresentationElement, addPresentationElementWithoutResize, addProperty, adjustChildBounds, adjustChildBoundsForMoving, alwaysShowTooltip, applyProperties, askDeleteDataConfirmation, atInsert, atInsertChildren, autosizeAndResizeManipulatedParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddChild, canAddInstance, canAddInstance, canBeDisposedOnUpdate, canChangeElementParent, canChangeParent, canChangeParent, canFill, changeProperties, changeProperty, changePropertyManager, checkElementParentOnAdd, checkProxyVisibility, childrenForMoving, clearAntialiasingState, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, constructChangePropertyCommand, createPropertyChangeListener, createPropertyManager, disposeChildren, disposeListener, draw, drawBackground, drawSymbol, drawSymbolBackground, dynamicFillColor, dynamicLineColor, dynamicLineWidth, dynamicLineWidth, dynamicPaintShadow, dynamicStroke, dynamicStroke, dynamicStroke, dynamicStyleFillColor, dynamicStyleFillPaint, dynamicStyleLineColor, dynamicStyleTextColor, dynamicStyleTransparency, dynamicStyleTransparency, dynamicStyleValue, dynamicTextAlignment, dynamicTextColor, editName, editName, findParentForData, findPresentationElement, firePropertyChange, generateID, getActualElement, getActualProperty, getAdditionalRenderersToNotify, getAssignableModelElementsClasses, getBooleanPropertyValue, getBoundsShape, getBoundsToRepaint, getBoundsWithChildrenOnEdge, getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getChildPresentationElementForContextMenu, getChildrenWithSymbolProperties, getConfiguration, getDiagramPresentationElement, getDiagramSurface, getDrawComparator, getDynamicConfigurations, getDynamicStyleOwner, getElement, getElementNumberDisplayMode, getElementsForLinkConnecting, getElementToConnectLink, getElementToMove, getExpectedDataParent, getFillColor, getFont, getFontHeight, getFontRenderContext, getHumanName, getHumanType, getLineColor, getLineWidth, getManipulatedElementAt, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolPropertyOwner, getPreferredBounds, getPreferredSize, getPresentationElementAt, getPresentationElementAt, getPresentationElementAt, getPresentationElementCount, getPresentationElementIndex, getPresentationElements, getPresentationElementsAt, getPresentationElementsAt, getPresentationElementStroke, getPresentationElementStroke, getProjectImpl, getProperty, getPropertyManager, getPropertyManagerName, getRealPropertyManager, getRenderer, getSelected, getStereotypeColor, getStereotypeFont, getStringPropertyValue, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, getSymbolRenderer, getTextColor, getTolerance, getVisibility, getVisiblePresentationElements, handleModelDelete, hasDiagramSurface, hasManipulatedPresentationElements, hasSharedData, initializeAndAutosize, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetElementsForLinkConnecting, internalGetElementToConnectLink, internalGetPresentationElementStroke, internalSnapToGrid, internalSnapToGrid, internalUpdatePresentationElement, invalidate, isCanChildrenChangeEdge, isChildVisible, isContentHidden, isCreateElementListener, isDetectable, isDisposed, isLayouting, isMovableByMoveManager, isNotNull, isParentOf, isParentOf, isPreserveProportionsWhenGrowing, isSelected, isShowElementTypeAsLabel, isSortable, isTestUpdateFlag, isTextEditable, isUseFillColor, isUseFillColorByProperty, isUseGradientForFill, isVisible, isVisibleInDiagram, isVisibleOrShrunken, movePathElementsRecursively, mustShowContextMenu, notifyCreated, notifyDiagramFrameSizeChange, notifyRepaintManager, onFind, onFind, onFontChange, paintAdornments, paintAdornmentsBackground, paintChildren, paintChildrenAndAdornments, paintChildrenBackground, paintSelf, paintSelfBackground, preDisposeOnUpdate, prepareForFillDrawing, prepareForLineDrawing, prepareForTextDrawing, propertyChange, recreateListeners, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, removePresentationElement, resizeParent, sAddPresentationElement, sAddPresentationElement, selectChildrenForMoving, selectObjectsForMoving, setAllSelected, setBounds, setCreateElementListener, setDiagramSurface, setDummyResizeMode, setElement, setFillColor, setFont, setFontProperty, setLayouting, setLineColor, setLineWidth, setLoadedVisibility, setLocation, setLocation, setNeedRecreateListeners, setPresentationElements, setPropertyManager, setPropertyManagerName, setSelected, setSelected, setSize, setSize, setSize, setStereotypeColor, setStereotypeFont, setStrokeIfNotTheSame, setTestUpdateFlag, setTextColor, setTextColorProperty, setTextEditable, setUseFillColor, setVisible, silentApply, silentApply, simpleSetBounds, snapToGrid, snapToGrid, snapViewToGrid, sortObjectsByX, sortObjectsByY, sRemovePresentationElement, sSetBounds, sSetElement, sSetLineWidth, sSetLocation, sSetLocation, sSetParent, sSetParentForAll, sSetPresentationElements, sSetSize, sSetSize, sSetSize, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, updateModelByView, updateModelByViewInternal, updateViewAfterPropertyChange, useParentProperties
-
Methods inherited from class com.nomagic.magicdraw.uml.MDElementImpl
accept, addPropertyChangeListener, canAdd, canAdd, canAddChild, canBeDeleted, canDeleteChild, compareTo, createSortKeys, getClassType, getCommandForAppending, getID, getName, getProject, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setProjectProvider, sGetID
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
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.
-
NO_EDGE
public static final int NO_EDGE
- See Also:
- Constant Field Values
-
TOP_EDGE
public static final int TOP_EDGE
- See Also:
- Constant Field Values
-
RIGHT_EDGE
public static final int RIGHT_EDGE
- See Also:
- Constant Field Values
-
BOTTOM_EDGE
public static final int BOTTOM_EDGE
- See Also:
- Constant Field Values
-
LEFT_EDGE
public static final int LEFT_EDGE
- See Also:
- Constant Field Values
-
ON_EDGE_POSITION
public static final int ON_EDGE_POSITION
- See Also:
- Constant Field Values
-
OUTSIDE_EDGE_POSITION
public static final int OUTSIDE_EDGE_POSITION
- See Also:
- Constant Field Values
-
INSIDE_EDGE_POSITION
public static final int INSIDE_EDGE_POSITION
- See Also:
- Constant Field Values
-
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.
-
minimumDimension
private UnmodifiableDimension minimumDimension
Minimum size of this object
-
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()
-
ShapeElement
public ShapeElement(@CheckForNull PresentationElement parent)
-
-
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 interfacecom.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
-
sSetSuspendShapeAutoResizeMode
public void sSetSuspendShapeAutoResizeMode(java.lang.String mode)
-
setSuspendShapeAutoResizeMode
public void setSuspendShapeAutoResizeMode(java.lang.String mode)
-
getBounds
public java.awt.Rectangle getBounds()
Description copied from class:PresentationElement
Method returns bounds of this element. Use PresentationElementsManager to change a bounds of the element.- Overrides:
getBounds
in classPresentationElement
- Returns:
- bounds of the element.
- See Also:
PresentationElementsManager.reshapeShapeElement(com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement, java.awt.Rectangle)
-
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 classPresentationElement
- 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
-
clone
public ShapeElement clone()
Description copied from class:ElementImpl
Returns a copy of theElement
.- Specified by:
clone
in interfaceBaseElement
- Returns:
- the cloned object
-
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 liney1
- first point of the linex2
- second point of the liney2
- second point of the linepath
- 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 liney1
- first point of the linex2
- second point of the liney2
- second point of the linebounds
- shape boundsboundingShape
- 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 interfaceMDElement
- Overrides:
accept
in classPathConnector
- Parameters:
visitor
- which visits this element.- Throws:
java.lang.Exception
-
setPreferredDimension
public final void setPreferredDimension(int width, int height)
-
getPreferredDimension
public final UnmodifiableDimension getPreferredDimension()
Description copied from class:PresentationElement
Returns preferable dimension of the element.- Overrides:
getPreferredDimension
in classPresentationElement
- Returns:
- preferred dimension
-
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 forbounds
. 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
- boundslink
- 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 boundslnk
- 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
- sizelocationX
- x locationlocationY
- y locationprefSizeWidth
- preferred size widthprefSizeHeight
- 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
-
getDefaultDimension
@CheckForNull protected UnmodifiableDimension getDefaultDimension()
-
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
- widthheight
- height
-
getMinimumDimension
public final UnmodifiableDimension getMinimumDimension()
Description copied from class:PresentationElement
get minimum possible size for object- Returns:
- minimum dimension
-
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
- pathtransformation
- 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 classcom.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)
-
getOnEdge
public int getOnEdge()
Returns some edge constant if this shape must be on its parent edge.- Returns:
- edge constant
- See Also:
NO_EDGE
,LEFT_EDGE
,RIGHT_EDGE
,TOP_EDGE
,BOTTOM_EDGE
-
getOnEdgePosition
public int getOnEdgePosition()
Returns position on edge.- Returns:
- position on edge.
- See Also:
ON_EDGE_POSITION
,INSIDE_EDGE_POSITION
,OUTSIDE_EDGE_POSITION
-
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 rectangleedge
- the parent boundsposition
- the position on edgecornerDistance
- 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 xy
- the given point y- Returns:
- nearest edge
- See Also:
TOP_EDGE
,BOTTOM_EDGE
,LEFT_EDGE
,RIGHT_EDGE
-
setLoadedDimension
public void setLoadedDimension(@CheckForNull UnmodifiableDimension loadedDimension)
-
getLoadedDimension
@CheckForNull public UnmodifiableDimension getLoadedDimension()
-
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 interfacecom.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 bordershapeB
- 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 interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
providesHorizontalCenterline
public boolean providesHorizontalCenterline()
- Specified by:
providesHorizontalCenterline
in interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
snapsToCenterlines
public boolean snapsToCenterlines()
- Specified by:
snapsToCenterlines
in interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
isCenterlineInner
public boolean isCenterlineInner()
- Specified by:
isCenterlineInner
in interfacecom.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
- sizelocationX
- location XlocationY
- 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)
-
calculateAndGetPreferredDimension
public UnmodifiableDimension calculateAndGetPreferredDimension()
-
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)
-
-