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 classcom.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.StringBORDER_ELEMENT_MARGIN_ALLstatic java.lang.StringBORDER_ELEMENT_MARGIN_BOTTOMstatic java.lang.StringBORDER_ELEMENT_MARGIN_LEFTstatic java.lang.StringBORDER_ELEMENT_MARGIN_LEFT_RIGHTstatic java.util.List<java.lang.String>BORDER_ELEMENT_MARGIN_MODESstatic java.lang.StringBORDER_ELEMENT_MARGIN_NONEstatic java.lang.StringBORDER_ELEMENT_MARGIN_RIGHTstatic java.lang.StringBORDER_ELEMENT_MARGIN_TOPstatic java.lang.StringBORDER_ELEMENT_MARGIN_TOP_BOTTOMstatic intBOTTOM_EDGEprivate static booleanCALCULATE_PREFERRED_REGARDING_CHILDRENFlag for calculating/not calculating preferred shape size regarding children.static intINSIDE_EDGE_POSITIONstatic intLEFT_EDGEprivate UnmodifiableDimensionloadedDimensionShape size at load time.private UnmodifiableDimensionminimumDimensionMinimum size of this objectstatic byteNEED_AUTOSIZE_FULLFlag for doing full autosize - calculation of preferred size and children layoutstatic byteNEED_AUTOSIZE_LAYOUTFlag for doing only children layout during autosizestatic byteNEED_AUTOSIZE_NONEFlag for ignoring autosizeprivate byteneedAutosizeNeed autosize flag is used to check if we need to do explicit autosize during bounds setting or not.static intNO_EDGEstatic com.nomagic.ui.UnmodifiableInsetsNULL_INSETSInsets with all location equal to 0private java.awt.RectangleoldRectShapes bounds before changing bounds.static intON_EDGE_POSITIONprivate intonEdgeBorder type on which this shape residesstatic intOUTSIDE_EDGE_POSITIONprivate UnmodifiableDimensionpreferredDimensionPreferred size of this text shape view objectprivate java.awt.RectanglerectangleSpecifies shapes position and sizeprivate com.nomagic.magicdraw.uml.symbols.ReshapeModereshapeModeprivate com.nomagic.magicdraw.uml.symbols.ReshapeModereshapeModeUsedForPrefDimensionstatic intRIGHT_EDGEprivate static booleanSNAP_SHAPES_ON_BORDER_TO_GRIDExperimental property added by Mindaugas Genutis request for Acorn customer.static intSPACESpace between bounds and some inner object.static com.nomagic.ui.UnmodifiableInsetsSPACE_INSETSInsets with all location equal to SPACEstatic com.nomagic.ui.UnmodifiableInsetsSPACE_INSETS_EMPTY_TOP_BOTTOMInsets with top/bottom equals to zero and right/left equals to SPACEstatic java.lang.StringSUSPEND_SHAPE_AUTO_RESIZE_FALSEstatic java.util.List<java.lang.String>SUSPEND_SHAPE_AUTO_RESIZE_MODESPossible values of diagrams symbols freeze mode for symbol sizestatic java.lang.StringSUSPEND_SHAPE_AUTO_RESIZE_SAME_AS_DIAGRAMstatic java.lang.StringSUSPEND_SHAPE_AUTO_RESIZE_TRUEstatic intTOP_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 voidaccept(Visitor visitor)Method accepts visitor, and calls method visit<class name>(this) of visitor .protected voidaddBreakPoints(PathElement link)Adds break points to link to self.voidadjustBounds(java.awt.Rectangle bounds)Validates boundsjava.awt.RectangleadjustBoundsForMoving(java.awt.Rectangle rec, java.util.Collection<PresentationElement> movedTogether)validate bounds for movingvoidadjustOnEdge()Adjust shape on the edge of its parent.java.awt.PointadjustOnEdge(java.awt.Rectangle bounds, int edge, int position, int cornerDistance)Calculates location of given rectangle according given parent edge and position on edge.voidadjustOnEdgeChildren()Adjust on edge all childrenvoidautosize()voidautosize(boolean calculatePrefSize)Calculate preferred size and make this shape size at least as preferred(if size is smaller)voidautosizeAndResizeParent()Resize itself and initiate parent resizejava.awt.PointcalculateAdjustOnEdgeLocation(java.awt.Rectangle bounds)Calculates on edge location for a shape.UnmodifiableDimensioncalculateAndGetMinimumShrinkingDimension(int locationX, int locationY)UnmodifiableDimensioncalculateAndGetPreferredDimension()protected voidcalculateAutosizeDimension(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 childrenvoidcalculateEdge()private voidcalculateInsetsForOnEdgeShapes(java.awt.Insets insets)voidcalculateMinimumDimension()calculates minimum sizeprotected com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBoundscalculateOnEdgeBounds()voidcalculatePreferredDimension()voidcalculatePreferredDimension(int locationX, int locationY)protected booleancanBeAutosized()booleancanHavePaths()voidclearOldRect()ShapeElementclone()Returns a copy of theElement.booleancoversPoint(int x, int y)checks if object covers provided pointContainerShapecreateBoundsShape(PathElement path, BoundsTransformation transformation)Creates bounding shape for intersection calculation.voidedgeChanged()voidensureDimension(boolean rememberBounds)If size is smaller than preferred size, makes shape larger.voidensurePreferredDimensionIfShrinkable()voidensurePreferredDimensionIfShrinkable(java.awt.Rectangle bounds)java.awt.PointfindFreePlaceForShapeOnBorder(ShapeElement shape, java.awt.Rectangle shapeB)Looks for available position slot for given shape on borderprivate java.awt.PointfindFreePlaceForShapeOnHorizontalBorder(java.awt.Rectangle shapeBounds, java.util.List<ShapeElement> onTheSameEdge)private java.awt.PointfindFreePlaceForShapeOnVerticalBorder(java.awt.Rectangle shapeBounds, java.util.List<ShapeElement> onTheSameEdge)private java.awt.PointfindPointForRectPath(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 intgetAvailableLocationHorizontallyBetween(int[] line, java.awt.Rectangle bounds)private static intgetAvailableLocationVerticallyBetween(int[] line, java.awt.Rectangle bounds)java.lang.StringgetBorderElementMargin()java.awt.RectanglegetBounds()Method returns bounds of this element.java.util.List<com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape>getCenterlineableInnerParts(int orientation)com.nomagic.ui.UnmodifiableInsetsgetChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)protected UnmodifiableDimensiongetDefaultDimension()UnmodifiableDimensiongetDimensionForShrinking(int width, int height)LinegetEdgeLine(int edge)Returns a line representing a specified edge.java.awt.Point[]getFixedConnectionPoints()-----1------ | | | | 4 2 | | | | ----3-------private java.awt.PointgetFixedLocationPoint(java.awt.Point thisPoint, java.awt.Point nextPoint, boolean wasTranslation)protected intgetHeaderInsetReduce(int edge, com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds bounds)protected java.awt.InsetsgetInsetsForOnEdgeShapes()java.awt.PointgetIntersection(int x1, int y1, int x2, int y2, PathElement path)Gets intersection point between shape view bounding rectangle and line.static java.awt.PointgetIntersection(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.PointgetIntersection(int x, int y, PathElement path)private static java.awt.PointgetIntersectionPoint(java.awt.Point p1, java.awt.Point p2, ContainerShape shape)UnmodifiableDimensiongetLoadedDimension()PresentationElementgetManipulatedElementAt(java.awt.Point pt)Gets manipulated symbol at specified point pt.UnmodifiableDimensiongetManipulationPreferredDimension()java.awt.PointgetMiddlePoint()Returns middle point of this element.java.awt.PointgetMiddlePoint(java.awt.Point rel)Gets middle point of this view,intgetMiddlePointX()intgetMiddlePointX(java.awt.Point rel)intgetMiddlePointY()intgetMiddlePointY(java.awt.Point rel)UnmodifiableDimensiongetMinimumDimension()get minimum possible size for objectintgetNearestEdge(int x, int y)Return nearest edge to given point.intgetNearestEdge(java.awt.Rectangle r)Return nearest edge to given rectangle.bytegetNeedAutosizeFlag()java.awt.RectanglegetNotCopyBounds()get not copy bounds of object throws NoRectangleDefinedExceptionprivate java.awt.RectanglegetOldRect()intgetOnEdge()Returns some edge constant if this shape must be on its parent edge.private java.awt.RectanglegetOnEdgeBounds()Calculates bounds used to place element on parent edge.intgetOnEdgeCornerDistance()intgetOnEdgePosition()Returns position on edge.UnmodifiableDimensiongetPreferredDimension()Returns preferable dimension of the element.UnmodifiableDimensiongetPreferredDimensionForAutosize()Returns preferable dimension of the element for autosize.This implementation simple returns preferred size.com.nomagic.magicdraw.uml.symbols.ReshapeModegetReshapeMode()java.lang.StringgetSuspendShapeAutoResizeMode()booleanhasManipulator()Returns true, if view has manipulator (is selectable)voidinitialize()Initialize symbol and its children state.voidinternalApplyProperties(PropertyManager man)Applies properties from given property managerjava.awt.ShapeinternalGetBoundsShape(ConverterToShape converterToShape)voidinternalSilentApply()Silently applies all properties after initializationbooleanintersects(int x, int y, int width, int height)checks whether object intersects with given rectanglebooleanisAutosized()Returns autosize flag.booleanisCenterlineInner()booleanisChildLayoutable(PresentationElement child)Check if given child is "layoutable" - it means this shape controls bounds of child inside layoutChildren() method.booleanisHorizontalCenterlineProvider()Indicates whether this shape provides horizontal centerlines to other shapes.booleanisOnEdge()Returns true if symbol is on edgebooleanisShrinkable()static booleanisSnapShapesOnBorderToGrid()protected booleanisSnapToGrid()booleanisUseFixedConnectionPoints()booleanisVerticalCenterlineProvider()Indicates whether this shape provides vertical centerlines to other shapes.voidlayoutChildren()Layout children of this shape.voidlayoutChildren(boolean calculatePrefSize)Layout children of this shape.protected voidmaximumDimension(java.awt.Dimension size)protected voidminimumDimension(java.awt.Dimension min)calculates minimum sizevoidminimumDimensionForShrinking(java.awt.Dimension size, int locationX, int locationY)protected voidminimumOrMinimumShrinkableDimension(java.awt.Dimension size)protected voidmoveLinksToSelf()Move links to self.private voidmoveLinkToSelf(java.awt.Rectangle r, PathElement link)Moves one link to self.protected voidmovePathElement(PathElement link, PathConnector requestor)Calculates position of path element.voidmovePathElements()protected booleanneedAdjustToMaximumDimension()Check if shape should be resized to a maximum size.protected booleanneedAdjustToPreferred()Check if shape can be resized to a preferred size.protected voidonChildEdgeChange(ShapeElement child)protected voidprefDimensionByManipulatedChildren(java.awt.Dimension pref, int locationX, int locationY)protected voidpreferredDimension(java.awt.Dimension pref, int locationX, int locationY)protected booleanprepareForShadowDrawing(java.awt.Graphics2D g)Prepares graphics for symbol shadow drawing.booleanprovidesHorizontalCenterline()booleanprovidesVerticalCenterline()private voidrecalculateLinkToSelf(java.awt.Rectangle oldBounds, PathElement lnk)Move link to self.voidrecursiveAutosize()Resize recursively all symbols.voidresetCalculatePreferredRegardingChildren()Resets the CALCULATE_PREFERRED_REGARDING_CHILDREN value to the default.private booleansatisfiesGeneralCenterlineCondition()voidsetAutosize(boolean val)Sets autosize flag.voidsetBorderElementMargin(java.lang.String value)voidsetBounds(java.awt.Rectangle bounds)sets bounds of this object viewvoidsetCalculatePreferredRegardingChildren(boolean flag)Sets the CALCULATE_PREFERRED_REGARDING_CHILDREN value.voidsetLoadedDimension(UnmodifiableDimension loadedDimension)voidsetMinimumDimension(int width, int height)Sets min sizevoidsetNeedAutosizeFlag(byte needAutosize)voidsetOldRect(java.awt.Rectangle old)voidsetOnEdge(int onEdge)Sets on edge property.voidsetPreferredDimension(int width, int height)voidsetReshapeMode(com.nomagic.magicdraw.uml.symbols.ReshapeMode mode)Set symbol reshape modestatic voidsetSnapShapesOnBorderToGrid(boolean snapShapesOnBorderToGrid)voidsetSuspendShapeAutoResizeMode(java.lang.String mode)voidsetUseFixedConnectionPoints(boolean useFixed)protected booleanshouldDrawShadow()voidsimpleSetBounds(int x, int y, int width, int height, boolean calculatePrefSize)voidsimpleSetBounds(java.awt.Rectangle rect)Sets bounding rectangle.voidsimpleSetBounds(java.awt.Rectangle rect, boolean calculatePrefSize)Sets the bounding rectangle of this shape view to the specified value forbounds.private voidsMoveLink(PathElement link)Recalculates link end points.booleansnapsToCenterlines()voidsSetAutosize(boolean val)Simple setter for autosize flag.voidsSetBorderElementMargin(java.lang.String value)voidsSetBounds(java.awt.Rectangle bounds)Sets bounds of this object view only.voidsSetSuspendShapeAutoResizeMode(java.lang.String mode)voidsSetVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)Sets element visibility flag.java.lang.StringtoString()voidupdateLater()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:
getSuspendShapeAutoResizeModein 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:PresentationElementMethod returns bounds of this element. Use PresentationElementsManager to change a bounds of the element.- Overrides:
getBoundsin 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:PresentationElementget 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:PresentationElementGets 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:PresentationElementReturns 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:
getMiddlePointin 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:PresentationElementSets 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:PresentationElementsets bounds of this object view- Parameters:
bounds- rectangle of bounds
-
coversPoint
public boolean coversPoint(int x, int y)Description copied from class:PresentationElementchecks 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:PresentationElementchecks whether object intersects with given rectangle- Returns:
- true if object and rectangle intersects
-
clone
public ShapeElement clone()
Description copied from class:ElementImplReturns a copy of theElement.- Specified by:
clonein 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:PathConnectorCalculates 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:MDElementMethod accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.- Specified by:
acceptin interfaceMDElement- Overrides:
acceptin 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:PresentationElementReturns preferable dimension of the element.- Overrides:
getPreferredDimensionin classPresentationElement- Returns:
- preferred dimension
-
simpleSetBounds
public final void simpleSetBounds(java.awt.Rectangle rect)
Description copied from class:PresentationElementSets 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:PresentationElementResize 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:PresentationElementResize 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:PresentationElementInitialize 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:PresentationElementget minimum possible size for object- Returns:
- minimum dimension
-
getManipulatedElementAt
public PresentationElement getManipulatedElementAt(java.awt.Point pt)
Description copied from class:PresentationElementGets 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:PresentationElementApplies properties from given property manager- Parameters:
man- new properties
-
canBeAutosized
protected boolean canBeAutosized()
-
isSnapToGrid
protected boolean isSnapToGrid()
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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:PresentationElementSilently 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:PresentationElementvalidate 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:PresentationElementIf 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:PresentationElementPrepares 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:
getCenterlineableInnerPartsin 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:
providesVerticalCenterlinein interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
providesHorizontalCenterline
public boolean providesHorizontalCenterline()
- Specified by:
providesHorizontalCenterlinein interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
snapsToCenterlines
public boolean snapsToCenterlines()
- Specified by:
snapsToCenterlinesin interfacecom.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
-
isCenterlineInner
public boolean isCenterlineInner()
- Specified by:
isCenterlineInnerin 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:PresentationElementSets 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:PresentationElementReturns 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:PresentationElementReturns 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)
-
-