Class PathElement
- java.lang.Object
-
- com.nomagic.magicdraw.uml.MDElementImpl
-
- com.nomagic.magicdraw.uml.ElementImpl
-
- com.nomagic.magicdraw.uml.symbols.PresentationElement
-
- com.nomagic.magicdraw.uml.symbols.paths.PathConnector
-
- com.nomagic.magicdraw.uml.symbols.paths.PathElement
-
- All Implemented Interfaces:
BaseElement
,MDElement
,ModelElementProvider
,com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
,com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
,NameOwner
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
- Direct Known Subclasses:
com.nomagic.magicdraw.uml.symbols.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 paths. Path is representation element which connects two other elements.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BEZIER
Bezier path line style.static java.util.List<java.lang.String>
LINE_STYLE
All possible path line styles.static java.lang.String
OBLIQUE
Polyline path line style.static java.lang.String
RECTILINEAR
Path line style with rectilinear (90 degrees) breakpoint corners.-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DOTTED_STROKE, SOLID_STROKE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
Method accepts visitor, and calls method visit<class name>(this) of visitor .java.util.List<java.awt.Point>
getAllBreakPoints()
Returns breaks points list with added supplier and client end point in the list as well.java.util.List<java.awt.Point>
getBreakPoints()
Returns break points of the path.PresentationElement
getClient()
Returns client of the path.java.awt.Point
getClientPoint()
Returns point where path connects client end's element.java.awt.Point
getPointOnPath(java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.Point> breakpoints, double coefficient)
PresentationElement
getSupplier()
Returns supplier of the path.java.awt.Point
getSupplierPoint()
Returns point where path connects supplier end's element.boolean
isConnectable(PresentationElement supplier, PresentationElement client)
Checks if this path can connect given two elements.-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
getConnectedPathElementCount, getConnectedPathElements, getConnectedPathElements, getConnectedPathElements
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addProperty, collectSubManipulatedElements, editName, editName, getBoundsShape, getDiagramPresentationElement, getDiagramSurface, getElement, getManipulatedParent, getManipulatedPresentationElements, getObjectParent, getParent, getPreferredDimension, getPreferredSize, getPresentationElements, getPresentationElementStroke, getPresentationElementStroke, getProperty, getPropertyManager, getSelected, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, hasManipulatedPresentationElements, isSelected, onFind, onFind, setAllSelected, setSelected, setSelected, useParentProperties
-
Methods inherited from class com.nomagic.magicdraw.uml.MDElementImpl
accept, addPropertyChangeListener, canAdd, canAdd, canAddChild, canBeDeleted, canDeleteChild, compareTo, createSortKeys, getClassType, getCommandForAppending, getID, getName, getProject, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setProjectProvider, sGetID, toString
-
-
-
-
Field Detail
-
RECTILINEAR
@OpenApi public static final java.lang.String RECTILINEAR
Path line style with rectilinear (90 degrees) breakpoint corners.- See Also:
- Constant Field Values
-
OBLIQUE
@OpenApi public static final java.lang.String OBLIQUE
Polyline path line style.- See Also:
- Constant Field Values
-
BEZIER
@OpenApi public static final java.lang.String BEZIER
Bezier path line style.- See Also:
- Constant Field Values
-
LINE_STYLE
@OpenApi public static final java.util.List<java.lang.String> LINE_STYLE
All possible path line styles.
-
-
Method Detail
-
getBreakPoints
@OpenApi public final java.util.List<java.awt.Point> 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. List is unmodifiable.
- See Also:
PresentationElementsManager.changePathBreakPoints(com.nomagic.magicdraw.uml.symbols.paths.PathElement, java.util.List)
-
getAllBreakPoints
@OpenApi public final java.util.List<java.awt.Point> getAllBreakPoints()
Returns breaks 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. List is modifiable.
- See Also:
PresentationElementsManager.changePathBreakPoints(com.nomagic.magicdraw.uml.symbols.paths.PathElement, java.util.List)
-
getSupplierPoint
@OpenApi public final java.awt.Point 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
@OpenApi public final java.awt.Point 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.
-
getClient
@OpenApi public PresentationElement getClient()
Returns client of the path.- Returns:
- client element.
-
getSupplier
@OpenApi public PresentationElement getSupplier()
Returns supplier of the path.- Returns:
- supplier end element.
-
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.
-
getPointOnPath
@OpenApi public java.awt.Point getPointOnPath(java.awt.Point supplierPoint, java.awt.Point clientPoint, java.util.List<java.awt.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 paths length. Provide 0.5 for middle point.- Returns:
- point on path
-
accept
@OpenApi public void accept(Visitor visitor) throws java.lang.Exception
Description copied from interface:MDElement
Method accepts visitor, and calls method visit<class name>(this) of visitor . See Visitor pattern for more details.- Specified by:
accept
in interfaceMDElement
- Overrides:
accept
in classPathConnector
- Parameters:
visitor
- which visits this element.- Throws:
java.lang.Exception
-
-