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 String
Bezier path line style.All possible path line styles.static final String
Polyline path line style.static final String
Path line style with rectilinear (90 degrees) breakpoint corners.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, peStyle, SHADOW_WIDTH, SOLID_STROKE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method accepts a visitor, and calls method "visit<class name>(this)" of a visitor.boolean
Method to add sub link to this link.void
addLineJumps
(GeneralPath path, Point segmentStartPoint, Point startPoint, Point endPoint) Adds line jumps to the specified path.static void
applyStrokeForLineDrawing
(PresentationElement pathElement, Graphics2D g, boolean line, BasicStroke stroke) boolean
Return true, because while deleting link view user must be prompt about deleting datavoid
atInsert()
Inserts ends of link into shapes.final void
breakPointsChanged
(List<Point> oldPoints, List<Point> newPoints) Moves all connection point for the links that are attached to this link middle point.protected void
cacheActualDrawPoints
(Point supplierDrawPoint, Point clientDrawPoint, List<Point> breakPoints) protected void
cacheValues
(Point cachedActualSupplierDrawPoint, Point cachedActualClientDrawPoint, Point cacheSupplierDrawPoint, Point cacheClientDrawPoint, List<Point> cacheBreakPoints) calculatePathBounds
(Point supplier, Point client, List<Point> breaks) boolean
boolean
boolean
boolean
void
Clears a client translated flag.void
Clears all registered LineJumpInfos.void
Clears a supplier translated flag.clone()
void
connectModelElement
(com.nomagic.magicdraw.uml.symbols.paths.ConnectModelElementParticipant participant) ConnectsModelElement
of this path to related elements of a given client and supplierboolean
coversPoint
(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Checks if object covers provided pointcom.nomagic.magicdraw.uml.symbols.FillStrategy
protected void
createSmartListenerConfig
(List<SmartListenerConfig> configurations) void
dispose()
Disconnect this link from shapes.void
draw
(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) abstract method for drawing ViewObject object used to draw object on graphicsvoid
Draws link from given point pt1 through break points to given point pt2.com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon
com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon
dynamicPathIcon
(com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon pathIcon) final com.dassault_systemes.modeler.foundation.model.ModelElement
findOwnerForElement
(PresentationElement newParent, com.dassault_systemes.modeler.foundation.model.ModelElementOwnershipContext ownershipContext) com.dassault_systemes.modeler.foundation.model.ModelElement
findOwnerForElement
(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 Rectangle
Calculates bounds of this link.Return bounds of the symbol that must be repainted.getBreakPoint
(int pos) Returns break point with given index.int
returns size of break point vectorReturns break points of the path.Returns client of the path.int
Returns point where path drawing should startfinal Point
Returns point where path connects client end's element.static com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon
getCustomStereotypeIcon
(Element element) Presentation element could suggest parent, which would be more acceptable, than adding to the client If returning null, general mechanism will workfinal int
getIndexOfCoveredPath
(int x, int y) This method is used to get segment of path with witch given point has intersection.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.getIntersection
(int x, int y, PathElement path) double
getLineJumpStartAngle
(Point point) Calculates and returns middle point of link.final Line
getNearestLinkPart
(int x, int y) Returns the nearest link part to specified point.final Point
getNearestPoint
(Point pt) Returns first break point or client point if arg is supplier point.int
getNewBreakPointIndex
(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 Point
getNextPoint
(Point pt) Returns next point to a given one.final Rectangle
get not copy bounds of object throws NoRectangleDefinedExceptioncom.dassault_systemes.modeler.foundation.diagram.style.PathStylePropertyDelegate
com.dassault_systemes.modeler.foundation.image.pathicon.PathIcon
com.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 Point
Returns previous point to given one.Returns supplier of the path.int
Returns point where path drawing should startfinal Point
Returns point where path connects supplier end's element.com.dassault_systemes.modeler.foundation.editing.Command
protected boolean
Check if client point is already not nullboolean
Returns true, if view has manipulator (is selectable)boolean
Returns true ifModelElement
of this symbol can represented with other symbol.protected boolean
Check if supplier point is already not nullvoid
internalApplyProperties
(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 BasicStroke
internalGetPresentationElementStroke
(boolean line, int lineStyle, int width) internalGetPresentationElementStroke
(int width) Return a stroke used to paint symbol's main partvoid
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"void
Silently applies all properties after initializationprotected void
internalSnapToGrid
(float step) 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 rectangleboolean
intersectsInternal
(int x, int y, int width, int height) Check intersection with given rectangle.boolean
boolean
isBezier()
boolean
isBezierIntersects
(int x, int y, int width, int height) Check if it is bezier path intersection with rectangle.boolean
Shows whether a path is breakable.final boolean
isConnectable
(PresentationElement supplier, PresentationElement client) Checks if this path can connect given two elements.final boolean
isConnectable
(PresentationElement supplier, PresentationElement client, Map<Object, Object> options) Checks if this path can connect given two elements.boolean
Returns true if the path element wants to draw line jumps.boolean
isFixed()
If a path tied to its supplier and client (cannot be reconnected)boolean
boolean
boolean
boolean
Returns value of the "Is Rounded" path symbol property.boolean
Returns smart layout needed flag.protected boolean
boolean
isToSelf()
boolean
Indicates if smart path/shape edit should be used in this diagram.boolean
Indicates if path element is drawn in the diagram which has vertical orientation.void
Makes link rectilinear.void
makeRectilinear
(boolean notify) Makes link rectilinear.void
moveLinkToClientParent
(boolean simpleAdd) protected void
movePathElement
(PathElement link, PathConnector requestor) Moves link.boolean
void
notifyBreakPointsChanged
(List<Point> oldPoints, List<Point> newPoints) Notifies about break point vector changesvoid
notifyRepaintManager
(boolean boundsChanged) Notifies the repaint manager about changes in bounds.protected final void
notifyRepaintManager
(List<Point> oldBreakpoints, List<Point> newBreakpoints) void
Removes loops from paths for example: path | ----------+ | | ------void
paintSelf
(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context) protected boolean
Validate symbol against model and try to fix it before actual symbol update.boolean
prepareForLineDrawing
(Graphics2D g, boolean line) Prepares graphics for line drawing.void
registerLineJumpInfos
(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.void
registerLineJumpStartAngle
(int pathIndex, Point point, double lineJumpStartAngle) Registers start angle for the specified path and specified start point of the path segment.boolean
Removes break points if they do not really break the path (a path looks like without break points but really has them).void
removeBreaks
(List<Point> points) Removes all break points if they are covered by client or client bounds.void
Removes redundant breakpoints from link.void
Removes unnecessary points from break point vector.protected void
void
Do nothing, because path does not affect parent sizefinal void
sAddBreakPoint
(Point pt) Adds new break point.final void
Clear break points list.void
Moves link to new location.void
setBreakable
(boolean value) Sets a breakable flag on/off.final void
setBreakPoints
(List<Point> vct) Sets break point vector.protected void
void
setClient
(PresentationElement shape) Sets client for this link.void
setClientPoint
(Point pt) Sets client point.void
setCustomClientPoint
(Point point) void
setCustomSupplierPoint
(Point point) void
setLineJumpPlace
(com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace) Sets line jump place of the path element.void
setLinkLineStyle
(String style) sets LINK_LINE_STYLE property value.protected final void
setPathPainter
(com.nomagic.magicdraw.uml.symbols.paths.painters.PathPainter pathPainter) void
Sets link rectilinear property value.void
setRounded
(boolean rounded) Sets value of the "Is Rounded" path symbol property.void
setSmartLayoutNeeded
(boolean smartLayoutNeeded) Sets smart layout needed flag.void
setSupplier
(PresentationElement shape) Sets supplier end for link.void
Sets first point.void
void
calls break point vector changed method.void
Moves path to new location.void
sSetBreakable
(boolean value) Sets a breakable flag on/off.final void
sSetBreakPoint
(Point pt, int pos) Sets break point at the given position.final void
sSetBreakPoints
(List<Point> vct) Only sets break point vector.void
sSetClient
(PresentationElement symbol) Sets client for this link.void
sSetClientPoint
(Point pt) Sets client connection Point.void
sSetLinkLineStyle
(String style) Change value of LINK_LINE_STYLE property.void
sSetParent
(PresentationElement parent) Sets parent for this view.void
sSetRounded
(boolean rounded) Sets value of the "Is Rounded" path symbol property.void
sSetSupplier
(PresentationElement symbol) Sets supplier for this link.void
Sets supplier connection point.void
void
swapEnds()
Swaps ends of the linkfinal Point
translateClientPoint
(Rectangle old, Rectangle newR) final Point
translateSupplierPoint
(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, supportsVisibleConnectedPathElementsIfSelfInvisible
Methods 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, useParentStyle
Methods 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, toString
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.nomagic.magicdraw.uml.BaseElement
canAdd, isSelfChangeable
Methods inherited from interface com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
getLineWidth
Methods 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:
getOwnStyleDelegate
in 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:
askDeleteDataConfirmation
in 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:
setBounds
in classPresentationElement
- Parameters:
r
- new location of a path
-
simpleSetBounds
calls break point vector changed method.- Overrides:
simpleSetBounds
in 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:
sSetBounds
in 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:
internalGetBoundsShape
in classPresentationElement
-
setLineJumpPlace
public void setLineJumpPlace(@CheckForNull com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace) Sets line jump place of the path element.
NOTE: OnlyLineJumpManager
can set jump place of the link. SinceLineJumpManager
will reset line jump place on every repaint of a diagram then other invocations of the method will not have an effect.- Specified by:
setLineJumpPlace
in 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.LineJumpDrawer
Registers 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:
registerLineJumpInfos
in 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.LineJumpDrawer
Clears all registered LineJumpInfos.- Specified by:
clearRegisteredLineJumpInfos
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
registerLineJumpStartAngle
Description copied from interface:com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
Registers start angle for the specified path and specified start point of the path segment.- Specified by:
registerLineJumpStartAngle
in 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:
addLineJumps
in 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:
isDrawLineJumps
in 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:
getPaths
in 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:PresentationElement
Notifies the repaint manager about changes in bounds.- Overrides:
notifyRepaintManager
in 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:
movePathElement
in 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:
clone
in interfaceBaseElement
- Overrides:
clone
in classPathConnector
-
coversPoint
public boolean coversPoint(int x, int y, com.nomagic.magicdraw.uml.symbols.IntersectionKind kind) Checks if object covers provided point- Specified by:
coversPoint
in 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:
intersects
in 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:
getMiddlePoint
in 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:
dispose
in interfaceBaseElement
- Overrides:
dispose
in classPathConnector
-
atInsert
public void atInsert()Inserts ends of link into shapes.- Specified by:
atInsert
in interfaceBaseElement
- Overrides:
atInsert
in 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:
addConnectedPathElement
in 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:
getBounds
in classPresentationElement
- Returns:
- bounds of this link.
- See Also:
-
PresentationElementsManager.reshapeShapeElement
-
getNotCopyBounds
Description copied from class:PresentationElement
get not copy bounds of object throws NoRectangleDefinedException- Overrides:
getNotCopyBounds
in classPresentationElement
- Returns:
- rectangle of bounds
-
setCachedPathBounds
-
calculatePathBounds
-
accept
Description copied from interface:MDElement
Method accepts a visitor, and calls method "visit<class name>(this)" of a visitor. See "Visitor" pattern for more details.- Specified by:
accept
in interfaceMDElement
- Overrides:
accept
in 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:
internalSnapToGrid
in classPresentationElement
-
isSnapToGrid
protected boolean isSnapToGrid()- Overrides:
isSnapToGrid
in 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:
internalApplyProperties
in 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:
draw
in classPresentationElement
- Parameters:
context
- Graphics on which object should be drawn
-
getIntersection
- Overrides:
getIntersection
in 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:PresentationElement
Silently applies all properties after initialization- Overrides:
internalSilentApply
in 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:PresentationElement
Return bounds of the symbol that must be repainted. throws NoRectangleDefinedException- Overrides:
getBoundsToRepaint
in classPresentationElement
- Returns:
- rectangle of bounds
- Throws:
NoRectangleDefinedException
-
createFillStrategy
public com.nomagic.magicdraw.uml.symbols.FillStrategy createFillStrategy()- Overrides:
createFillStrategy
in classPresentationElement
-
internalGetPresentationElementStroke
Description copied from class:PresentationElement
Return a stroke used to paint symbol's main part- Overrides:
internalGetPresentationElementStroke
in 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:
paintSelf
in 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:
resizeParent
in classPresentationElement
-
getCustomSupplierPoint
-
setCustomSupplierPoint
-
getCustomClientPoint
-
setCustomClientPoint
-
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.
- Overrides:
preDisposeOnUpdate
in classPresentationElement
- Returns:
- true if symbol must be disposed
-
createSmartListenerConfig
- Overrides:
createSmartListenerConfig
in 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:PresentationElement
Sets parent for this view. For adding symbols to other symbols usePresentationElement.addPresentationElement(PresentationElement)
orPresentationElement.sAddPresentationElement(PresentationElement)
}- Overrides:
sSetParent
in classPresentationElement
- Parameters:
parent
- parent view
-
hasManipulator
public boolean hasManipulator()Description copied from class:PresentationElement
Returns true, if view has manipulator (is selectable)- Overrides:
hasManipulator
in classPresentationElement
-
getSuspendShapeAutoResizeMode
- Specified by:
getSuspendShapeAutoResizeMode
in 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:
findOwnerForElement
in 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) ConnectsModelElement
of this path to related elements of a given client and supplier- Parameters:
participant
- participant of this operation
-