Class ContainmentLinkView
- 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.paths.PathElement
-
- com.nomagic.magicdraw.uml.symbols.paths.ContainmentLinkView
-
- All Implemented Interfaces:
BaseElement
,MDElement
,ModelElementProvider
,com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
,com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
,com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
,NameOwner
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
@OpenApi public class ContainmentLinkView extends PathElement implements com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
Containment relationship symbol
-
-
Nested Class Summary
-
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 private NamedElement
childElement
Child element of this containment link - client model element.private boolean
simple
private TreeView
tree
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathElement
BEZIER, LINE_STYLE, OBLIQUE, RECTILINEAR
-
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 ContainmentLinkView()
ContainmentLinkView(PresentationElement parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
accept method for Visitorprivate void
changeSecondEndElementParent()
Move second end model element into first end model element.private static boolean
containsAddObjectViewCommand(java.util.Collection<com.nomagic.magicdraw.commands.Command> commands)
Indicates if a list of commands contains an AddObjectViewCommon macro command.void
dispose()
Disconnect this link from shapes.java.awt.Point
drawAnchor(java.awt.Graphics2D g, int ix1, int iy1, int ix2, int iy2, int size, boolean fill, java.awt.Color fillColor)
java.awt.Point
getActualClientDrawPoint()
Returns actual client side draw point.java.awt.Point
getActualSupplierDrawPoint()
Returns actual supplier side draw point.java.awt.BasicStroke
getInternalStroke(boolean line, int width)
TreeView
getTreeView()
java.awt.BasicStroke
internalGetPresentationElementStroke(boolean line, int width)
This method must be overridden, if you need to use DASHED_STROKE or another one.boolean
isRectilinear()
boolean
isSimple()
void
paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
protected boolean
preDisposeOnUpdate()
Validate symbol against model and try to fix it before actual symbol update.void
propertyChange(java.beans.PropertyChangeEvent evt)
Listens for property change it can be: data was edited text box was editedvoid
retrieveDataFromTreeView(TreeView tree)
void
setChildElement(NamedElement newChild)
Change child element of this containment link.void
setClient(PresentationElement obj)
Sets client for this link.void
setSimple(boolean simple)
void
setSupplier(PresentationElement shape)
Sets supplier end for link.void
setTreeView(TreeView tree)
Sets new tree view.void
sSetSimple(boolean simple)
void
sSetTreeView(TreeView tree)
Sets new tree view.-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathElement
addConnectedPathElement, addLineJumps, applyStrokeForLineDrawing, askDeleteDataConfirmation, atInsert, breakPointsChanged, cacheActualDrawPoints, cacheValues, calculatePathBounds, canChangeClient, canChangeLineStyle, canChangeSupplier, canClearBreakPoints, clearClientTranslation, clearRegisteredLineJumpInfos, clearSupplierTranslation, clone, coversPoint, createSmartListenerConfig, draw, draw, dynamicPathIcon, dynamicPathIcon, findOtherExistingElement, getAllBreakPoints, getBezierPath, getBezierPath, getBounds, getBoundsToRepaint, getBreakPoint, getBreakPointCount, getBreakPoints, getCachedActualClientDrawPoint, getCachedActualSupplierDrawPoint, getClient, getClientConnectionType, getClientDrawPoint, getClientPoint, getCustomClientPoint, getCustomStereotypeIcon, getCustomSupplierPoint, getDefaultParentForData, getIndexOfCoveredPath, getIndexOfCoveredPathInternal, getIntersection, getLineJumpStartAngle, getLinkLineStyle, getMiddlePoint, getNearestLinkPart, getNearestPoint, getNewBreakPointIndex, getNewPointByTheLink, getNextEnd, getNextPoint, getNotCopyBounds, getPathIcon, getPathPainter, getPaths, getPointOnPath, getPreviousPoint, getSupplier, getSupplierConnectionType, getSupplierDrawPoint, getSupplierPoint, getSuspendShapeAutoResizeMode, handleRemoveBreaksAction, hasClientPoint, hasManipulator, hasSharedData, hasSupplierPoint, internalApplyProperties, internalGetBoundsShape, internalGetPresentationElementStroke, internalGetPresentationElementStroke, internalMovedAsToSelf, internalSilentApply, internalSnapToGrid, intersects, intersectsInternal, isAlwaysToSelf, isBezier, isBezierIntersects, isBreakable, isConnectable, isConnectable, isDrawLineJumps, isFixed, isOblique, isRounded, isSmartLayoutNeeded, isSnapToGrid, isToSelf, isUseFlowLayoutLogic, isVertical, makeRectilinear, makeRectilinear, moveLinkToClientParent, movePathElement, needsToMoveOtherEnd, nextStyle, notifyBreakPointsChanged, notifyRepaintManager, notifyRepaintManager, optimizeLoops, paintSelf, prepareForFillDrawing, prepareForLineDrawing, registerLineJumpInfos, registerLineJumpStartAngle, removeBreakPoints, removeBreaks, removeRedundantBreakPoints, removeUnnecessaryBreakPoints, resetCache, resizeParent, sAddBreakPoint, sClearBreakPoints, setBounds, setBreakable, setBreakPoints, setCachedPathBounds, setClientPoint, setCustomClientPoint, setCustomSupplierPoint, setLineJumpPlace, setLinkLineStyle, setPathPainter, setRectilinear, setRounded, setSmartLayoutNeeded, setSupplierPoint, setSuspendShapeAutoResizeMode, simpleSetBounds, sSetBounds, sSetBreakable, sSetBreakPoint, sSetBreakPoints, sSetClient, sSetClientPoint, sSetLinkLineStyle, sSetParent, sSetRounded, sSetSupplier, sSetSupplierPoint, sSetSuspendShapeAutoResizeMode, swapEnds, translateClientPoint, translateSupplierPoint
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
checkShowsProxy, clearShowsProxy, disposeConnectedPaths, findSymbolForEnd, findSymbolForEnd, getConnectedPathElement, getConnectedPathElementCount, getConnectedPathElements, getConnectedPathElements, getConnectedPathElements, getPreferredArrowLength, isShowsProxy, movePathElement, movePathElements, removeConnectedPathElement, sAddConnectedPathElement, selectPathsForMoving, setParent, setVisibility, sRemoveConnectedPathElement, sSetConnectedPathElements, sSetVisibility
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addPresentationElement, addPresentationElementWithoutResize, addProperty, adjustBoundsForMoving, adjustChildBounds, adjustChildBoundsForMoving, alwaysShowTooltip, applyProperties, atInsertChildren, autosizeAndResizeManipulatedParent, autosizeAndResizeParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddChild, canAddInstance, canAddInstance, canBeDisposedOnUpdate, canChangeElementParent, canChangeParent, canChangeParent, canFill, canHavePaths, changeProperties, changeProperty, changePropertyManager, checkElementParentOnAdd, checkProxyVisibility, childrenForMoving, clearAntialiasingState, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, constructChangePropertyCommand, createPropertyChangeListener, createPropertyManager, disposeChildren, disposeListener, 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, 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, getManipulatedElementAt, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getManipulationPreferredDimension, getMiddlePoint, getMiddlePointX, getMiddlePointX, getMiddlePointY, getMiddlePointY, getMinimumDimension, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolPropertyOwner, getPreferredBounds, getPreferredDimension, getPreferredDimensionForAutosize, 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, initialize, initializeAndAutosize, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetElementsForLinkConnecting, internalGetElementToConnectLink, 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, onFind, onFind, onFontChange, paintAdornments, paintAdornmentsBackground, paintChildrenAndAdornments, paintChildrenBackground, paintSelfBackground, prepareForLineDrawing, prepareForShadowDrawing, prepareForTextDrawing, recreateListeners, recursiveAutosize, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, removePresentationElement, 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, sSetParentForAll, sSetPresentationElements, sSetSize, sSetSize, sSetSize, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, updateLater, 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, toString
-
-
-
-
Field Detail
-
simple
private boolean simple
-
tree
private TreeView tree
-
childElement
private NamedElement childElement
Child element of this containment link - client model element. We need to keep additional reference to this element in order to have it available for calculations if client for link itself changes.
-
-
Constructor Detail
-
ContainmentLinkView
public ContainmentLinkView(@CheckForNull PresentationElement parent)
-
ContainmentLinkView
public ContainmentLinkView()
-
-
Method Detail
-
paintChildren
public void paintChildren(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
-
getActualClientDrawPoint
public java.awt.Point getActualClientDrawPoint()
Description copied from class:PathElement
Returns actual client side draw point.- Returns:
- actual client draw point.
-
getActualSupplierDrawPoint
public java.awt.Point getActualSupplierDrawPoint()
Description copied from class:PathElement
Returns actual supplier side draw point.- Returns:
- actual supplier draw point.
-
drawAnchor
public java.awt.Point drawAnchor(java.awt.Graphics2D g, int ix1, int iy1, int ix2, int iy2, int size, boolean fill, java.awt.Color fillColor)
- Specified by:
drawAnchor
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
accept
public void accept(Visitor visitor) throws java.lang.Exception
accept method for Visitor- Specified by:
accept
in interfaceMDElement
- Overrides:
accept
in classPathElement
- Parameters:
visitor
- - the Visitor- Throws:
java.lang.Exception
-
setSupplier
public void setSupplier(PresentationElement shape)
Description copied from class:PathElement
Sets supplier end for link. Removes this link from old shape. Inserts this link to new shape. Method also sets supplier point to the middle point of shape.- Parameters:
shape
- new supplier.
-
setClient
public void setClient(PresentationElement obj)
Description copied from class:PathElement
Sets client for this link. Changes parent object to the parent of client. Client's parent will always contain incoming links.- Parameters:
obj
- shape to check
-
changeSecondEndElementParent
private void changeSecondEndElementParent()
Move second end model element into first end model element.
-
containsAddObjectViewCommand
private static boolean containsAddObjectViewCommand(java.util.Collection<com.nomagic.magicdraw.commands.Command> commands)
Indicates if a list of commands contains an AddObjectViewCommon macro command.- Parameters:
commands
- list of commands in which to check.- Returns:
- true if list contains AddObjectViewCommon command, false otherwise.
-
setChildElement
public void setChildElement(@CheckForNull NamedElement newChild)
Change child element of this containment link. Registers listener to a new child (removes listener from the old one)- Parameters:
newChild
- child
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
Description copied from class:PresentationElement
Listens for property change it can be: data was edited text box was edited- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
preDisposeOnUpdate
protected boolean preDisposeOnUpdate()
Description copied from class:PresentationElement
Validate symbol against model and try to fix it before actual symbol update. If symbol is not valid and can not be fixed, request symbol dispose by returning true. Check if symbol should be disposed, because model does not correspond to symbol. This may happen for example if path supplier or client in model is changed, but path still is connected to symbols of old ends.Method also can fix symbol if possible - for example reconnect path to other symbols in diagram and etc.
- Returns:
- true if symbol must be disposed
-
isRectilinear
public boolean isRectilinear()
- Returns:
- true if link path style is rectilinear.
-
setSimple
public void setSimple(boolean simple)
- Specified by:
setSimple
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
sSetSimple
public void sSetSimple(boolean simple)
- Specified by:
sSetSimple
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
isSimple
public boolean isSimple()
- Specified by:
isSimple
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
setTreeView
public void setTreeView(TreeView tree)
Sets new tree view.- Specified by:
setTreeView
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
- Parameters:
tree
- new tree of this link.
-
sSetTreeView
public void sSetTreeView(TreeView tree)
Sets new tree view.- Specified by:
sSetTreeView
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
- Parameters:
tree
- new tree of this link.
-
getTreeView
@CheckForNull public TreeView getTreeView()
- Specified by:
getTreeView
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
dispose
public void dispose()
Description copied from class:PathElement
Disconnect this link from shapes.- Specified by:
dispose
in interfaceBaseElement
-
retrieveDataFromTreeView
public void retrieveDataFromTreeView(TreeView tree)
- Specified by:
retrieveDataFromTreeView
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
internalGetPresentationElementStroke
public java.awt.BasicStroke internalGetPresentationElementStroke(boolean line, int width)
Description copied from class:PathElement
This method must be overridden, if you need to use DASHED_STROKE or another one.- Parameters:
line
- true if for line, false if for adornments alsowidth
- width- Returns:
- the stroke for line drawing ( by default SOLID_STROKE).
-
getInternalStroke
public java.awt.BasicStroke getInternalStroke(boolean line, int width)
- Specified by:
getInternalStroke
in interfacecom.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
-
-