Class TreeView
- 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.shapes.ShapeElement
-
- com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
- com.nomagic.magicdraw.uml.symbols.shapes.TreeView
-
- All Implemented Interfaces:
BaseElement
,MDElement
,ModelElementProvider
,com.nomagic.magicdraw.uml.symbols.filter.FilteredSymbols.FilteredSymbolsChangeListener
,com.nomagic.magicdraw.uml.symbols.LabelOwner
,com.nomagic.magicdraw.uml.symbols.LineJumpDrawer
,com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
,com.nomagic.magicdraw.uml.symbols.SuspendShapeAutoResizeModeProvider
,NameOwner
,java.beans.PropertyChangeListener
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
@OpenApi public class TreeView extends com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView implements com.nomagic.magicdraw.uml.symbols.LabelOwner, com.nomagic.magicdraw.uml.symbols.LineJumpDrawer, com.nomagic.magicdraw.uml.symbols.filter.FilteredSymbols.FilteredSymbolsChangeListener
This class represents tree header (part of generalization tree symbol).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeBounds
Class for tree bounds - has additional tree stuff.static class
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeData
private static class
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeLabelLayouter
private static class
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeLabelOrientationChooser
private static class
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeViewLabelHandler
Prevents layout methods calling themselves.-
Nested classes/interfaces inherited from class com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement
com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement.OnEdgeBounds
-
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 static int
arrowToDashDistance
Minimal distance between connect link arrow(anchor) and horizontal bar of the tree.private ShapeElement
baseClass
Base class of treeprivate int
horizontalBarLeft
x coordinates of the tree view horizontal bar edgesprivate int
horizontalBarRight
private int
horizontalBarY
The y coordinate of the tree view horizontal barprivate java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo>
horizontalLineJumps
private double
horizontalLineJumpStartAngle
private boolean
implicitlySetY
Implicitly set y coordinateprivate com.nomagic.magicdraw.uml.symbols.shapes.LabelHandler
labelHandler
private com.nomagic.magicdraw.uml.symbols.LineJumpPlace
lineJumpPlace
private boolean
resetLabels
private boolean
showArrow
private int
verticalBarRelativeX
distance between shape left corner and vertical bar.private int
verticalBarX
The x coordinate of the tree vertical bar to the base classprivate int
verticalBarY
The y coordinate of the tree vertical bar at the base classprivate java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo>
verticalLineJumps
private double
verticalLineJumpStartAngle
static java.lang.String
X_COORD
static java.lang.String
Y_COORD
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
CONTAINER_SHAPE_INSETS
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement
BORDER_ELEMENT_MARGIN_ALL, BORDER_ELEMENT_MARGIN_BOTTOM, BORDER_ELEMENT_MARGIN_LEFT, BORDER_ELEMENT_MARGIN_LEFT_RIGHT, BORDER_ELEMENT_MARGIN_MODES, BORDER_ELEMENT_MARGIN_NONE, BORDER_ELEMENT_MARGIN_RIGHT, BORDER_ELEMENT_MARGIN_TOP, BORDER_ELEMENT_MARGIN_TOP_BOTTOM, BOTTOM_EDGE, INSIDE_EDGE_POSITION, LEFT_EDGE, NEED_AUTOSIZE_FULL, NEED_AUTOSIZE_LAYOUT, NEED_AUTOSIZE_NONE, NO_EDGE, NULL_INSETS, ON_EDGE_POSITION, OUTSIDE_EDGE_POSITION, RIGHT_EDGE, SPACE, SPACE_INSETS, SPACE_INSETS_EMPTY_TOP_BOTTOM, SUSPEND_SHAPE_AUTO_RESIZE_FALSE, SUSPEND_SHAPE_AUTO_RESIZE_MODES, SUSPEND_SHAPE_AUTO_RESIZE_SAME_AS_DIAGRAM, SUSPEND_SHAPE_AUTO_RESIZE_TRUE, TOP_EDGE
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
showsProxy
-
Fields inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
DASHED_STROKE, DEFAULT_LINE_WIDTH, DOTTED_STROKE, HANDLE_SIZE, MAX_LINE_WIDTH, MIN_LINE_WIDTH, SHADOW_WIDTH, SOLID_STROKE
-
-
Constructor Summary
Constructors Constructor Description TreeView()
TreeView(PresentationElement parent)
-
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 .void
addLabel(ShapeElement label)
void
addLineJumps(java.awt.geom.GeneralPath path, java.awt.Point segmentStartPoint, java.awt.Point startPoint, java.awt.Point endPoint)
void
atInsert()
Invalidates object at insertvoid
calculateHorizontalBar()
Calculates the y coordinate of the middle bar for the view according to the positions of the child classes, connected by the tree viewprivate com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeData
calculateMostLeftAndRightHorizontalXPoints(java.util.function.Predicate<PresentationElement> pathElementPredicate)
com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeData
calculateMostLeftAndRightHorizontalXPointsByContext(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
void
calculateVerticalBarX()
If horizontal bar is outside shape moves it to shape.boolean
canAddInstance(PresentationElement o)
Object view has no children.boolean
canBeAutosized()
boolean
canChangeParent(java.util.Collection<? extends PresentationElement> movedTogether, BaseElement newParent, boolean changeElementParent)
Returns true, if element can change parent.void
clearRegisteredLineJumpInfos()
TreeView
clone()
Returns a copy of theElement
.void
constructCommandForUnGroup(com.nomagic.magicdraw.commands.MacroCommand macro)
boolean
coversPoint(int x, int y)
checks if object covers provided pointContainerShape
createBoundsShape(PathElement path, BoundsTransformation transformation)
Creates bounding shape for intersection calculation.void
dispose()
disposes ends of links when link is deletedprivate java.awt.Point
drawDecorations(java.awt.Graphics2D g2, com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)
void
drawHorizontalPart(java.awt.Graphics2D g2, int horizontalBarLeft, int horizontalBarRight)
Paints horizontal part of the tree.void
drawVerticalPart(java.awt.Graphics2D g2, java.awt.Point pt)
Paints vertical part of the tree.void
excludedSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isExcluded)
void
filteredSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isFiltered)
ShapeElement
getBaseClass()
java.awt.Rectangle
getBounds()
Method returns bounds of this element.java.awt.Rectangle
getBoundsToRepaint()
Return bounds of the symbol that must be repainted.com.nomagic.ui.UnmodifiableInsets
getChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector
getFirstTreeConnector()
First connector of the treecom.nomagic.magicdraw.uml.symbols.shapes.GeneralizationSetLabelWrapper
getGeneralizationSetLabelWrapper()
GeneralizationSetView
getGeneralizationSetView()
int
getHorizontalBarLeft()
Returns x coordinate of the tree view horizontal bar left edge.int
getHorizontalBarRight()
Returns x coordinate of the tree view horizontal bar right edge.int
getHorizontalBarY()
Returns y coordinate of the horizontal bar of the tree view.boolean
getImplicitlySetY()
com.nomagic.magicdraw.uml.symbols.shapes.LabelHandler
getLabelHandler()
int
getMiddlePointX()
int
getMiddlePointY()
java.awt.Rectangle
getNotCopyBounds()
get not copy bounds of object throws NoRectangleDefinedExceptionjava.util.List<java.util.List<java.awt.Point>>
getPaths()
private java.awt.Rectangle
getRealBounds()
Because getBounds return just horizontal bar bounds, we need method to calculate real boundsint[]
getRealCoords()
Used for savingjava.util.List<PresentationElement>
getRemovableChildren()
java.awt.BasicStroke
getStroke(boolean line, int width)
This method must be overridden, if you need to use DASHED_STROKE or another one.java.util.List<com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector>
getTreeConnectors()
Returns all connected tree connectors.int
getVerticalBarRelativeX()
int
getVerticalBarX()
Returns x coordinate of the vertical bar to the base class for the tree view.int
getVerticalBarY()
Returns y coordinate of the tree view vertical bar end at the base class.boolean
hasSharedData()
Returns true if data of this object can be shared.void
internalApplyProperties(PropertyManager man)
Applies properties from given property managerElement
internalGetElementToConnectLink(Element path, boolean asClient)
Returns element that should be used for given link connecting.java.awt.BasicStroke
internalGetPresentationElementStroke(int width)
Return a stroke used to paint symbol's main partvoid
internalSilentApply()
Silently applies all properties after initializationprotected void
internalUpdatePresentationElement()
Internal symbol update method for subclassing.boolean
intersects(int x, int y, int width, int height)
checks whether object intersects with given rectangleboolean
isConnectorOfTheSameType(com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)
Returns true if all connected connectors are of the same type as given connectorboolean
isDrawLineJumps()
boolean
isLabelWrapText()
boolean
isNameWrapped()
boolean
isShowGeneralizationSet()
Indicates if generalization set should be displayed.boolean
isTreeOfType(java.lang.Class clazz)
void
movePathElement(PathElement linkView, PathConnector requestor)
Calculates position of path element.void
movePathElements()
void
paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
protected boolean
prepareForLineDrawing(java.awt.Graphics2D g, boolean line)
Prepares graphics for line drawing.void
propertyChange(java.beans.PropertyChangeEvent e)
Listens for property change it can be: data was edited text box was editedprivate void
recalculateHorizontalBar(java.util.Collection<PresentationElement> symbols)
private void
recalculatePoints()
Recalculates points of the tree.void
recalculateTreeBounds()
Recalculates and sets new bounds of the tree according to the position of the horizontal barvoid
registerLineJumpInfos(int pathIndex, java.awt.Point segmentStartPoint, java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps)
void
registerLineJumpStartAngle(int pathIndex, java.awt.Point point, double lineJumpStartAngle)
private void
registerToFilteredSymbols()
boolean
removeConnectedPathElement(PathElement link)
Removes path element.void
removeLabel(ShapeElement label)
void
resetHorizontalBarY()
Explicitly specify that the y coordinate of the tree view horizontal bar is not implicitly defined.void
sCalculateHorizontalBar()
Calculates the y coordinate of the middle bar for the view according to the positions of the child classes, connected by the tree viewvoid
setBaseClass(ShapeElement classView)
Sets base classvoid
setHorizontalBarLeft(int xPosition)
Specify x coordinate of the tree view horizontal bar left edge.void
setHorizontalBarRight(int xPosition)
Specify x coordinate of the tree view horizontal bar right edge.void
setHorizontalBarY(int yPosition)
Implicitly specify the y coordinate of the tree view horizontal bar.void
setHorizontalBarYExplicitly(int yPosition)
Explicitly specify the y coordinate of the tree view horizontal bar.void
setLineJumpPlace(com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)
void
setNameWrapped(boolean wrapped)
void
setResetLabels(boolean resetLabels)
void
setShowArrow(boolean showArrow)
void
setShowGeneralizationSet(boolean show)
Sets show generalization set property value.void
setSuspendLabelAutoDisplayMode(java.lang.String mode)
void
setSuspendShapeAutoResizeMode(java.lang.String mode)
void
setVerticalBarRelativeX(int x)
void
setVerticalBarX(int xPosition)
Explicitly specify the x coordinate of the vertical bar to the base class for the tree view.void
setVerticalBarY(int yPosition)
Specify the y coordinate of the vertical bar end at the base class for the tree view.void
simpleSetBounds(java.awt.Rectangle bnd, boolean moveChildren, boolean calculatePrefSize)
void
sSetBaseClass(ShapeElement classView)
Sets base classvoid
sSetBounds(java.awt.Rectangle r)
Sets bounds of this object view only.void
sSetElement(Element element)
void
sSetHorizontalBarLeft(int xPosition)
void
sSetHorizontalBarRight(int xPosition)
void
sSetHorizontalBarY(int yPosition)
Implicitly specify the y coordinate of the tree view horizontal bar.void
sSetImplicitlySetY(boolean v)
void
sSetNameWrapped(boolean wrapped)
void
sSetShowGeneralizationSet(boolean show)
Simple sets (no updates) show generalization set property value.void
sSetSuspendLabelAutoDisplayMode(java.lang.String mode)
void
sSetVerticalBarX(int pos)
void
sSetVerticalBarY(int yPosition)
private void
updateLinksCoordinates()
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
addPresentationElement, addPresentationElement, addPresentationElementWithoutResize, adjustBoundsForMoving, adjustChildBoundsForMoving, autosize, autosizeByChildren, calculateAutosizeDimension, calculateAutosizeDimension, canAddChild, canMoveChildOutside, checkShowsProxy, childrenBoundsForReshape, clearShowsProxy, constructLayoutHelper, correctChildrenVector, getChildrenBounds, getChildrenOnBorderBounds, getContainerBounds, getLayoutHelper, getLayoutHelperClone, getManipulatedElementAt, getManipulationPreferredDimension, getPresentationElementAt, getPresentationElementIndex, getPresentationElements, getProxyPresentationElementsStream, hasManipulatedChildrenIncludingIndirect, hasManipulatedShapesNotOnEdge, hasManipulatedShapesOnEdge, hasManipulatedShapesOnEdge, internalAddIndirectManipulatedChildrenRect, internalAppendChildRect, internalGetChildAt, internalGetIndirectManipulatedChildrenRect, internalGetManipulatedChildrenRect, internalGetManipulatedChildrenRect, internalGetSelfManipulationPreferredSize, internalLayoutChildren, internalRecursiveAutosizeForChildren, internalSetChildren, isCanChildrenChangeEdge, isCanMoveChildren, isChildMovable, layoutChildren, moveChild, moveChildren, needAdjustToPreferred, paintChildren, paintChildrenBackground, prefDimensionByManipulatedChildren, preferredDimension, recursiveAutosize, removePresentationElement, removePresentationElement, sAddPresentationElement, setBounds, setBounds, setCanMoveChildren, setDummyResizeMode, setFillColor, setLayoutHelper, setPresentationElements, showPathElements, simpleSetBounds, sRemovePresentationElement, sSetPresentationElements
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement
addBreakPoints, adjustBounds, adjustOnEdge, adjustOnEdge, adjustOnEdgeChildren, autosize, autosizeAndResizeParent, calculateAdjustOnEdgeLocation, calculateAndGetMinimumShrinkingDimension, calculateAndGetPreferredDimension, calculateEdge, calculateMinimumDimension, calculateOnEdgeBounds, calculatePreferredDimension, calculatePreferredDimension, canHavePaths, clearOldRect, edgeChanged, ensureDimension, ensurePreferredDimensionIfShrinkable, ensurePreferredDimensionIfShrinkable, findFreePlaceForShapeOnBorder, getBorderElementMargin, getCenterlineableInnerParts, getDefaultDimension, getDimensionForShrinking, getEdgeLine, getFixedConnectionPoints, getHeaderInsetReduce, getInsetsForOnEdgeShapes, getIntersection, getIntersection, getIntersection, getLoadedDimension, getMiddlePoint, getMiddlePoint, getMiddlePointX, getMiddlePointY, getMinimumDimension, getNearestEdge, getNearestEdge, getNeedAutosizeFlag, getOnEdge, getOnEdgeCornerDistance, getOnEdgePosition, getPreferredDimension, getPreferredDimensionForAutosize, getReshapeMode, getSuspendShapeAutoResizeMode, hasManipulator, initialize, internalGetBoundsShape, isAutosized, isCenterlineInner, isChildLayoutable, isHorizontalCenterlineProvider, isOnEdge, isShrinkable, isSnapShapesOnBorderToGrid, isSnapToGrid, isUseFixedConnectionPoints, isVerticalCenterlineProvider, layoutChildren, maximumDimension, minimumDimension, minimumDimensionForShrinking, minimumOrMinimumShrinkableDimension, moveLinksToSelf, needAdjustToMaximumDimension, onChildEdgeChange, prepareForShadowDrawing, providesHorizontalCenterline, providesVerticalCenterline, resetCalculatePreferredRegardingChildren, setAutosize, setBorderElementMargin, setCalculatePreferredRegardingChildren, setLoadedDimension, setMinimumDimension, setNeedAutosizeFlag, setOldRect, setOnEdge, setPreferredDimension, setReshapeMode, setSnapShapesOnBorderToGrid, setUseFixedConnectionPoints, shouldDrawShadow, simpleSetBounds, simpleSetBounds, snapsToCenterlines, sSetAutosize, sSetBorderElementMargin, sSetSuspendShapeAutoResizeMode, sSetVisibility, toString, updateLater
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.paths.PathConnector
addConnectedPathElement, createSmartListenerConfig, disposeConnectedPaths, findSymbolForEnd, findSymbolForEnd, getConnectedPathElement, getConnectedPathElementCount, getConnectedPathElements, getConnectedPathElements, getConnectedPathElements, getPreferredArrowLength, isShowsProxy, movePathElement, sAddConnectedPathElement, selectPathsForMoving, setParent, setVisibility, sRemoveConnectedPathElement, sSetConnectedPathElements
-
Methods inherited from class com.nomagic.magicdraw.uml.symbols.PresentationElement
addPresentationElement, addProperty, adjustChildBounds, alwaysShowTooltip, applyProperties, askDeleteDataConfirmation, atInsertChildren, autosizeAndResizeManipulatedParent, beforeDelete, boundsChanged, boundsChanged, canAddChild, canAddInstance, canBeDisposedOnUpdate, canChangeElementParent, canChangeParent, canFill, changeProperties, changeProperty, changePropertyManager, checkElementParentOnAdd, checkProxyVisibility, childrenForMoving, clearAntialiasingState, collectSubManipulatedElements, collectSubPresentationElements, collectSubPresentationElements, collectSubShowingPresentationElements, constructChangePropertyCommand, 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, getBoundsShape, getBoundsWithChildrenOnEdge, getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getChildPresentationElementForContextMenu, getChildrenWithSymbolProperties, getConfiguration, getDiagramPresentationElement, getDiagramSurface, getDrawComparator, getDynamicConfigurations, getDynamicStyleOwner, getElement, getElementNumberDisplayMode, getElementsForLinkConnecting, getElementToConnectLink, getElementToMove, getExpectedDataParent, getFillColor, getFont, getFontHeight, getFontRenderContext, getHumanName, getHumanType, getLineColor, getLineWidth, getManipulatedElementAt, getManipulatedIntersectionWith, getManipulatedIntersectionWith, getManipulatedParent, getManipulatedPresentationElements, getManipulationBounds, getNotZoomedTolerance, getObjectParent, getParent, getParentSymbolPropertyOwner, getPreferredBounds, getPreferredSize, getPresentationElementAt, getPresentationElementAt, getPresentationElementCount, 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, initializeAndAutosize, internalBeforeUpdate, internalCreatePropertyChangeListener, internalGetElementsForLinkConnecting, internalSnapToGrid, internalSnapToGrid, invalidate, isChildVisible, isContentHidden, isCreateElementListener, isDetectable, isDisposed, isLayouting, isMovableByMoveManager, isNotNull, isParentOf, isParentOf, isPreserveProportionsWhenGrowing, isSelected, isShowElementTypeAsLabel, isSortable, isTestUpdateFlag, isTextEditable, isUseFillColor, isUseFillColorByProperty, isUseGradientForFill, isVisible, isVisibleInDiagram, isVisibleOrShrunken, movePathElementsRecursively, mustShowContextMenu, notifyCreated, notifyDiagramFrameSizeChange, notifyRepaintManager, onFind, onFind, onFontChange, paintAdornments, paintAdornmentsBackground, paintChildrenAndAdornments, paintSelfBackground, preDisposeOnUpdate, prepareForFillDrawing, prepareForLineDrawing, prepareForTextDrawing, recreateListeners, registerInSortManager, rememberBounds, rememberBounds, removeFromSortManager, removeItSelfOnUpdate, resizeParent, sAddPresentationElement, selectChildrenForMoving, selectObjectsForMoving, setAllSelected, setBounds, setCreateElementListener, setDiagramSurface, setElement, setFont, setFontProperty, setLayouting, setLineColor, setLineWidth, setLoadedVisibility, setLocation, setLocation, setNeedRecreateListeners, setPropertyManager, setPropertyManagerName, setSelected, setSelected, setSize, setSize, setSize, setStereotypeColor, setStereotypeFont, setStrokeIfNotTheSame, setTestUpdateFlag, setTextColor, setTextColorProperty, setTextEditable, setUseFillColor, setVisible, silentApply, silentApply, simpleSetBounds, snapToGrid, snapToGrid, snapViewToGrid, sortObjectsByX, sortObjectsByY, sSetBounds, sSetLineWidth, sSetLocation, sSetLocation, sSetParent, sSetParentForAll, sSetSize, sSetSize, sSetSize, sSetVisible, tryToDeleteModelElementUponRemoval, update, updateAfterLoad, updateLabelsIgnoringSuspendableLater, 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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.nomagic.magicdraw.uml.symbols.manipulators.centerlines.CenterlineableShape
getCenterlinePoint, getCenterlinePointX, getCenterlinePointY, getDiagramPresentationElement
-
-
-
-
Field Detail
-
X_COORD
public static final java.lang.String X_COORD
- See Also:
- Constant Field Values
-
Y_COORD
public static final java.lang.String Y_COORD
- See Also:
- Constant Field Values
-
arrowToDashDistance
private static final int arrowToDashDistance
Minimal distance between connect link arrow(anchor) and horizontal bar of the tree.- See Also:
- Constant Field Values
-
baseClass
private ShapeElement baseClass
Base class of tree
-
verticalBarX
private int verticalBarX
The x coordinate of the tree vertical bar to the base class
-
verticalBarRelativeX
private int verticalBarRelativeX
distance between shape left corner and vertical bar.
-
verticalBarY
private int verticalBarY
The y coordinate of the tree vertical bar at the base class
-
horizontalBarY
private int horizontalBarY
The y coordinate of the tree view horizontal bar
-
implicitlySetY
private boolean implicitlySetY
Implicitly set y coordinate
-
horizontalBarLeft
private int horizontalBarLeft
x coordinates of the tree view horizontal bar edges
-
horizontalBarRight
private int horizontalBarRight
-
showArrow
private boolean showArrow
-
labelHandler
private com.nomagic.magicdraw.uml.symbols.shapes.LabelHandler labelHandler
-
resetLabels
private boolean resetLabels
-
lineJumpPlace
@CheckForNull private com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace
-
verticalLineJumps
@CheckForNull private java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> verticalLineJumps
-
horizontalLineJumps
@CheckForNull private java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> horizontalLineJumps
-
verticalLineJumpStartAngle
private double verticalLineJumpStartAngle
-
horizontalLineJumpStartAngle
private double horizontalLineJumpStartAngle
-
-
Constructor Detail
-
TreeView
public TreeView()
-
TreeView
public TreeView(@CheckForNull PresentationElement parent)
-
-
Method Detail
-
getTreeConnectors
public java.util.List<com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector> getTreeConnectors()
Returns all connected tree connectors.
-
hasSharedData
public boolean hasSharedData()
Description copied from class:PresentationElement
Returns true if data of this object can be shared. If data is not shared data can be deleted with del key. Or it must be deleted with CRL+D- Returns:
- true if data of this object can be shared.
-
paintSelf
public void paintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
-
atInsert
public void atInsert()
Description copied from class:PresentationElement
Invalidates object at insert- Specified by:
atInsert
in interfaceBaseElement
-
createBoundsShape
public ContainerShape createBoundsShape(@CheckForNull PathElement path, BoundsTransformation transformation)
Description copied from class:ShapeElement
Creates bounding shape for intersection calculation.- Parameters:
path
- pathtransformation
- transformation- Returns:
- shape
-
setVerticalBarRelativeX
public void setVerticalBarRelativeX(int x)
-
getVerticalBarRelativeX
public int getVerticalBarRelativeX()
-
getRealBounds
private java.awt.Rectangle getRealBounds()
Because getBounds return just horizontal bar bounds, we need method to calculate real bounds
-
setHorizontalBarY
public void setHorizontalBarY(int yPosition)
Implicitly specify the y coordinate of the tree view horizontal bar.- Parameters:
yPosition
- new y coordinate of the tree view horizontal bar
-
movePathElements
public void movePathElements()
-
sSetHorizontalBarY
public void sSetHorizontalBarY(int yPosition)
Implicitly specify the y coordinate of the tree view horizontal bar.- Parameters:
yPosition
- new y coordinate of the tree view horizontal bar
-
setHorizontalBarYExplicitly
public void setHorizontalBarYExplicitly(int yPosition)
Explicitly specify the y coordinate of the tree view horizontal bar.- Parameters:
yPosition
- new y coordinate of the tree view horizontal bar.
-
simpleSetBounds
public void simpleSetBounds(java.awt.Rectangle bnd, boolean moveChildren, boolean calculatePrefSize)
- Overrides:
simpleSetBounds
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
resetHorizontalBarY
public void resetHorizontalBarY()
Explicitly specify that the y coordinate of the tree view horizontal bar is not implicitly defined.
-
getHorizontalBarY
public int getHorizontalBarY()
Returns y coordinate of the horizontal bar of the tree view.
-
setHorizontalBarLeft
public void setHorizontalBarLeft(int xPosition)
Specify x coordinate of the tree view horizontal bar left edge.- Parameters:
xPosition
- new x coordinate of the tree view horizontal bar left edge.
-
sSetHorizontalBarLeft
public void sSetHorizontalBarLeft(int xPosition)
-
getHorizontalBarLeft
public int getHorizontalBarLeft()
Returns x coordinate of the tree view horizontal bar left edge.
-
setHorizontalBarRight
public void setHorizontalBarRight(int xPosition)
Specify x coordinate of the tree view horizontal bar right edge.- Parameters:
xPosition
- new x coordinate of the tree view horizontal bar right edge.
-
sSetHorizontalBarRight
public void sSetHorizontalBarRight(int xPosition)
-
getHorizontalBarRight
public int getHorizontalBarRight()
Returns x coordinate of the tree view horizontal bar right edge.
-
setVerticalBarX
public void setVerticalBarX(int xPosition)
Explicitly specify the x coordinate of the vertical bar to the base class for the tree view.
-
sSetVerticalBarX
public void sSetVerticalBarX(int pos)
-
getVerticalBarX
public int getVerticalBarX()
Returns x coordinate of the vertical bar to the base class for the tree view.
-
setVerticalBarY
public void setVerticalBarY(int yPosition)
Specify the y coordinate of the vertical bar end at the base class for the tree view.
-
sSetVerticalBarY
public void sSetVerticalBarY(int yPosition)
-
getVerticalBarY
public int getVerticalBarY()
Returns y coordinate of the tree view vertical bar end at the base class.
-
calculateHorizontalBar
public void calculateHorizontalBar()
Calculates the y coordinate of the middle bar for the view according to the positions of the child classes, connected by the tree view
-
sCalculateHorizontalBar
public void sCalculateHorizontalBar()
Calculates the y coordinate of the middle bar for the view according to the positions of the child classes, connected by the tree view
-
calculateMostLeftAndRightHorizontalXPointsByContext
public com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeData calculateMostLeftAndRightHorizontalXPointsByContext(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)
-
calculateMostLeftAndRightHorizontalXPoints
private com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeData calculateMostLeftAndRightHorizontalXPoints(java.util.function.Predicate<PresentationElement> pathElementPredicate)
-
clone
public TreeView clone()
Description copied from class:ElementImpl
Returns a copy of theElement
.- Specified by:
clone
in interfaceBaseElement
- Overrides:
clone
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
- Returns:
- the cloned object
-
movePathElement
public void movePathElement(PathElement linkView, @CheckForNull PathConnector requestor)
Description copied from class:PathConnector
Calculates position of path element.- Parameters:
linkView
- element which position will be calculated.requestor
- the requestor of this path moving. Implementations may check in order to avoid endless loops.
-
dispose
public void dispose()
Description copied from class:PresentationElement
disposes ends of links when link is deleted- Specified by:
dispose
in interfaceBaseElement
-
setBaseClass
public void setBaseClass(ShapeElement classView)
Sets base class- Parameters:
classView
- new base class
-
sSetBaseClass
public void sSetBaseClass(@CheckForNull ShapeElement classView)
Sets base class- Parameters:
classView
- new base class
-
calculateVerticalBarX
public void calculateVerticalBarX()
If horizontal bar is outside shape moves it to shape.
-
getBaseClass
public ShapeElement getBaseClass()
-
coversPoint
public boolean coversPoint(int x, int y)
Description copied from class:PresentationElement
checks if object covers provided point- Returns:
- true if object covers this point
-
intersects
public boolean intersects(int x, int y, int width, int height)
Description copied from class:PresentationElement
checks whether object intersects with given rectangle- Returns:
- true if object and rectangle intersects
-
removeConnectedPathElement
public boolean removeConnectedPathElement(PathElement link)
Description copied from class:PathConnector
Removes path element.- Parameters:
link
- element to remove.- Returns:
- true if element was removed
-
updateLinksCoordinates
private void updateLinksCoordinates()
-
accept
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.
-
getImplicitlySetY
public boolean getImplicitlySetY()
-
sSetImplicitlySetY
public void sSetImplicitlySetY(boolean v)
-
getRealCoords
public int[] getRealCoords()
Used for saving
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:PresentationElement
Listens for property change it can be: data was edited text box was edited- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
recalculatePoints
private void recalculatePoints()
Recalculates points of the tree.
-
getMiddlePointX
public int getMiddlePointX()
-
getMiddlePointY
public int getMiddlePointY()
-
constructCommandForUnGroup
public void constructCommandForUnGroup(com.nomagic.magicdraw.commands.MacroCommand macro)
-
canChangeParent
public boolean canChangeParent(java.util.Collection<? extends PresentationElement> movedTogether, @CheckForNull BaseElement newParent, boolean changeElementParent)
Description copied from class:PresentationElement
Returns true, if element can change parent.- Parameters:
movedTogether
- collection of the elements, whose will change the parent together with this.newParent
- new symbol parentchangeElementParent
- change element parent- Returns:
- true if parent of symbol can be changed
-
recalculateTreeBounds
public void recalculateTreeBounds()
Recalculates and sets new bounds of the tree according to the position of the horizontal bar
-
isConnectorOfTheSameType
public boolean isConnectorOfTheSameType(com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)
Returns true if all connected connectors are of the same type as given connector
-
isTreeOfType
public boolean isTreeOfType(java.lang.Class clazz)
-
getFirstTreeConnector
@CheckForNull public com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector getFirstTreeConnector()
First connector of the tree
-
canBeAutosized
public boolean canBeAutosized()
-
getNotCopyBounds
public java.awt.Rectangle getNotCopyBounds()
Description copied from class:PresentationElement
get not copy bounds of object throws NoRectangleDefinedException- Returns:
- rectangle of bounds
-
getBounds
public java.awt.Rectangle getBounds()
Description copied from class:PresentationElement
Method returns bounds of this element. Use PresentationElementsManager to change a bounds of the element.- Returns:
- bounds of the element.
- See Also:
PresentationElementsManager.reshapeShapeElement(com.nomagic.magicdraw.uml.symbols.shapes.ShapeElement, java.awt.Rectangle)
-
getBoundsToRepaint
public java.awt.Rectangle getBoundsToRepaint() throws NoRectangleDefinedException
Description copied from class:PresentationElement
Return bounds of the symbol that must be repainted. throws NoRectangleDefinedException- Returns:
- rectangle of bounds
- Throws:
NoRectangleDefinedException
-
sSetBounds
public void sSetBounds(java.awt.Rectangle r)
Description copied from class:PresentationElement
Sets bounds of this object view only.- Parameters:
r
- rectangle of bounds.
-
excludedSymbolsChanged
public void excludedSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isExcluded)
- Specified by:
excludedSymbolsChanged
in interfacecom.nomagic.magicdraw.uml.symbols.filter.FilteredSymbols.FilteredSymbolsChangeListener
-
filteredSymbolsChanged
public void filteredSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isFiltered)
- Specified by:
filteredSymbolsChanged
in interfacecom.nomagic.magicdraw.uml.symbols.filter.FilteredSymbols.FilteredSymbolsChangeListener
-
recalculateHorizontalBar
private void recalculateHorizontalBar(java.util.Collection<PresentationElement> symbols)
-
setShowArrow
public void setShowArrow(boolean showArrow)
-
internalGetElementToConnectLink
public Element internalGetElementToConnectLink(@CheckForNull Element path, boolean asClient)
Description copied from class:PresentationElement
Returns element that should be used for given link connecting. All possible elements are return by method getElementsForLinkConnecting. Usually this method should be overridden together with getElementsForLinkConnecting().- Returns:
- all possible elements
- See Also:
PresentationElement.getElementsForLinkConnecting()
-
getGeneralizationSetView
@CheckForNull public GeneralizationSetView getGeneralizationSetView()
-
getGeneralizationSetLabelWrapper
public com.nomagic.magicdraw.uml.symbols.shapes.GeneralizationSetLabelWrapper getGeneralizationSetLabelWrapper()
-
setResetLabels
public void setResetLabels(boolean resetLabels)
-
internalUpdatePresentationElement
protected void internalUpdatePresentationElement()
Description copied from class:PresentationElement
Internal symbol update method for subclassing. It is called from update as part of full update action.- Overrides:
internalUpdatePresentationElement
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
- See Also:
PresentationElement.update()
-
sSetElement
public void sSetElement(@CheckForNull Element element)
-
canAddInstance
public boolean canAddInstance(PresentationElement o)
Description copied from class:PresentationElement
Object view has no children.- Overrides:
canAddInstance
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
getChildrenInsets
public com.nomagic.ui.UnmodifiableInsets getChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
- Overrides:
getChildrenInsets
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
- Parameters:
insetsLevel
- describes the level of insets- Returns:
- shape insets for children
-
getRemovableChildren
public java.util.List<PresentationElement> getRemovableChildren()
- Overrides:
getRemovableChildren
in classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
internalSilentApply
public void internalSilentApply()
Description copied from class:PresentationElement
Silently applies all properties after initialization
-
internalApplyProperties
public void internalApplyProperties(PropertyManager man)
Description copied from class:PresentationElement
Applies properties from given property manager- Parameters:
man
- new properties
-
getStroke
public java.awt.BasicStroke getStroke(boolean line, int width)
This method must be overridden, if you need to use DASHED_STROKE or another one.- Returns:
- the stroke for line drawing ( by default SOLID_STROKE).
-
internalGetPresentationElementStroke
public java.awt.BasicStroke internalGetPresentationElementStroke(int width)
Description copied from class:PresentationElement
Return a stroke used to paint symbol's main part- Parameters:
width
- a custom stroke width. Other stroke parameters will be specific to symbol- Returns:
- a stroke used to paint symbol's main part
-
prepareForLineDrawing
protected boolean prepareForLineDrawing(java.awt.Graphics2D g, boolean line)
Prepares graphics for line drawing. Calls super prepareForLineDrawing and sets stroke.
-
isShowGeneralizationSet
public boolean isShowGeneralizationSet()
Indicates if generalization set should be displayed.- Returns:
- show generalization property value.
-
sSetShowGeneralizationSet
public void sSetShowGeneralizationSet(boolean show)
Simple sets (no updates) show generalization set property value.- Parameters:
show
- - show generalization set property value.
-
setShowGeneralizationSet
public void setShowGeneralizationSet(boolean show)
Sets show generalization set property value.- Parameters:
show
- - show generalization set property value.
-
getPaths
public java.util.List<java.util.List<java.awt.Point>> getPaths()
- Specified by:
getPaths
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
isDrawLineJumps
public boolean isDrawLineJumps()
- Specified by:
isDrawLineJumps
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
registerLineJumpInfos
public void registerLineJumpInfos(int pathIndex, java.awt.Point segmentStartPoint, @CheckForNull java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps)
- Specified by:
registerLineJumpInfos
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
registerLineJumpStartAngle
public void registerLineJumpStartAngle(int pathIndex, java.awt.Point point, double lineJumpStartAngle)
- Specified by:
registerLineJumpStartAngle
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
clearRegisteredLineJumpInfos
public void clearRegisteredLineJumpInfos()
- Specified by:
clearRegisteredLineJumpInfos
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
setLineJumpPlace
public void setLineJumpPlace(@CheckForNull com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)
- Specified by:
setLineJumpPlace
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
addLineJumps
public void addLineJumps(java.awt.geom.GeneralPath path, java.awt.Point segmentStartPoint, java.awt.Point startPoint, java.awt.Point endPoint)
- Specified by:
addLineJumps
in interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
drawHorizontalPart
public void drawHorizontalPart(java.awt.Graphics2D g2, int horizontalBarLeft, int horizontalBarRight)
Paints horizontal part of the tree.- Parameters:
g2
- Graphics2D object.
-
drawVerticalPart
public void drawVerticalPart(java.awt.Graphics2D g2, java.awt.Point pt)
Paints vertical part of the tree.- Parameters:
g2
- Graphics2D object.pt
- point
-
drawDecorations
private java.awt.Point drawDecorations(java.awt.Graphics2D g2, com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)
- Parameters:
g2
- Graphics object.con
- connector- Returns:
- actual supplier and client points of the link.
-
addLabel
public void addLabel(ShapeElement label)
- Specified by:
addLabel
in interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
removeLabel
public void removeLabel(ShapeElement label)
- Specified by:
removeLabel
in interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
isLabelWrapText
public boolean isLabelWrapText()
- Specified by:
isLabelWrapText
in interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
getLabelHandler
public com.nomagic.magicdraw.uml.symbols.shapes.LabelHandler getLabelHandler()
- Specified by:
getLabelHandler
in interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
isNameWrapped
public boolean isNameWrapped()
-
sSetNameWrapped
public void sSetNameWrapped(boolean wrapped)
-
setNameWrapped
public void setNameWrapped(boolean wrapped)
-
sSetSuspendLabelAutoDisplayMode
public void sSetSuspendLabelAutoDisplayMode(java.lang.String mode)
-
setSuspendLabelAutoDisplayMode
public void setSuspendLabelAutoDisplayMode(java.lang.String mode)
-
setSuspendShapeAutoResizeMode
public void setSuspendShapeAutoResizeMode(java.lang.String mode)
-
registerToFilteredSymbols
private void registerToFilteredSymbols()
-
-