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.FilteredSymbolsChangeListenerThis class represents tree header (part of generalization tree symbol).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classcom.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeBoundsClass for tree bounds - has additional tree stuff.static classcom.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeDataprivate static classcom.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeLabelLayouterprivate static classcom.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeLabelOrientationChooserprivate static classcom.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeViewLabelHandlerPrevents 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 intarrowToDashDistanceMinimal distance between connect link arrow(anchor) and horizontal bar of the tree.private ShapeElementbaseClassBase class of treeprivate inthorizontalBarLeftx coordinates of the tree view horizontal bar edgesprivate inthorizontalBarRightprivate inthorizontalBarYThe y coordinate of the tree view horizontal barprivate java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo>horizontalLineJumpsprivate doublehorizontalLineJumpStartAngleprivate booleanimplicitlySetYImplicitly set y coordinateprivate com.nomagic.magicdraw.uml.symbols.shapes.LabelHandlerlabelHandlerprivate com.nomagic.magicdraw.uml.symbols.LineJumpPlacelineJumpPlaceprivate booleanresetLabelsprivate booleanshowArrowprivate intverticalBarRelativeXdistance between shape left corner and vertical bar.private intverticalBarXThe x coordinate of the tree vertical bar to the base classprivate intverticalBarYThe y coordinate of the tree vertical bar at the base classprivate java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo>verticalLineJumpsprivate doubleverticalLineJumpStartAnglestatic java.lang.StringX_COORDstatic java.lang.StringY_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 voidaccept(Visitor visitor)Method accepts visitor, and calls method visit<class name>(this) of visitor .voidaddLabel(ShapeElement label)voidaddLineJumps(java.awt.geom.GeneralPath path, java.awt.Point segmentStartPoint, java.awt.Point startPoint, java.awt.Point endPoint)voidatInsert()Invalidates object at insertvoidcalculateHorizontalBar()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.TreeDatacalculateMostLeftAndRightHorizontalXPoints(java.util.function.Predicate<PresentationElement> pathElementPredicate)com.nomagic.magicdraw.uml.symbols.shapes.TreeView.TreeDatacalculateMostLeftAndRightHorizontalXPointsByContext(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)voidcalculateVerticalBarX()If horizontal bar is outside shape moves it to shape.booleancanAddInstance(PresentationElement o)Object view has no children.booleancanBeAutosized()booleancanChangeParent(java.util.Collection<? extends PresentationElement> movedTogether, BaseElement newParent, boolean changeElementParent)Returns true, if element can change parent.voidclearRegisteredLineJumpInfos()TreeViewclone()Returns a copy of theElement.voidconstructCommandForUnGroup(com.nomagic.magicdraw.commands.MacroCommand macro)booleancoversPoint(int x, int y)checks if object covers provided pointContainerShapecreateBoundsShape(PathElement path, BoundsTransformation transformation)Creates bounding shape for intersection calculation.voiddispose()disposes ends of links when link is deletedprivate java.awt.PointdrawDecorations(java.awt.Graphics2D g2, com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)voiddrawHorizontalPart(java.awt.Graphics2D g2, int horizontalBarLeft, int horizontalBarRight)Paints horizontal part of the tree.voiddrawVerticalPart(java.awt.Graphics2D g2, java.awt.Point pt)Paints vertical part of the tree.voidexcludedSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isExcluded)voidfilteredSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isFiltered)ShapeElementgetBaseClass()java.awt.RectanglegetBounds()Method returns bounds of this element.java.awt.RectanglegetBoundsToRepaint()Return bounds of the symbol that must be repainted.com.nomagic.ui.UnmodifiableInsetsgetChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnectorgetFirstTreeConnector()First connector of the treecom.nomagic.magicdraw.uml.symbols.shapes.GeneralizationSetLabelWrappergetGeneralizationSetLabelWrapper()GeneralizationSetViewgetGeneralizationSetView()intgetHorizontalBarLeft()Returns x coordinate of the tree view horizontal bar left edge.intgetHorizontalBarRight()Returns x coordinate of the tree view horizontal bar right edge.intgetHorizontalBarY()Returns y coordinate of the horizontal bar of the tree view.booleangetImplicitlySetY()com.nomagic.magicdraw.uml.symbols.shapes.LabelHandlergetLabelHandler()intgetMiddlePointX()intgetMiddlePointY()java.awt.RectanglegetNotCopyBounds()get not copy bounds of object throws NoRectangleDefinedExceptionjava.util.List<java.util.List<java.awt.Point>>getPaths()private java.awt.RectanglegetRealBounds()Because getBounds return just horizontal bar bounds, we need method to calculate real boundsint[]getRealCoords()Used for savingjava.util.List<PresentationElement>getRemovableChildren()java.awt.BasicStrokegetStroke(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.intgetVerticalBarRelativeX()intgetVerticalBarX()Returns x coordinate of the vertical bar to the base class for the tree view.intgetVerticalBarY()Returns y coordinate of the tree view vertical bar end at the base class.booleanhasSharedData()Returns true if data of this object can be shared.voidinternalApplyProperties(PropertyManager man)Applies properties from given property managerElementinternalGetElementToConnectLink(Element path, boolean asClient)Returns element that should be used for given link connecting.java.awt.BasicStrokeinternalGetPresentationElementStroke(int width)Return a stroke used to paint symbol's main partvoidinternalSilentApply()Silently applies all properties after initializationprotected voidinternalUpdatePresentationElement()Internal symbol update method for subclassing.booleanintersects(int x, int y, int width, int height)checks whether object intersects with given rectanglebooleanisConnectorOfTheSameType(com.nomagic.magicdraw.uml.symbols.paths.TreeViewConnector con)Returns true if all connected connectors are of the same type as given connectorbooleanisDrawLineJumps()booleanisLabelWrapText()booleanisNameWrapped()booleanisShowGeneralizationSet()Indicates if generalization set should be displayed.booleanisTreeOfType(java.lang.Class clazz)voidmovePathElement(PathElement linkView, PathConnector requestor)Calculates position of path element.voidmovePathElements()voidpaintSelf(com.nomagic.magicdraw.uml.symbols.DiagramPaintContext context)protected booleanprepareForLineDrawing(java.awt.Graphics2D g, boolean line)Prepares graphics for line drawing.voidpropertyChange(java.beans.PropertyChangeEvent e)Listens for property change it can be: data was edited text box was editedprivate voidrecalculateHorizontalBar(java.util.Collection<PresentationElement> symbols)private voidrecalculatePoints()Recalculates points of the tree.voidrecalculateTreeBounds()Recalculates and sets new bounds of the tree according to the position of the horizontal barvoidregisterLineJumpInfos(int pathIndex, java.awt.Point segmentStartPoint, java.util.List<com.nomagic.magicdraw.uml.symbols.LineJumpInfo> lineJumps)voidregisterLineJumpStartAngle(int pathIndex, java.awt.Point point, double lineJumpStartAngle)private voidregisterToFilteredSymbols()booleanremoveConnectedPathElement(PathElement link)Removes path element.voidremoveLabel(ShapeElement label)voidresetHorizontalBarY()Explicitly specify that the y coordinate of the tree view horizontal bar is not implicitly defined.voidsCalculateHorizontalBar()Calculates the y coordinate of the middle bar for the view according to the positions of the child classes, connected by the tree viewvoidsetBaseClass(ShapeElement classView)Sets base classvoidsetHorizontalBarLeft(int xPosition)Specify x coordinate of the tree view horizontal bar left edge.voidsetHorizontalBarRight(int xPosition)Specify x coordinate of the tree view horizontal bar right edge.voidsetHorizontalBarY(int yPosition)Implicitly specify the y coordinate of the tree view horizontal bar.voidsetHorizontalBarYExplicitly(int yPosition)Explicitly specify the y coordinate of the tree view horizontal bar.voidsetLineJumpPlace(com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)voidsetNameWrapped(boolean wrapped)voidsetResetLabels(boolean resetLabels)voidsetShowArrow(boolean showArrow)voidsetShowGeneralizationSet(boolean show)Sets show generalization set property value.voidsetSuspendLabelAutoDisplayMode(java.lang.String mode)voidsetSuspendShapeAutoResizeMode(java.lang.String mode)voidsetVerticalBarRelativeX(int x)voidsetVerticalBarX(int xPosition)Explicitly specify the x coordinate of the vertical bar to the base class for the tree view.voidsetVerticalBarY(int yPosition)Specify the y coordinate of the vertical bar end at the base class for the tree view.voidsimpleSetBounds(java.awt.Rectangle bnd, boolean moveChildren, boolean calculatePrefSize)voidsSetBaseClass(ShapeElement classView)Sets base classvoidsSetBounds(java.awt.Rectangle r)Sets bounds of this object view only.voidsSetElement(Element element)voidsSetHorizontalBarLeft(int xPosition)voidsSetHorizontalBarRight(int xPosition)voidsSetHorizontalBarY(int yPosition)Implicitly specify the y coordinate of the tree view horizontal bar.voidsSetImplicitlySetY(boolean v)voidsSetNameWrapped(boolean wrapped)voidsSetShowGeneralizationSet(boolean show)Simple sets (no updates) show generalization set property value.voidsSetSuspendLabelAutoDisplayMode(java.lang.String mode)voidsSetVerticalBarX(int pos)voidsSetVerticalBarY(int yPosition)private voidupdateLinksCoordinates()-
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:PresentationElementReturns 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:PresentationElementInvalidates object at insert- Specified by:
atInsertin interfaceBaseElement
-
createBoundsShape
public ContainerShape createBoundsShape(@CheckForNull PathElement path, BoundsTransformation transformation)
Description copied from class:ShapeElementCreates 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:
simpleSetBoundsin 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:ElementImplReturns a copy of theElement.- Specified by:
clonein interfaceBaseElement- Overrides:
clonein classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView- Returns:
- the cloned object
-
movePathElement
public void movePathElement(PathElement linkView, @CheckForNull PathConnector requestor)
Description copied from class:PathConnectorCalculates 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:PresentationElementdisposes ends of links when link is deleted- Specified by:
disposein 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:PresentationElementchecks 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:PresentationElementchecks whether object intersects with given rectangle- Returns:
- true if object and rectangle intersects
-
removeConnectedPathElement
public boolean removeConnectedPathElement(PathElement link)
Description copied from class:PathConnectorRemoves 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:MDElementMethod 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:PresentationElementListens for property change it can be: data was edited text box was edited- Specified by:
propertyChangein 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:PresentationElementReturns 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:PresentationElementget not copy bounds of object throws NoRectangleDefinedException- Returns:
- rectangle of bounds
-
getBounds
public java.awt.Rectangle getBounds()
Description copied from class:PresentationElementMethod 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 NoRectangleDefinedExceptionDescription copied from class:PresentationElementReturn 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:PresentationElementSets bounds of this object view only.- Parameters:
r- rectangle of bounds.
-
excludedSymbolsChanged
public void excludedSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isExcluded)
- Specified by:
excludedSymbolsChangedin interfacecom.nomagic.magicdraw.uml.symbols.filter.FilteredSymbols.FilteredSymbolsChangeListener
-
filteredSymbolsChanged
public void filteredSymbolsChanged(java.util.Collection<PresentationElement> symbols, boolean isFiltered)
- Specified by:
filteredSymbolsChangedin 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:PresentationElementReturns 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:PresentationElementInternal symbol update method for subclassing. It is called from update as part of full update action.- Overrides:
internalUpdatePresentationElementin 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:PresentationElementObject view has no children.- Overrides:
canAddInstancein classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
getChildrenInsets
public com.nomagic.ui.UnmodifiableInsets getChildrenInsets(com.nomagic.magicdraw.uml.symbols.shapes.InsetsLevel insetsLevel)
- Overrides:
getChildrenInsetsin 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:
getRemovableChildrenin classcom.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView
-
internalSilentApply
public void internalSilentApply()
Description copied from class:PresentationElementSilently applies all properties after initialization
-
internalApplyProperties
public void internalApplyProperties(PropertyManager man)
Description copied from class:PresentationElementApplies 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:PresentationElementReturn 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:
getPathsin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
isDrawLineJumps
public boolean isDrawLineJumps()
- Specified by:
isDrawLineJumpsin 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:
registerLineJumpInfosin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
registerLineJumpStartAngle
public void registerLineJumpStartAngle(int pathIndex, java.awt.Point point, double lineJumpStartAngle)- Specified by:
registerLineJumpStartAnglein interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
clearRegisteredLineJumpInfos
public void clearRegisteredLineJumpInfos()
- Specified by:
clearRegisteredLineJumpInfosin interfacecom.nomagic.magicdraw.uml.symbols.LineJumpDrawer
-
setLineJumpPlace
public void setLineJumpPlace(@CheckForNull com.nomagic.magicdraw.uml.symbols.LineJumpPlace lineJumpPlace)- Specified by:
setLineJumpPlacein 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:
addLineJumpsin 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:
addLabelin interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
removeLabel
public void removeLabel(ShapeElement label)
- Specified by:
removeLabelin interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
isLabelWrapText
public boolean isLabelWrapText()
- Specified by:
isLabelWrapTextin interfacecom.nomagic.magicdraw.uml.symbols.LabelOwner
-
getLabelHandler
public com.nomagic.magicdraw.uml.symbols.shapes.LabelHandler getLabelHandler()
- Specified by:
getLabelHandlerin 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()
-
-