Class PathElement
java.lang.Object
com.nomagic.magicdraw.uml.MDElementImpl
com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.paths.PathConnector
com.nomagic.magicdraw.uml.symbols.paths.PathElement
- All Implemented Interfaces:
BaseElement,MDElement,ModelElementProvider,com.nomagic.magicdraw.uml.symbols.LineJumpDrawer,com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider,NameOwner,PropertyChangeListener,Cloneable,Comparable,EventListener
- Direct Known Subclasses:
com.nomagic.magicdraw.uml.symbols.paths.ContainerLinkView,ContainmentLinkView,LinkAttributeView,NoteAnchorView
@OpenApi
public abstract class PathElement
extends PathConnector
implements com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
Base class for all path kinds of symbols.
Path is a symbol that connects two other symbols as a graphical path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBezier path line style.All possible path line styles.static final StringPolyline path line style.static final StringPath line style with rectilinear (90 degrees) breakpoint corners.Fields inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
showsProxyFields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DEFAULT_LINE_WIDTH, DOTTED_STROKE, HANDLE_SIZE, MAX_LINE_WIDTH, MIN_LINE_WIDTH, peStyle, SHADOW_WIDTH, SOLID_STROKE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod accepts a visitor, and calls method "visit<class name>(this)" of a visitor.booleanMethod to add sub link to this link.voidaddLineJumps(GeneralPath path, Point segmentStartPoint, Point startPoint, Point endPoint) Adds line jumps to the specified path.static voidapplyStrokeForLineDrawing(PresentationElement pathElement, Graphics2D g, boolean line, BasicStroke stroke) booleanReturn true, because while deleting link view user must be prompt about deleting datavoidatInsert()Inserts ends of link into shapes.final voidbreakPointsChanged(List<Point> oldPoints, List<Point> newPoints) Moves all connection point for the links that are attached to this link middle point.protected voidcacheActualDrawPoints(Point supplierDrawPoint, Point clientDrawPoint, List<Point> breakPoints) protected voidcacheValues(Point cachedActualSupplierDrawPoint, Point cachedActualClientDrawPoint, Point cacheSupplierDrawPoint, Point cacheClientDrawPoint, List<Point> cacheBreakPoints) calculatePathBounds(Point supplier, Point client, List<Point> breaks) booleanbooleanbooleanbooleanvoidClears a client translated flag.voidClears all registered LineJumpInfos.voidClears a supplier translated flag.clone()voidconnectModelElement(com.nomagic.magicdraw.uml.symbols.paths.ConnectModelElementParticipant participant) ConnectsModelElementof this path to related elements of a given client and supplierbooleancoversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Checks if object covers provided pointcom.nomagic.magicdraw.uml.symbols.FillStrategyprotected voidcreateSmartListenerConfig(List<SmartListenerConfig> configurations) voiddispose()Disconnect this link from shapes.voiddraw(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) abstract method for drawing ViewObject object used to draw object on graphicsvoidDraws link from given point pt1 through break points to given point pt2.com.dassault_systemes.modeler.foundation.image.pathicon.PathIconcom.dassault_systemes.modeler.foundation.image.pathicon.PathIcondynamicPathIcon(com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon pathIcon) final com.dassault_systemes.modeler.foundation.model.ModelElementfindOwnerForElement(PresentationElement newParent, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext) com.dassault_systemes.modeler.foundation.model.ModelElementfindOwnerForElement(PresentationElement newParent, PresentationElement client, PresentationElement supplier, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext) Returns actual client side draw point.Returns actual supplier side draw point.Returns a break points list with added supplier and client end point in the list as well.Calculates path for bezier curve drawing.getBezierPath(List<Point> points) Calculates path from breakpoints for bezier curve drawing.final RectangleCalculates bounds of this link.Return bounds of the symbol that must be repainted.getBreakPoint(int pos) Returns break point with given index.intreturns size of break point vectorReturns break points of the path.Returns client of the path.intReturns point where path drawing should startfinal PointReturns point where path connects client end's element.static com.dassault_systemes.modeler.foundation.image.pathicon.PathIcongetCustomStereotypeIcon(Element element) Presentation element could suggest parent, which would be more acceptable, than adding to the client If returning null, general mechanism will workfinal intgetIndexOfCoveredPath(int x, int y) This method is used to get segment of path with witch given point has intersection.intgetIndexOfCoveredPathInternal(int x, int y, int width, int height) This method is used to get segment of path with witch given rectangle has intersection.getIntersection(int x, int y, PathElement path) doublegetLineJumpStartAngle(Point point) Calculates and returns middle point of link.final LinegetNearestLinkPart(int x, int y) Returns the nearest link part to specified point.final PointgetNearestPoint(Point pt) Returns first break point or client point if arg is supplier point.intgetNewBreakPointIndex(Point point, List<Point> brk) Find the nearest breakpoints for new one and calculate the position of the new breakpoint in breakpoint vector.Returns other than given end.final PointgetNextPoint(Point pt) Returns next point to a given one.final Rectangleget not copy bounds of object throws NoRectangleDefinedExceptioncom.dassault_systemes.modeler.foundation.diagram.style.PathStylePropertyDelegatecom.dassault_systemes.modeler.foundation.image.pathicon.PathIconcom.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter<PathElement>getPaths()Returns only one path which consist of actual supplier draw point, break points of the path element and actual client draw point.getPointOnPath(Point supplierPoint, Point clientPoint, List<Point> breakpoints, double coefficient) final PointReturns previous point to given one.Returns supplier of the path.intReturns point where path drawing should startfinal PointReturns point where path connects supplier end's element.com.dassault_systemes.modeler.foundation.editing.Commandprotected booleanCheck if client point is already not nullbooleanReturns true, if view has manipulator (is selectable)booleanReturns true ifModelElementof this symbol can represented with other symbol.protected booleanCheck if supplier point is already not nullvoidinternalApplyProperties(com.dassault_systemes.modeler.magic.diagram.styledelegates.PresentationElementStyleChanger changer) Applies propertiesinternalGetBoundsShape(ConverterToShape converterToShape) internalGetPresentationElementStroke(boolean line, int width) This method must be overridden, if you need to use DASHED_STROKE or another one.protected BasicStrokeinternalGetPresentationElementStroke(boolean line, int lineStyle, int width) internalGetPresentationElementStroke(int width) Return a stroke used to paint symbol's main partvoidinternalMovedAsToSelf(int dx, int dy) This is an internal method to notify a path that it was moved by connecting shape as the path "to self"voidSilently applies all properties after initializationprotected voidinternalSnapToGrid(float step) final booleanintersects(int x, int y, int width, int height, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Check if any line between breakpoints intersect with given points of rectanglebooleanintersectsInternal(int x, int y, int width, int height) Check intersection with given rectangle.booleanbooleanisBezier()booleanisBezierIntersects(int x, int y, int width, int height) Check if it is bezier path intersection with rectangle.booleanShows whether a path is breakable.final booleanisConnectable(PresentationElement supplier, PresentationElement client) Checks if this path can connect given two elements.final booleanisConnectable(PresentationElement supplier, PresentationElement client, Map<Object, Object> options) Checks if this path can connect given two elements.booleanReturns true if the path element wants to draw line jumps.booleanisFixed()If a path tied to its supplier and client (cannot be reconnected)booleanbooleanbooleanbooleanReturns value of the "Is Rounded" path symbol property.booleanReturns smart layout needed flag.protected booleanbooleanisToSelf()booleanIndicates if smart path/shape edit should be used in this diagram.booleanIndicates if path element is drawn in the diagram which has vertical orientation.voidMakes link rectilinear.voidmakeRectilinear(boolean notify) Makes link rectilinear.voidmoveLinkToClientParent(boolean simpleAdd) protected voidmovePathElement(PathElement link, PathConnector requestor) Moves link.booleanvoidnotifyBreakPointsChanged(List<Point> oldPoints, List<Point> newPoints) Notifies about break point vector changesvoidnotifyRepaintManager(boolean boundsChanged) Notifies the repaint manager about changes in bounds.protected final voidnotifyRepaintManager(List<Point> oldBreakpoints, List<Point> newBreakpoints) voidRemoves loops from paths for example: path | ----------+ | | ------voidpaintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) protected booleanValidate symbol against model and try to fix it before actual symbol update.booleanprepareForLineDrawing(Graphics2D g, boolean line) Prepares graphics for line drawing.voidregisterLineJumpInfos(int pathIndex, Point segmentStartPoint, List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps) Registers line jump info for specified path and specified segmentStartPoint in the path.voidregisterLineJumpStartAngle(int pathIndex, Point point, double lineJumpStartAngle) Registers start angle for the specified path and specified start point of the path segment.booleanRemoves break points if they do not really break the path (a path looks like without break points but really has them).voidremoveBreaks(List<Point> points) Removes all break points if they are covered by client or client bounds.voidRemoves redundant breakpoints from link.voidRemoves unnecessary points from break point vector.protected voidvoidDo nothing, because path does not affect parent sizefinal voidsAddBreakPoint(Point pt) Adds new break point.final voidClear break points list.voidMoves link to new location.voidsetBreakable(boolean value) Sets a breakable flag on/off.final voidsetBreakPoints(List<Point> vct) Sets break point vector.protected voidvoidsetClient(PresentationElement shape) Sets client for this link.voidsetClientPoint(Point pt) Sets client point.voidsetCustomClientPoint(Point point) voidsetCustomSupplierPoint(Point point) voidsetLineJumpPlace(com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace) Sets line jump place of the path element.voidsetLinkLineStyle(String style) sets LINK_LINE_STYLE property value.protected final voidsetPathPainter(com.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter pathPainter) voidSets link rectilinear property value.voidsetRounded(boolean rounded) Sets value of the "Is Rounded" path symbol property.voidsetSmartLayoutNeeded(boolean smartLayoutNeeded) Sets smart layout needed flag.voidsetSupplier(PresentationElement shape) Sets supplier end for link.voidSets first point.voidvoidcalls break point vector changed method.voidMoves path to new location.voidsSetBreakable(boolean value) Sets a breakable flag on/off.final voidsSetBreakPoint(Point pt, int pos) Sets break point at the given position.final voidsSetBreakPoints(List<Point> vct) Only sets break point vector.voidsSetClient(PresentationElement symbol) Sets client for this link.voidsSetClientPoint(Point pt) Sets client connection Point.voidsSetLinkLineStyle(String style) Change value of LINK_LINE_STYLE property.voidsSetParent(PresentationElement parent) Sets parent for this view.voidsSetRounded(boolean rounded) Sets value of the "Is Rounded" path symbol property.voidsSetSupplier(PresentationElement symbol) Sets supplier for this link.voidSets supplier connection point.voidvoidswapEnds()Swaps ends of the linkfinal PointtranslateClientPoint(Rectangle old, Rectangle newR) final PointtranslateSupplierPoint(Rectangle old, Rectangle newR) com.nomagic.utils.Pair<com.dassault_systemes.modeler.foundation.model.ModelElement,Consumer<com.dassault_systemes.modeler.foundation.model.ModelElement>> Finds and returns other model element which is semantically equivalent to this path model element.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, supportsVisibleConnectedPathElementsIfSelfInvisibleMethods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addPresentationElement, addPresentationElementWithoutResize, addProperty, adjustBoundsBeforeChange, adjustChildBounds, adjustChildBoundsForMoving, alwaysShowTooltip, applyProperties, atInsertChildren, autosizeAndResizeManipulatedParent, autosizeAndResizeParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddChild, canAddInstance, canAddInstance, canBeDisposedOnUpdate, canChangeElementOwner, canChangeParent, canChangeParent, canFill, canHavePaths, changeProperties, checkElementOwnerOnChange, checkProxyVisibility, childrenForMoving, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, coversPoint, createPresentationElementStyle, createPropertyChangeListener, disposeChildren, disposePropertyChangeListener, drawBackground, drawSymbol, drawSymbolBackground, dynamicFillColor, dynamicLineColor, dynamicLineWidth, dynamicLineWidth, dynamicPaintShadow, dynamicStroke, dynamicStroke, dynamicStroke, dynamicStyleFillColor, dynamicStyleLineColor, dynamicStyleTextColor, dynamicStyleTransparency, dynamicStyleTransparency, dynamicStyleValue, dynamicTextAlignment, dynamicTextColor, editName, editName, findOwnerForChildElement, findPresentationElement, firePropertyChange, generateID, getAbstractDiagramPresentationElement, getActualElement, getAdditionalRenderersToNotifyOnPropertiesChange, getAssignableModelElementsClasses, getBoundsShape, getBoundsWithChildrenOnEdge, getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getChildPresentationElementForContextMenu, getChildrenWithSymbolProperties, getConfiguration, getDiagramPresentationElement, getDiagramSurface, getDrawComparator, getDynamicConfigurations, getDynamicStyleOwner, getEffectiveStyleDelegate, getEffectiveStyleOwner, getElement, getElementsForRelationshipConnecting, getElementToConnectRelationship, getFillColor, getFont, getFontHeight, getFontRenderContext, getHumanName, getHumanType, getLineColor, getLineWidth, getManipulatedElementAt, getManipulatedElementAt, getManipulatedElementAt, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getManipulationPreferredDimension, getMiddlePoint, getMiddlePointX, getMiddlePointX, getMiddlePointY, getMiddlePointY, getMinimumDimension, getModelElement, getModelElementsForRelationshipConnecting, getModelElementToConnectRelationship, getModelElementToMove, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolStyleOwner, getPreferredBounds, getPreferredDimension, getPreferredDimensionForAutosize, getPreferredSize, getPresentationElementAt, getPresentationElementAt, getPresentationElementAt, getPresentationElementAt, getPresentationElementAt, getPresentationElementCount, getPresentationElementIndex, getPresentationElements, getPresentationElementsAt, getPresentationElementsAt, getPresentationElementsAt, getPresentationElementsAt, getPresentationElementStroke, getPresentationElementStroke, getProjectImpl, getProperty, getPropertyManager, getPropertyManagerName, getRenderer, getSelected, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, getStyle, getSymbolRenderer, getTextColor, getTolerance, getVisibility, getVisiblePresentationElements, handleModelDelete, hasManipulatedPresentationElements, initialize, initializeAndAutosize, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetModelElementsForRelationshipConnecting, internalGetModelElementsForRelationshipConnecting, internalGetModelElementToConnectRelationship, internalGetSpecificFont, internalGetSpecificTextColor, internalIsSuitableToConnectRelationship, internalIsSuitableToConnectRelationship, internalSnapToGrid, internalUpdatePresentationElement, intersects, invalidate, isCanChildrenChangeEdge, isChildVisible, isContentHidden, isCreateElementListener, isDetectable, isDisposed, isLayouting, isMovableByMoveManager, isNotNull, isParentOf, isParentOf, isPreserveProportionsWhenGrowing, isSelected, isShowElementTypeAsLabel, isSortable, isSuitableToConnectRelationship, isTextEditable, isUseFillColor, isUseFillColorByProperty, isUseGradientForFill, isVisible, isVisibleInDiagram, isVisibleOrShrunken, movePathElementsRecursively, mustShowContextMenu, notifyCreated, notifyDiagramFrameSizeChange, onChildAdd, onChildRemove, onDiagramSurfaceSet, onFind, onFind, onFontChange, onParentChange, paintAdornments, paintAdornmentsBackground, paintChildren, paintChildrenAndAdornments, paintChildrenBackground, paintSelfBackground, prepareForLineDrawing, prepareForShadowDrawing, prepareForTextDrawing, propertyChange, recreateListeners, recursiveAutosize, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, removePresentationElement, sAddPresentationElement, sAddPresentationElement, selectChildrenForMoving, selectObjectsForMoving, setAllSelected, setBounds, setCreateElementListener, setDummyResizeMode, setElement, setFillColor, setFont, setLayouting, setLineColor, setLineWidth, setLoadedVisibility, setLocation, setLocation, setModelElement, setNeedRecreateListeners, setPresentationElements, setPropertyManagerName, setSelected, setSelected, setSize, setSize, setSize, setTextColor, setTextEditable, setUseFillColor, setVisible, silentApply, silentApply, simpleSetBounds, snapToGrid, snapToGrid, snapViewToGrid, sortObjectsByX, sortObjectsByY, sRemovePresentationElement, sSetBounds, sSetElement, sSetLocation, sSetLocation, sSetModelElement, sSetParentForAll, sSetPresentationElements, sSetSize, sSetSize, sSetSize, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, updateLater, updateModelByView, updateModelByViewInternal, updateViewAfterPropertyChange, useParentProperties, useParentStyleMethods inherited from class com.nomagic.magicdraw.uml.MDElementImpl
accept, addPropertyChangeListener, canAdd, canAddChild, canBeDeleted, canDeleteChild, compareTo, createSortKeys, getClassType, getID, getName, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setProjectProvider, setResourceIDProvider, sGetID, toStringMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.nomagic.magicdraw.uml.BaseElement
canAdd, isSelfChangeableMethods inherited from interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
getLineWidthMethods inherited from interface com.nomagic.magicdraw.uml.MDElement
getProject
-
Field Details
-
RECTILINEAR
Path line style with rectilinear (90 degrees) breakpoint corners.- See Also:
-
OBLIQUE
Polyline path line style.- See Also:
-
BEZIER
Bezier path line style.- See Also:
-
LINE_STYLE
All possible path line styles.
-
-
Constructor Details
-
PathElement
public PathElement() -
PathElement
-
-
Method Details
-
getOwnStyleDelegate
public com.dassault_systemes.modeler.foundation.diagram.style.PathStylePropertyDelegate getOwnStyleDelegate()- Overrides:
getOwnStyleDelegatein classPresentationElement- Returns:
- the own style property delegate
-
clearSupplierTranslation
public void clearSupplierTranslation()Clears a supplier translated flag. -
clearClientTranslation
public void clearClientTranslation()Clears a client translated flag. -
translateSupplierPoint
-
translateClientPoint
-
getNewPointByTheLink
-
askDeleteDataConfirmation
public boolean askDeleteDataConfirmation()Return true, because while deleting link view user must be prompt about deleting data- Overrides:
askDeleteDataConfirmationin classPresentationElement- Returns:
- confirmation status -- true if asking is necessary, false otherwise
-
setBreakable
public void setBreakable(boolean value) Sets a breakable flag on/off. If a flag is not set, a path cannot be broken. However, a path can have break points and be non-breakable. This means that path has fixed points that cannot be moved.- Parameters:
value- flag value
-
sSetBreakable
public void sSetBreakable(boolean value) Sets a breakable flag on/off. If a flag is not set, a path cannot be broken. However, a path can have break points and be non-breakable. This means that path has fixed points that cannot be moved.- Parameters:
value- flag value
-
isBreakable
public boolean isBreakable()Shows whether a path is breakable.- Returns:
- true if a path can be broken
-
isFixed
public boolean isFixed()If a path tied to its supplier and client (cannot be reconnected)- Returns:
- true, if it can be reconnected, else false
-
getBreakPoints
Returns break points of the path. The order of break points is from supplier to the client path's end. Use PresentationElementsManager to change the break points for the path.- Returns:
- break points list.Points in the list are not cloned, so do not modify them directly. The List is unmodifiable.
- See Also:
-
getAllBreakPoints
Returns a break points list with added supplier and client end point in the list as well. Use PresentationElementsManager to change the break points for the path.- Returns:
- supplier point + break points + client point. Points in the list are not cloned, so do not modify them directly. The List is modifiable.
- See Also:
-
setBreakPoints
Sets break point vector.- Parameters:
vct- new break point vector.
-
sClearBreakPoints
public final void sClearBreakPoints()Clear break points list. -
sSetBreakPoints
Only sets break point vector.- Parameters:
vct- new break point vector.
-
sAddBreakPoint
Adds new break point.- Parameters:
pt- point to be added.
-
sSetBreakPoint
Sets break point at the given position.- Parameters:
pt- point to be setpos- position where it must be set
-
needsToMoveOtherEnd
public boolean needsToMoveOtherEnd()- Returns:
- true, if one end of links changed bounds and move link must be called for both ends.
-
getBreakPoint
Returns break point with given index.- Parameters:
pos- position where point resides.- Returns:
- point at position pos.
-
getBreakPointCount
public int getBreakPointCount()returns size of break point vector- Returns:
- break point count
-
setBounds
Moves link to new location.- Specified by:
setBoundsin classPresentationElement- Parameters:
r- new location of a path
-
simpleSetBounds
calls break point vector changed method.- Overrides:
simpleSetBoundsin classPresentationElement- Parameters:
r- new bounding rectangle.
-
isToSelf
public boolean isToSelf()- Returns:
- true if this path is to self (client and supplier are the same).
-
isAlwaysToSelf
public boolean isAlwaysToSelf() -
sSetBounds
Moves path to new location.- Specified by:
sSetBoundsin classPresentationElement- Parameters:
r- new location of a path
-
removeUnnecessaryBreakPoints
public void removeUnnecessaryBreakPoints()Removes unnecessary points from break point vector. Checks if break point vector has useless points (covered by shape or invisible). Does not do anything if a path cannot be breakable. If it has, remove them. -
getPathIcon
@CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon getPathIcon() -
dynamicPathIcon
@CheckForNull public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon() -
dynamicPathIcon
public com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon dynamicPathIcon(@CheckForNull com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon pathIcon) -
getCustomStereotypeIcon
@CheckForNull public static com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon getCustomStereotypeIcon(@CheckForNull Element element) -
draw
Draws link from given point pt1 through break points to given point pt2.- Parameters:
g- graphicssupplierPoint- first pointclientPoint- second pointbreakPoints- points between supplier and client points, in that order
-
internalGetBoundsShape
- Overrides:
internalGetBoundsShapein classPresentationElement
-
setLineJumpPlace
public void setLineJumpPlace(@CheckForNull com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace) Sets line jump place of the path element.
NOTE: OnlyLineJumpManagercan set jump place of the link. SinceLineJumpManagerwill reset line jump place on every repaint of a diagram then other invocations of the method will not have an effect.- Specified by:
setLineJumpPlacein interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Parameters:
lineJumpPlace- new line jump place.
-
registerLineJumpInfos
public void registerLineJumpInfos(int pathIndex, Point segmentStartPoint, @CheckForNull List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps) Description copied from interface:com.nomagic.magicdraw.uml.symbols.LineJumpDrawerRegisters line jump info for specified path and specified segmentStartPoint in the path. Index of the path coincident with the index of the path which was returned byLineJumpDrawer.getPaths()method.- Specified by:
registerLineJumpInfosin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Parameters:
pathIndex- index of the path.segmentStartPoint- start point of the segment.lineJumps- list of information about line jumps.
-
clearRegisteredLineJumpInfos
public void clearRegisteredLineJumpInfos()Description copied from interface:com.nomagic.magicdraw.uml.symbols.LineJumpDrawerClears all registered LineJumpInfos.- Specified by:
clearRegisteredLineJumpInfosin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
registerLineJumpStartAngle
Description copied from interface:com.nomagic.magicdraw.uml.symbols.LineJumpDrawerRegisters start angle for the specified path and specified start point of the path segment.- Specified by:
registerLineJumpStartAnglein interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Parameters:
pathIndex- index of the path.point- start point of the segment.lineJumpStartAngle- start angle of the line jump.
-
getLineJumpStartAngle
-
addLineJumps
public void addLineJumps(GeneralPath path, Point segmentStartPoint, Point startPoint, @CheckForNull Point endPoint) Adds line jumps to the specified path.- Specified by:
addLineJumpsin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Parameters:
path- a path object.segmentStartPoint- segment start point.startPoint- start point from which to start adding the line jumps.endPoint- point until which line jumps should be added.
-
isDrawLineJumps
public boolean isDrawLineJumps()Returns true if the path element wants to draw line jumps.- Specified by:
isDrawLineJumpsin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Returns:
- true if line jumps should be drawn for the path element.
-
getPaths
Returns only one path which consist of actual supplier draw point, break points of the path element and actual client draw point.- Specified by:
getPathsin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer- Returns:
- paths.
-
setSupplierPoint
Sets first point. Sets new location for text boxes if a point is changed, text boxes must be moved too.- Parameters:
pt- new 1st point
-
sSetSupplierPoint
Sets supplier connection point.- Parameters:
pt- new supplier point.
-
sSetClientPoint
Sets client connection Point.- Parameters:
pt- new client point.
-
setClientPoint
Sets client point.- Parameters:
pt- new client point.
-
breakPointsChanged
Moves all connection point for the links that are attached to this link middle point.- Parameters:
oldPoints- old breakpoint vector.newPoints- new breakpoint vector.
-
notifyRepaintManager
public void notifyRepaintManager(boolean boundsChanged) Description copied from class:PresentationElementNotifies the repaint manager about changes in bounds.- Overrides:
notifyRepaintManagerin classPresentationElement
-
notifyRepaintManager
-
notifyBreakPointsChanged
Notifies about break point vector changes- Parameters:
oldPoints- old pointsnewPoints- new points
-
getNearestLinkPart
Returns the nearest link part to specified point.- Parameters:
x- x of pointy- y of point- Returns:
- line
-
removeBreakPoints
public boolean removeBreakPoints()Removes break points if they do not really break the path (a path looks like without break points but really has them). Does nothing if a path is not breakable. -
getSupplierPoint
Returns point where path connects supplier end's element.- Returns:
- supplier connection point. This method returns not cloned point, so do not modify it directly.
-
getClientPoint
Returns point where path connects client end's element.- Returns:
- client point. This method returns not cloned point, so do not modify it directly.
-
getClientDrawPoint
Returns point where path drawing should start- Returns:
- point
-
getActualClientDrawPoint
Returns actual client side draw point.- Returns:
- actual client draw point.
-
getActualSupplierDrawPoint
Returns actual supplier side draw point.- Returns:
- actual supplier draw point.
-
getSupplierDrawPoint
Returns point where path drawing should start- Returns:
- point
-
getNextPoint
Returns next point to a given one. If given point does not belong to the link, returns parameter point.- Parameters:
pt- point for which next point is necessary- Returns:
- next point(not cloned)
-
getPreviousPoint
Returns previous point to given one. If given point does not belong to the link, returns parameter point.- Parameters:
pt- point for which previous point is necessary- Returns:
- previous point(not cloned)
-
getNearestPoint
Returns first break point or client point if arg is supplier point. Or returns last break point or client point if arg is client point.- Parameters:
pt- given point- Returns:
- nearest point(not cloned)
-
sSetClient
Sets client for this link.- Parameters:
symbol- new client.
-
sSetSupplier
Sets supplier for this link.- Parameters:
symbol- new supplier.
-
setSupplier
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.
-
getClient
Returns client of the path.- Returns:
- client element.
-
getSupplier
Returns supplier of the path.- Returns:
- supplier end element.
-
getNextEnd
Returns other than given end. If given end is supplier method returns client of this path. If given end is not supplier method returns supplier of this path.- Parameters:
obj- given end- Returns:
- other opposite end
-
movePathElement
Moves link. Link can connect more links ( such as note anchors in UML class diagrams ). After link was moved positions of connected links must be updated. Method checks if moving link supplier is this link recalculates supplier point moving link, otherwise it calculates client point of moving link. Point is calculated to middle point of this link.- Specified by:
movePathElementin classPathConnector- Parameters:
link- link to move.requestor- requestor
-
optimizeLoops
public void optimizeLoops()Removes loops from paths for example: path | ----------+ | | ------ will be changed to | ----- -
clone
- Specified by:
clonein interfaceBaseElement- Overrides:
clonein classPathConnector
-
coversPoint
public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Checks if object covers provided point- Specified by:
coversPointin classPresentationElement- Returns:
- true if object covers this point
-
intersects
public final boolean intersects(int x, int y, int width, int height, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Check if any line between breakpoints intersect with given points of rectangle- Specified by:
intersectsin classPresentationElement- Returns:
- true if object and rectangle intersects
-
intersectsInternal
public boolean intersectsInternal(int x, int y, int width, int height) Check intersection with given rectangle. Intersection is counted by getting index of segment in path.- Parameters:
x- top left x point.y- top left y point.width- width of rectangle.height- height of rectangle.- Returns:
- true if rectangle intersect with any line of path.
-
isBezierIntersects
public boolean isBezierIntersects(int x, int y, int width, int height) Check if it is bezier path intersection with rectangle.- Parameters:
x- top left x point of rectangle.y- top left y point of rectangle.width- width of rectangle.height- height of rectangle.- Returns:
- true if bezier path intersects with rectangle.
-
getIndexOfCoveredPathInternal
public int getIndexOfCoveredPathInternal(int x, int y, int width, int height) This method is used to get segment of path with witch given rectangle has intersection. It will be returned index starting from 1 of segment. This segment is counted using all breakpoints (including client and supplier point). If anybody needs end points of segments, you must take all breakpoints and take point of return index minus 1 and point of segment's index. If there is no intersection, this method return -1. For example: this method returns value 2. segmentIndex = 2; Point start and end point of this segment will be: Point startPoint = getAllBreakPoints().get(segmentIndex-1); Point endPoint = getAllBreakPoints().get(segmentIndex);- Parameters:
x- top left x point of rectangle.y- top left y point of rectangle.width- width of rectangle.height- height of rectangle.- Returns:
- index of segment in path with witch intersect given rectangle.
-
getIndexOfCoveredPath
public final int getIndexOfCoveredPath(int x, int y) This method is used to get segment of path with witch given point has intersection. It will be returned index starting from 1 of segment. This segment is counted using all breakpoints (including client and supplier point). If anybody needs end points of segments, you must take all breakpoints and take point of return index minus 1 and point of segment's index. If there is no intersection, this method return -1. If renderer is set for path element, intersection will be counted depending on this renderer. For example: this method returns value 2. segmentIndex = 2; Point start and end point of this segment will be: Point startPoint = getAllBreakPoints().get(segmentIndex-1); Point endPoint = getAllBreakPoints().get(segmentIndex);- Parameters:
x- point x value.y- point y value.- Returns:
- index of segment of path which intersects with the given point.
-
getNewBreakPointIndex
Find the nearest breakpoints for new one and calculate the position of the new breakpoint in breakpoint vector. Used for new breakpoint calculation for Bézier curve.- Parameters:
point- the new point.brk- the breakpoint Vector.- Returns:
- position in that the new point must be inserted in a breakpoint vector.
-
isConnectable
@OpenApi public final boolean isConnectable(@CheckForNull PresentationElement supplier, @CheckForNull PresentationElement client) Checks if this path can connect given two elements.- Parameters:
supplier- candidate for path's supplier.client- candidate for path's client.- Returns:
- true, if path can connect given elements.
-
isConnectable
public final boolean isConnectable(@CheckForNull PresentationElement supplier, @CheckForNull PresentationElement client, @CheckForNull Map<Object, Object> options) Checks if this path can connect given two elements.- Parameters:
supplier- candidate for path's supplier.client- candidate for path's client.options- options- Returns:
- true, if path can connect given elements.
-
getMiddlePoint
Calculates and returns middle point of link. For this link it is average between supplier's and client's points.- Overrides:
getMiddlePointin classPresentationElement- Returns:
- middle point.
-
getPointOnPath
@OpenApi public Point getPointOnPath(Point supplierPoint, Point clientPoint, List<Point> breakpoints, double coefficient) - Parameters:
supplierPoint- supplier end pointclientPoint- client end pointbreakpoints- list of breakpoints between supplier and client in that ordercoefficient- ratio between 0 and 1 describing position relative to the path length. Provide 0.5 for middle point.- Returns:
- point on path
-
dispose
public void dispose()Disconnect this link from shapes.- Specified by:
disposein interfaceBaseElement- Overrides:
disposein classPathConnector
-
atInsert
public void atInsert()Inserts ends of link into shapes.- Specified by:
atInsertin interfaceBaseElement- Overrides:
atInsertin classPresentationElement
-
addConnectedPathElement
Method to add sub link to this link. If link is note anchor it will be added to this link. If link is not note anchor, it will be added to generalization tree.- Overrides:
addConnectedPathElementin classPathConnector- Parameters:
link- link to be added.- Returns:
- true if an element was added
-
getBounds
Calculates bounds of this link. Returns minimal rectangle in which link can fit.- Overrides:
getBoundsin classPresentationElement- Returns:
- bounds of this link.
- See Also:
-
PresentationElementsManager.reshapeShapeElement
-
getNotCopyBounds
Description copied from class:PresentationElementget not copy bounds of object throws NoRectangleDefinedException- Overrides:
getNotCopyBoundsin classPresentationElement- Returns:
- rectangle of bounds
-
setCachedPathBounds
-
calculatePathBounds
-
accept
Description copied from interface:MDElementMethod accepts a visitor, and calls method "visit<class name>(this)" of a visitor. See "Visitor" pattern for more details.- Specified by:
acceptin interfaceMDElement- Overrides:
acceptin classPathConnector- Parameters:
visitor- which visits this element.- Throws:
Exception
-
setRectilinear
public void setRectilinear()Sets link rectilinear property value. -
isRectilinear
public boolean isRectilinear()- Returns:
- true if link path style is rectilinear.
-
isOblique
public boolean isOblique()- Returns:
- true if link path style is oblique.
-
makeRectilinear
public void makeRectilinear()Makes link rectilinear. -
makeRectilinear
public void makeRectilinear(boolean notify) Makes link rectilinear.- Parameters:
notify- notify about this change
-
removeRedundantBreakPoints
Removes redundant breakpoints from link. Remove breakpoints only from rectilinear link.- Parameters:
vct- points
-
isVertical
public boolean isVertical()Indicates if path element is drawn in the diagram which has vertical orientation.- Returns:
- true if diagram is vertical, false otherwise.
-
removeBreaks
Removes all break points if they are covered by client or client bounds.- Parameters:
points- points
-
swapEnds
public void swapEnds()Swaps ends of the link -
setClient
Sets client for this link. Changes parent object to the parent of client. Client's parent will always contain incoming links.- Parameters:
shape- shape to check
-
moveLinkToClientParent
public void moveLinkToClientParent(boolean simpleAdd) -
internalSnapToGrid
protected void internalSnapToGrid(float step) - Overrides:
internalSnapToGridin classPresentationElement
-
isSnapToGrid
protected boolean isSnapToGrid()- Overrides:
isSnapToGridin classPresentationElement
-
canChangeSupplier
public boolean canChangeSupplier()- Returns:
- true, if view can change supplier.
-
canChangeClient
public boolean canChangeClient()- Returns:
- true, if view can change client
-
canClearBreakPoints
public boolean canClearBreakPoints()- Returns:
- true if link can be modified (all break points can be removed):
-
canChangeLineStyle
public boolean canChangeLineStyle()- Returns:
- true if this link can change line style.
-
internalApplyProperties
public void internalApplyProperties(com.dassault_systemes.modeler.magic.diagram.styledelegates.PresentationElementStyleChanger changer) Applies properties- Overrides:
internalApplyPropertiesin classPresentationElement- Parameters:
changer- new properties
-
draw
public void draw(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) abstract method for drawing ViewObject object used to draw object on graphics- Overrides:
drawin classPresentationElement- Parameters:
context- Graphics on which object should be drawn
-
getIntersection
- Overrides:
getIntersectionin classPresentationElement
-
useOtherExistingElement
@CheckForNull public com.nomagic.utils.Pair<com.dassault_systemes.modeler.foundation.model.ModelElement,Consumer<com.dassault_systemes.modeler.foundation.model.ModelElement>> useOtherExistingElement()Finds and returns other model element which is semantically equivalent to this path model element. Found element can be modified. This method is invoked during new PathElement creation and purpose of it is to reuse existing model elements instead of creating new ones.- Returns:
- element
-
getBezierPath
Calculates path for bezier curve drawing.- Returns:
- bezier path
-
isBezier
public boolean isBezier()- Returns:
- true if LINK_LINE_STYLE property value equals to BEZIER.
-
isLinkLineStyleDefined
public boolean isLinkLineStyleDefined() -
getLinkLineStyle
- Returns:
- LINK_LINE_STYLE property value
-
sSetLinkLineStyle
Change value of LINK_LINE_STYLE property.- Parameters:
style- the line style.
-
setLinkLineStyle
sets LINK_LINE_STYLE property value.- Parameters:
style- the line style.
-
internalSilentApply
public void internalSilentApply()Description copied from class:PresentationElementSilently applies all properties after initialization- Overrides:
internalSilentApplyin classPresentationElement
-
handleRemoveBreaksAction
public com.dassault_systemes.modeler.foundation.editing.Command handleRemoveBreaksAction() -
nextStyle
- Returns:
- link style for TOGGLE LINK STYLE command.
-
getBezierPath
Calculates path from breakpoints for bezier curve drawing.- Parameters:
points- points- Returns:
- path
-
prepareForLineDrawing
Prepares graphics for line drawing. Calls super prepareForLineDrawing and sets stroke.- Parameters:
g- graphicsline- true if for line, false if for adornments also- Returns:
- stroke
-
applyStrokeForLineDrawing
public static void applyStrokeForLineDrawing(PresentationElement pathElement, Graphics2D g, boolean line, BasicStroke stroke) -
internalGetPresentationElementStroke
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).
-
internalGetPresentationElementStroke
-
getBoundsToRepaint
Description copied from class:PresentationElementReturn bounds of the symbol that must be repainted. throws NoRectangleDefinedException- Overrides:
getBoundsToRepaintin classPresentationElement- Returns:
- rectangle of bounds
- Throws:
NoRectangleDefinedException
-
createFillStrategy
public com.nomagic.magicdraw.uml.symbols.FillStrategy createFillStrategy()- Overrides:
createFillStrategyin classPresentationElement
-
internalGetPresentationElementStroke
Description copied from class:PresentationElementReturn a stroke used to paint symbol's main part- Overrides:
internalGetPresentationElementStrokein classPresentationElement- Parameters:
width- a custom stroke width. Other stroke parameters will be specific to symbol- Returns:
- a stroke used to paint symbol's main part
-
paintSelf
public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) - Specified by:
paintSelfin classPresentationElement
-
getPathPainter
-
setPathPainter
protected final void setPathPainter(com.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter pathPainter) -
getSupplierConnectionType
public int getSupplierConnectionType() -
getClientConnectionType
public int getClientConnectionType() -
getDefaultParentForData
Presentation element could suggest parent, which would be more acceptable, than adding to the client If returning null, general mechanism will work- Returns:
- parent for data
-
hasClientPoint
protected boolean hasClientPoint()Check if client point is already not null- Returns:
- true if client point is set
-
hasSupplierPoint
protected boolean hasSupplierPoint()Check if supplier point is already not null- Returns:
- true if supplier point is set
-
isRounded
public boolean isRounded()Returns value of the "Is Rounded" path symbol property.- Returns:
- value of the "Is Rounded" property.
-
setRounded
public void setRounded(boolean rounded) Sets value of the "Is Rounded" path symbol property.- Parameters:
rounded- - value of the "Is Rounded" property.
-
sSetRounded
public void sSetRounded(boolean rounded) Sets value of the "Is Rounded" path symbol property.- Parameters:
rounded- - value of the "Is Rounded" property.
-
isUseFlowLayoutLogic
public boolean isUseFlowLayoutLogic()Indicates if smart path/shape edit should be used in this diagram.- Returns:
- true if smart symbol editing should be used, false otherwise.
-
isSmartLayoutNeeded
public boolean isSmartLayoutNeeded()Returns smart layout needed flag.- Returns:
- value of smart layout needed flag.
-
setSmartLayoutNeeded
public void setSmartLayoutNeeded(boolean smartLayoutNeeded) Sets smart layout needed flag.- Parameters:
smartLayoutNeeded- - smart layout needed flag value.
-
resetCache
protected void resetCache() -
cacheValues
-
cacheActualDrawPoints
-
getCachedActualClientDrawPoint
-
getCachedActualSupplierDrawPoint
-
resizeParent
public void resizeParent()Do nothing, because path does not affect parent size- Overrides:
resizeParentin classPresentationElement
-
getCustomSupplierPoint
-
setCustomSupplierPoint
-
getCustomClientPoint
-
setCustomClientPoint
-
preDisposeOnUpdate
protected boolean preDisposeOnUpdate()Description copied from class:PresentationElementValidate 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.
- Overrides:
preDisposeOnUpdatein classPresentationElement- Returns:
- true if symbol must be disposed
-
createSmartListenerConfig
- Overrides:
createSmartListenerConfigin classPathConnector
-
internalMovedAsToSelf
public void internalMovedAsToSelf(int dx, int dy) This is an internal method to notify a path that it was moved by connecting shape as the path "to self"- Parameters:
dx- delta xdy- delta y
-
sSetParent
Description copied from class:PresentationElementSets parent for this view. For adding symbols to other symbols usePresentationElement.addPresentationElement(PresentationElement)orPresentationElement.sAddPresentationElement(PresentationElement)}- Overrides:
sSetParentin classPresentationElement- Parameters:
parent- parent view
-
hasManipulator
public boolean hasManipulator()Description copied from class:PresentationElementReturns true, if view has manipulator (is selectable)- Overrides:
hasManipulatorin classPresentationElement
-
getSuspendShapeAutoResizeMode
- Specified by:
getSuspendShapeAutoResizeModein interfacecom.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
-
sSetSuspendShapeAutoResizeMode
-
setSuspendShapeAutoResizeMode
-
findOwnerForElement
@CheckForNull public final com.dassault_systemes.modeler.foundation.model.ModelElement findOwnerForElement(PresentationElement newParent, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext) - Overrides:
findOwnerForElementin classPresentationElement
-
findOwnerForElement
@CheckForNull public com.dassault_systemes.modeler.foundation.model.ModelElement findOwnerForElement(PresentationElement newParent, PresentationElement client, PresentationElement supplier, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext) -
connectModelElement
public void connectModelElement(com.nomagic.magicdraw.uml.symbols.paths.ConnectModelElementParticipant participant) ConnectsModelElementof this path to related elements of a given client and supplier- Parameters:
participant- participant of this operation
-