Class PathConnector
- 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
-
- All Implemented Interfaces:
BaseElement
,MDElement
,ModelElementProvider
,NameOwner
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
- Direct Known Subclasses:
PathElement
,ShapeElement
@OpenApi public abstract class PathConnector extends PresentationElement
This class is base class for presentation elements connectible by some path element. This means that instance of this class can have incoming or outgoing path elements.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
com.nomagic.magicdraw.uml.symbols.PresentationElement.SmartListenerConfigData, com.nomagic.magicdraw.uml.symbols.PresentationElement.StructureCache
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PathElement>
connectedPaths
List of connected path elements.protected java.lang.Boolean
showsProxy
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DEFAULT_LINE_WIDTH, DOTTED_STROKE, HANDLE_SIZE, MAX_LINE_WIDTH, MIN_LINE_WIDTH, SHADOW_WIDTH, SOLID_STROKE
-
-
Constructor Summary
Constructors Constructor Description PathConnector()
PathConnector(PresentationElement v)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
Method accepts visitor, and calls method visit<class name>(this) of visitor .boolean
addConnectedPathElement(PathElement element)
Adds new path element, and recalculates its position.protected boolean
checkShowsProxy()
void
clearShowsProxy()
PathConnector
clone()
Returns a copy of theElement
.protected void
createSmartListenerConfig(java.util.List<SmartListenerConfig> configurations)
void
dispose()
disposes ends of links when link is deletedprotected void
disposeConnectedPaths()
PresentationElement
findSymbolForEnd(Element element, java.lang.Class<? extends PresentationElement> preferredEndType, boolean asClient)
Find symbol for Path end (client or supplier)protected PresentationElement
findSymbolForEnd(java.util.stream.Stream<PresentationElement> elements, boolean asClient)
PathElement
getConnectedPathElement(Element element)
Return connected path with given elementint
getConnectedPathElementCount()
Returns number of connected path elements.java.util.List<PathElement>
getConnectedPathElements()
Returns connected path elements.java.util.List<PathElement>
getConnectedPathElements(boolean incoming)
Returns connected path elements by direction.java.util.List<PathElement>
getConnectedPathElements(boolean incoming, boolean excludeToSelf)
Returns connected path elements by direction with an option to exclude paths to selfint
getPreferredArrowLength()
boolean
isShowsProxy()
void
movePathElement(PathElement path, boolean notify)
Calculates position of path element.protected abstract void
movePathElement(PathElement element, PathConnector requestor)
Calculates position of path element.void
movePathElements()
boolean
removeConnectedPathElement(PathElement link)
Removes path element.boolean
sAddConnectedPathElement(PathElement element)
Adds new path element.protected java.util.List<PathElement>
selectPathsForMoving(java.util.List<PresentationElement> subPresentationElements)
Select paths to move with current symbol from deep structure.void
setParent(PresentationElement parent)
Sets parent for this view.void
setVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
Sets element visibility flag.boolean
sRemoveConnectedPathElement(PathElement element)
Removes path element.void
sSetConnectedPathElements(java.util.List<PathElement> paths)
Sets new path elements.void
sSetVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
Sets element visibility flag.-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addPresentationElement, addPresentationElementWithoutResize, addProperty, adjustBoundsForMoving, adjustChildBounds, adjustChildBoundsForMoving, alwaysShowTooltip, applyProperties, askDeleteDataConfirmation, atInsert, atInsertChildren, autosizeAndResizeManipulatedParent, autosizeAndResizeParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddChild, canAddInstance, canAddInstance, canBeDisposedOnUpdate, canChangeElementParent, canChangeParent, canChangeParent, canFill, canHavePaths, changeProperties, changeProperty, changePropertyManager, checkElementParentOnAdd, checkProxyVisibility, childrenForMoving, clearAntialiasingState, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, constructChangePropertyCommand, coversPoint, createPropertyChangeListener, createPropertyManager, disposeChildren, disposeListener, draw, drawBackground, drawSymbol, drawSymbolBackground, dynamicFillColor, dynamicLineColor, dynamicLineWidth, dynamicLineWidth, dynamicPaintShadow, dynamicStroke, dynamicStroke, dynamicStroke, dynamicStyleFillColor, dynamicStyleFillPaint, dynamicStyleLineColor, dynamicStyleTextColor, dynamicStyleTransparency, dynamicStyleTransparency, dynamicStyleValue, dynamicTextAlignment, dynamicTextColor, editName, editName, findParentForData, findPresentationElement, firePropertyChange, generateID, getActualElement, getActualProperty, getAdditionalRenderersToNotify, getAssignableModelElementsClasses, getBooleanPropertyValue, getBounds, getBoundsShape, getBoundsToRepaint, getBoundsWithChildrenOnEdge, getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getChildPresentationElementForContextMenu, getChildrenWithSymbolProperties, getConfiguration, getDiagramPresentationElement, getDiagramSurface, getDrawComparator, getDynamicConfigurations, getDynamicStyleOwner, getElement, getElementNumberDisplayMode, getElementsForLinkConnecting, getElementToConnectLink, getElementToMove, getExpectedDataParent, getFillColor, getFont, getFontHeight, getFontRenderContext, getHumanName, getHumanType, getIntersection, getLineColor, getLineWidth, getManipulatedElementAt, getManipulatedElementAt, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getManipulationPreferredDimension, getMiddlePoint, getMiddlePoint, getMiddlePointX, getMiddlePointX, getMiddlePointY, getMiddlePointY, getMinimumDimension, getNotCopyBounds, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolPropertyOwner, getPreferredBounds, getPreferredDimension, getPreferredDimensionForAutosize, getPreferredSize, getPresentationElementAt, getPresentationElementAt, getPresentationElementAt, getPresentationElementCount, getPresentationElementIndex, getPresentationElements, getPresentationElementsAt, getPresentationElementsAt, getPresentationElementStroke, getPresentationElementStroke, getProjectImpl, getProperty, getPropertyManager, getPropertyManagerName, getRealPropertyManager, getRenderer, getSelected, getStereotypeColor, getStereotypeFont, getStringPropertyValue, getStroke, getStroke, getStroke, getStroke, getStroke, getStroke, getSymbolRenderer, getTextColor, getTolerance, getVisibility, getVisiblePresentationElements, handleModelDelete, hasDiagramSurface, hasManipulatedPresentationElements, hasManipulator, hasSharedData, initialize, initializeAndAutosize, internalApplyProperties, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetBoundsShape, internalGetElementsForLinkConnecting, internalGetElementToConnectLink, internalGetPresentationElementStroke, internalSilentApply, internalSnapToGrid, internalSnapToGrid, internalUpdatePresentationElement, intersects, invalidate, isCanChildrenChangeEdge, isChildVisible, isContentHidden, isCreateElementListener, isDetectable, isDisposed, isLayouting, isMovableByMoveManager, isNotNull, isParentOf, isParentOf, isPreserveProportionsWhenGrowing, isSelected, isShowElementTypeAsLabel, isSnapToGrid, isSortable, isTestUpdateFlag, isTextEditable, isUseFillColor, isUseFillColorByProperty, isUseGradientForFill, isVisible, isVisibleInDiagram, isVisibleOrShrunken, movePathElementsRecursively, mustShowContextMenu, notifyCreated, notifyDiagramFrameSizeChange, notifyRepaintManager, onFind, onFind, onFontChange, paintAdornments, paintAdornmentsBackground, paintChildren, paintChildrenAndAdornments, paintChildrenBackground, paintSelf, paintSelfBackground, preDisposeOnUpdate, prepareForFillDrawing, prepareForLineDrawing, prepareForShadowDrawing, prepareForTextDrawing, propertyChange, recreateListeners, recursiveAutosize, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, removePresentationElement, resizeParent, sAddPresentationElement, sAddPresentationElement, selectChildrenForMoving, selectObjectsForMoving, setAllSelected, setBounds, setBounds, setCreateElementListener, setDiagramSurface, setDummyResizeMode, setElement, setFillColor, setFont, setFontProperty, setLayouting, setLineColor, setLineWidth, setLoadedVisibility, setLocation, setLocation, setNeedRecreateListeners, setPresentationElements, setPropertyManager, setPropertyManagerName, setSelected, setSelected, setSize, setSize, setSize, setStereotypeColor, setStereotypeFont, setStrokeIfNotTheSame, setTestUpdateFlag, setTextColor, setTextColorProperty, setTextEditable, setUseFillColor, setVisible, silentApply, silentApply, simpleSetBounds, simpleSetBounds, snapToGrid, snapToGrid, snapViewToGrid, sortObjectsByX, sortObjectsByY, sRemovePresentationElement, sSetBounds, sSetBounds, sSetElement, sSetLineWidth, sSetLocation, sSetLocation, sSetParent, sSetParentForAll, sSetPresentationElements, sSetSize, sSetSize, sSetSize, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, updateLater, updateModelByView, updateModelByViewInternal, updateViewAfterPropertyChange, useParentProperties
-
Methods inherited from class com.nomagic.magicdraw.uml.MDElementImpl
accept, addPropertyChangeListener, canAdd, canAdd, canAddChild, canBeDeleted, canDeleteChild, compareTo, createSortKeys, getClassType, getCommandForAppending, getID, getName, getProject, getProjectProvider, getResourceID, getSortKeys, hasListeners, isEditable, removeAllChildren, removeAllParents, removeAllPropertyChangeListeners, removePropertyChangeListener, setID, setProjectProvider, sGetID, toString
-
-
-
-
Field Detail
-
connectedPaths
@CheckForNull private java.util.List<PathElement> connectedPaths
List of connected path elements.
-
showsProxy
@CheckForNull protected java.lang.Boolean showsProxy
-
-
Constructor Detail
-
PathConnector
public PathConnector()
-
PathConnector
public PathConnector(@CheckForNull PresentationElement v)
-
-
Method Detail
-
clone
public PathConnector clone()
Description copied from class:ElementImpl
Returns a copy of theElement
.- Specified by:
clone
in interfaceBaseElement
- Returns:
- the cloned object
-
getConnectedPathElements
@OpenApi public final java.util.List<PathElement> getConnectedPathElements()
Returns connected path elements. If element has no path elements returns empty list.- Returns:
- connected path elements. Collection is unmodifiable.
-
getConnectedPathElements
@OpenApi public java.util.List<PathElement> getConnectedPathElements(boolean incoming)
Returns connected path elements by direction.- Parameters:
incoming
- true if incoming paths should be selected, false if outgoing.- Returns:
- connected path elements.
-
getConnectedPathElements
@OpenApi public java.util.List<PathElement> getConnectedPathElements(boolean incoming, boolean excludeToSelf)
Returns connected path elements by direction with an option to exclude paths to self- Parameters:
incoming
- true if incoming paths should be selected, false if outgoing.excludeToSelf
- true if paths with source equal to target should not be added to the list, false to include them- Returns:
- connected path elements.
-
getConnectedPathElementCount
@OpenApi public final int getConnectedPathElementCount()
Returns number of connected path elements.- Returns:
- number of connected path elements.
-
sSetConnectedPathElements
public void sSetConnectedPathElements(java.util.List<PathElement> paths)
Sets new path elements.- Parameters:
paths
- list of path elements.
-
addConnectedPathElement
public boolean addConnectedPathElement(PathElement element)
Adds new path element, and recalculates its position.- Parameters:
element
- element to be added.- Returns:
- true if element was added
-
sAddConnectedPathElement
public boolean sAddConnectedPathElement(PathElement element)
Adds new path element.- Parameters:
element
- element to be added.- Returns:
- true if element was added
-
sRemoveConnectedPathElement
public boolean sRemoveConnectedPathElement(PathElement element)
Removes path element.- Parameters:
element
- element to remove.- Returns:
- true if element was removed
-
removeConnectedPathElement
public boolean removeConnectedPathElement(PathElement link)
Removes path element.- Parameters:
link
- element to remove.- Returns:
- true if element was removed
-
movePathElements
public void movePathElements()
-
movePathElement
protected abstract void movePathElement(PathElement element, @CheckForNull PathConnector requestor)
Calculates position of path element.- Parameters:
element
- element which position will be calculated.requestor
- the requestor of this path moving. Implementations may check in order to avoid endless loops.
-
movePathElement
public final void movePathElement(PathElement path, boolean notify)
Calculates position of path element.- Parameters:
path
- path element to calculate.notify
- true if both ends of path element should be calculated.
-
dispose
public void dispose()
Description copied from class:PresentationElement
disposes ends of links when link is deleted- Specified by:
dispose
in interfaceBaseElement
-
disposeConnectedPaths
protected void disposeConnectedPaths()
-
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.
-
sSetVisibility
public void sSetVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
Description copied from class:PresentationElement
Sets element visibility flag.- Parameters:
visibility
- flag value
-
setVisibility
public void setVisibility(com.nomagic.magicdraw.uml.symbols.PresentationElementVisibility visibility)
Description copied from class:PresentationElement
Sets element visibility flag.- Parameters:
visibility
- flag value
-
setParent
public void setParent(PresentationElement parent)
Description copied from class:PresentationElement
Sets parent for this view. For adding symbols to other symbols usePresentationElement.addPresentationElement(PresentationElement)
orPresentationElement.sAddPresentationElement(PresentationElement)
}- Parameters:
parent
- parent view
-
getPreferredArrowLength
public int getPreferredArrowLength()
-
selectPathsForMoving
protected java.util.List<PathElement> selectPathsForMoving(java.util.List<PresentationElement> subPresentationElements)
Description copied from class:PresentationElement
Select paths to move with current symbol from deep structure. Some paths can be connected to current symbol, but owned in some deep child of this symbol.- Parameters:
subPresentationElements
- sub children of this symbol- Returns:
- paths to move together with current symbol
-
getConnectedPathElement
@CheckForNull public PathElement getConnectedPathElement(Element element)
Return connected path with given element- Parameters:
element
- element- Returns:
- connected path element of given element.
-
checkShowsProxy
protected boolean checkShowsProxy()
-
isShowsProxy
public final boolean isShowsProxy()
-
clearShowsProxy
public void clearShowsProxy()
-
findSymbolForEnd
@CheckForNull public PresentationElement findSymbolForEnd(Element element, java.lang.Class<? extends PresentationElement> preferredEndType, boolean asClient)
Find symbol for Path end (client or supplier)- Parameters:
element
- path end elementpreferredEndType
- preferred end typeasClient
- search for client element if true- Returns:
- found symbol or null
-
findSymbolForEnd
@CheckForNull protected PresentationElement findSymbolForEnd(java.util.stream.Stream<PresentationElement> elements, boolean asClient)
-
createSmartListenerConfig
protected void createSmartListenerConfig(java.util.List<SmartListenerConfig> configurations)
-
-