@OpenApiAll
public class UMLGraph
extends y.layout.DefaultLayoutGraph
| Modifier and Type | Class and Description | 
|---|---|
(package private) class  | 
UMLGraph.EdgeSourceTargetComparator
Compares target or source elements by their opposite end. 
 | 
| Modifier and Type | Field and Description | 
|---|---|
protected SwimlaneView | 
currentSwimlane  | 
protected SwimlaneCellView | 
currentSwimlaneCellView  | 
protected java.util.Set<PathElement> | 
doNotRepaint  | 
java.util.Map<y.base.Edge,java.util.List<y.layout.EdgeLabelLayoutImpl>> | 
edgeLabelDataMap  | 
protected com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory | 
edgeLabelFactory  | 
java.util.Map<com.nomagic.magicdraw.uml.symbols.layout.LabelData,java.awt.Rectangle> | 
labelRectangles  | 
protected java.util.Map<PresentationElement,java.lang.Object> | 
mDataMap
PresentationElement (path or shape) bind to yFiles edge or node. 
 | 
protected y.base.EdgeMap | 
mEdgeMap  | 
java.util.Map<PresentationElement,y.base.Edge> | 
mFakeElementsMap  | 
protected y.base.NodeMap | 
mGroupKey  | 
protected y.base.NodeMap | 
mNodeId  | 
protected y.base.NodeMap | 
mNodeMap  | 
protected java.util.Set<PresentationElement> | 
mNotSupported  | 
protected java.util.LinkedHashSet<PresentationElement> | 
mPaths  | 
protected java.util.Set<PresentationElement> | 
mSelected  | 
java.util.Map<y.base.Node,java.util.List<y.layout.NodeLabelLayoutImpl>> | 
nodeLabelDataMap  | 
java.util.Map<y.base.Node,com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> | 
nodeToSwimlanePlacement  | 
com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo | 
partitionInfo  | 
| Constructor and Description | 
|---|
UMLGraph(DiagramPresentationElement diagramView,
        boolean supportsSubgraph,
        java.util.Set<PresentationElement> selected,
        boolean useIntegratedLabels,
        boolean resetLabelsFlag)
Construct UML Graph. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
y.base.EdgeMap | 
addEdgeSelectionProvider(java.lang.Object provider,
                        java.util.Collection<y.base.Edge> c)
Add Edge Selection Provider. 
 | 
y.base.EdgeMap | 
addEdgeSelectionProvider(java.lang.Object provider,
                        y.base.Edge edge)
Add Edge Selection Provider. 
 | 
void | 
addGroupNodeInsetsProvider()
Add Group node inset provider. 
 | 
protected void | 
addPaths(PresentationElement pe)  | 
static void | 
addProvider(com.nomagic.magicdraw.uml.symbols.layout.LayoutableSymbolProvider provider)
Registers a new provider 
 | 
boolean | 
areParentToChildConnected(java.util.List<PathElement> connectedPathElements)  | 
boolean | 
belongsToHierarchy(y.base.Edge edge)
Check The given Edge belongs to hierarchy. 
 | 
boolean | 
belongsToHierarchy(y.base.Node node)
Checks the given node belongs to Hierarchy. 
 | 
protected void | 
collectPathsRecursively(ShapeElement element,
                       y.base.Node node)  | 
boolean | 
containsHierarchy()
Check If contains hierarchy. 
 | 
protected void | 
createAllNodeLabels(ShapeElement shape,
                   y.base.Node node)  | 
protected void | 
createAllPathLabels(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory factory)  | 
void | 
createCommands(com.nomagic.magicdraw.commands.MacroCommand mc,
              boolean bnodes,
              boolean bpaths)
Create command with given parameter. 
 | 
y.base.Edge | 
createEdge(PathElement path)
Creates an edge in a graph by provided path element. 
 | 
y.layout.grouping.GroupBoundsCalculator | 
createGroupBoundsCalculator()
Creates bounds calculator for group nodes 
 | 
void | 
createHierarchicInfo(java.util.Collection<java.lang.Class<?>> classTypes)
Create Hierarchy Information of path element. 
 | 
y.base.Node | 
createNode(java.lang.Object id)
Create new Node and set the given id to it. 
 | 
protected y.base.Node | 
createNode(ShapeElement shape)  | 
protected void | 
createNodeData(java.lang.Object parentId,
              java.util.Collection<PresentationElement> presentationElements)  | 
void | 
dispose()
Dispose the diagram. 
 | 
void | 
drawResults()
Draw a result. 
 | 
java.awt.Rectangle | 
getBoundingBox()  | 
java.util.Map<PresentationElement,java.lang.Object> | 
getDataMap()  | 
DiagramPresentationElement | 
getDiagram()
Get Presentation Diagram. 
 | 
y.base.Edge | 
getEdge(PathElement path)
Get Edge of given path element. 
 | 
y.geom.YPoint | 
getEdgeLabelLocation(y.base.Edge e,
                    y.layout.EdgeLabelLayout ell)
Get Location of the given edge label. 
 | 
y.base.EdgeMap | 
getEdgeMap()  | 
java.lang.Object | 
getID(y.base.Node node)
Get The given node ID. 
 | 
static y.geom.YInsets | 
getInsets(ShapeElement shape)
Calculates insets for group nodes, applier only on group nodes 
 | 
static y.geom.YInsets | 
getInsets(ShapeElement shape,
         java.awt.Insets addAdditional)
Calculates insets for shapes. 
 | 
protected java.util.Map<y.base.Edge,java.util.List<com.nomagic.magicdraw.uml.symbols.layout.CompositeEdgeLabelDescriptor>> | 
getLabelDescriptorsNotAtEnd()  | 
y.base.Node | 
getNode(PresentationElement se)
Get Node from the Presentation element. 
 | 
y.base.NodeMap | 
getNodeMap()  | 
java.util.Map<y.base.Node,com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> | 
getNodeToSwimlaneStructure()  | 
java.lang.Object | 
getParentId(y.base.Node node)
Get Node 's parent id. 
 | 
y.layout.grid.PartitionGrid | 
getPartitionGrid()  | 
com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo | 
getPartitionInfo()  | 
PathElement | 
getPathElement(y.base.Edge edge)
Get Path Element of the given edge. 
 | 
java.util.ArrayList<java.awt.Point> | 
getPointsFromEdge(y.base.Edge edge)
Returns the points from an edge 
 | 
java.util.Set<y.base.Edge> | 
getReversedList()  | 
java.util.Set<PresentationElement> | 
getSelected()
Get Set of the selected PresentationElement. 
 | 
ShapeElement | 
getShapeElement(y.base.Node node)
Get The given node 's Shape Element. 
 | 
java.awt.Point | 
getSphereCenterPoint()  | 
int | 
getSphereRadius()  | 
java.lang.String | 
getStyle()
Get String representation of Style. 
 | 
boolean | 
getUseEdgeLabels()  | 
protected void | 
ignoreCenterlines(PresentationElement shape)
Ignores centerlines on shape bound changes for centerlineable shape. 
 | 
void | 
initializeData()
Collects all data provided by diagram to nodes and edges. 
 | 
boolean | 
isFlowVertical()
Determines if the direction is vertical or horizontal 
 | 
boolean | 
isGroupNode(y.base.Node node)
Checks if a given node is a group node or not. 
 | 
protected boolean | 
isInSphereRadius(ShapeElement element)  | 
static boolean | 
isLayoutableByProviders(PresentationElement el)
Checks if symbol is layoutable. 
 | 
protected boolean | 
isNotLayoutedChild(PresentationElement view)  | 
boolean | 
isParentConnectedToChild(PathElement pathElement)  | 
static boolean | 
isTreeOverlapping(TreeView tree,
                 int y,
                 java.lang.Iterable<TreeView> trees)
Check Is tree overlapping. 
 | 
void | 
makeSubTree(y.base.Node node,
           java.lang.Class<?> classType,
           com.nomagic.magicdraw.commands.MacroCommand mc)
Make sub tree. 
 | 
void | 
makeSubTrees(com.nomagic.magicdraw.commands.MacroCommand mc)
Make sub trees with the given Macrocommand. 
 | 
protected boolean | 
needToCreate(PresentationElement pe)  | 
protected void | 
placeLayoutedPathLabel(PresentationElement pe,
                      y.base.Edge edge,
                      com.nomagic.magicdraw.commands.MacroCommand mc)  | 
void | 
removeGroupNodeInsetsProvider()
Remove The group node in sets of provider. 
 | 
static void | 
removeSubTrees(com.nomagic.magicdraw.commands.MacroCommand mc,
              DiagramPresentationElement dpe,
              java.util.Set<PresentationElement> selection)
Remove Sub Trees from the given presentation element. 
 | 
void | 
resetLabel(PresentationElement pe)
Resets label to their default position. 
 | 
void | 
reverseAndAddToNoReverseList(y.base.Edge edg)
Reverses an edge in graph, does not reverse if path is already reversed. 
 | 
void | 
reverseEdge(y.base.Edge edge)
Reverses an edge. 
 | 
void | 
reverseEdgeAndLabels(y.base.Edge edg)  | 
void | 
setEdgeLabelFactory(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory edgeLabelFactory)  | 
void | 
setMinimalGroupNodeSize(y.base.Node node,
                       y.geom.YDimension dim)
Sets the minimal group node size that is obeyed by layouter. 
 | 
protected void | 
setNodeSizeEnsureNotZero(java.awt.Rectangle bounds,
                        y.base.Node node)
Sets graph node size, ensures the node height or width is not 0 
 | 
void | 
setParent(y.base.Node node,
         java.lang.Object parentId)
Set node 's parent. 
 | 
void | 
setPartitionGrid(y.layout.grid.PartitionGrid partitionGrid)  | 
void | 
setPartitionInfo(com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo info)  | 
static void | 
setPathBounds(PathElement path,
             java.util.List<java.awt.Point> points,
             java.awt.Point supplier,
             java.awt.Point client,
             com.nomagic.magicdraw.commands.MacroCommand mc)
Changes client point, supplier point and breakpoints and routes the path by layouted edge 
 | 
void | 
setPathStyle(java.lang.String style)
Set path style 
 | 
void | 
setShouldResetLabels(boolean flag)
Sets if should reset labels when creating uml graph. 
 | 
void | 
setSphereCenterPoint(java.awt.Point point)
Sets the center of the sphere that is used for node creation 
 | 
void | 
setSphereRadius(int radius)
Sets the sphere from the defined point. 
 | 
void | 
setUseIntegratedLabels(boolean collect)
Sets edge label collecting and using in layout. 
 | 
createEdgeLayout, createGraphCopyFactory, createLabelFactory, createNodeLayout, getFeature, getFeature, getLabelLayout, getLabelLayout, getLayout, getLayout, setLabelLayout, setLabelLayout, setLabelLayout, setLayout, setLayoutgetCenter, getCenterX, getCenterY, getEdgeLabelLayout, getEdgeLayout, getEdgeList, getHeight, getLocation, getNodeLabelLayout, getNodeLayout, getPath, getPathList, getPointList, getPoints, getRectangle, getSize, getSourcePointAbs, getSourcePointRel, getTargetPointAbs, getTargetPointRel, getWidth, getX, getY, moveBy, setCenter, setCenter, setEndPointsAbs, setLocation, setLocation, setPath, setPath, setPoints, setPoints, setSize, setSize, setSourcePointAbs, setSourcePointRel, setTargetPointAbs, setTargetPointReladdDataProvider, addGraphListener, changeEdge, changeEdge, changeEdge, clear, contains, contains, containsEdge, createCopy, createEdge, createEdge, createEdgeMap, createGraph, createNode, createNodeMap, disposeEdgeMap, disposeNodeMap, E, edgeCount, edgeObjects, edges, fireGraphEvent, firePostEvent, firePostEvent, firePreEvent, firePreEvent, firstEdge, firstNode, firstOutEdge, getDataProvider, getDataProviderKeys, getEdgeArray, getGraphCopyFactory, getGraphListeners, getNodeArray, getRegisteredEdgeMaps, getRegisteredNodeMaps, getSource, getTarget, hasListeners, hide, hide, isEmpty, lastEdge, lastNode, moveSubGraph, moveToFirst, moveToFirst, moveToLast, moveToLast, N, nodeCount, nodeObjects, nodes, printNodeSlotSize, reInsertEdge, reInsertNode, removeDataProvider, removeEdge, removeGraphListener, removeNode, setGraphCopyFactory, sortEdges, sortEdges, sortNodes, toString, unhide, unhidepublic java.util.Map<PresentationElement,y.base.Edge> mFakeElementsMap
protected java.util.Set<PathElement> doNotRepaint
protected java.util.Map<PresentationElement,java.lang.Object> mDataMap
protected y.base.NodeMap mNodeMap
protected y.base.EdgeMap mEdgeMap
protected y.base.NodeMap mNodeId
protected y.base.NodeMap mGroupKey
protected java.util.LinkedHashSet<PresentationElement> mPaths
protected java.util.Set<PresentationElement> mNotSupported
protected java.util.Set<PresentationElement> mSelected
public java.util.Map<y.base.Edge,java.util.List<y.layout.EdgeLabelLayoutImpl>> edgeLabelDataMap
public java.util.Map<y.base.Node,java.util.List<y.layout.NodeLabelLayoutImpl>> nodeLabelDataMap
public java.util.Map<com.nomagic.magicdraw.uml.symbols.layout.LabelData,java.awt.Rectangle> labelRectangles
public com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo partitionInfo
public java.util.Map<y.base.Node,com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> nodeToSwimlanePlacement
protected SwimlaneView currentSwimlane
protected SwimlaneCellView currentSwimlaneCellView
protected com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory edgeLabelFactory
public UMLGraph(DiagramPresentationElement diagramView, boolean supportsSubgraph, java.util.Set<PresentationElement> selected, boolean useIntegratedLabels, boolean resetLabelsFlag)
diagramView - diagram for which to construct graph.supportsSubgraph - True ,if UMLGraph support sub graph.selected - selected elementsuseIntegratedLabels - if true(with hierarchic and orthogonal) uses library label layout
                            mechanism(can also layout association class a label), false with all other
                            layouters and uses MD internal label placementresetLabelsFlag - if true, resets label to their default positions, if false, does not
                            reset labels at allpublic void initializeData()
public static y.geom.YInsets getInsets(ShapeElement shape)
shape - the shape to calculate insets topublic static y.geom.YInsets getInsets(ShapeElement shape, java.awt.Insets addAdditional)
shape - the shape to calculate insets toprotected y.base.Node createNode(ShapeElement shape)
protected void setNodeSizeEnsureNotZero(java.awt.Rectangle bounds,
                                        y.base.Node node)
bounds - the bounds to setnode - the node that should have the minimal sizeprotected void createAllNodeLabels(ShapeElement shape, y.base.Node node)
public java.awt.Rectangle getBoundingBox()
getBoundingBox in interface y.layout.GraphLayoutgetBoundingBox in class y.layout.LayoutGraphpublic y.base.Node createNode(java.lang.Object id)
id - The given id.public java.lang.Object getID(y.base.Node node)
node - The given node.@CheckForNull public y.base.Edge createEdge(PathElement path)
path - the path that will correspond an edgeprotected void createAllPathLabels(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory factory)
public PathElement getPathElement(y.base.Edge edge)
edge - The given edge.public ShapeElement getShapeElement(y.base.Node node)
node - The given node.public void setParent(y.base.Node node,
                      java.lang.Object parentId)
node - The given node.parentId - The parent 's id.public java.lang.Object getParentId(y.base.Node node)
node - The given node.public DiagramPresentationElement getDiagram()
protected boolean needToCreate(PresentationElement pe)
protected void createNodeData(@CheckForNull
                              java.lang.Object parentId,
                              java.util.Collection<PresentationElement> presentationElements)
public boolean isParentConnectedToChild(PathElement pathElement)
public boolean areParentToChildConnected(java.util.List<PathElement> connectedPathElements)
protected void collectPathsRecursively(ShapeElement element, y.base.Node node)
protected void addPaths(PresentationElement pe)
@CheckForNull public y.base.Node getNode(PresentationElement se)
se - PresentationElement.public y.base.Edge getEdge(PathElement path)
path - The given path element.protected boolean isNotLayoutedChild(PresentationElement view)
public static boolean isLayoutableByProviders(PresentationElement el)
el - checked elementpublic void createCommands(@CheckForNull
                           com.nomagic.magicdraw.commands.MacroCommand mc,
                           boolean bnodes,
                           boolean bpaths)
mc - MacroCommand.bnodes - determines if nodes should be placedbpaths - determines if paths should be routedprotected void ignoreCenterlines(PresentationElement shape)
shape - the shape to ignore centerlines on shape bound changespublic java.util.ArrayList<java.awt.Point> getPointsFromEdge(y.base.Edge edge)
edge - edge's point to returnpublic boolean isFlowVertical()
public static void setPathBounds(PathElement path, java.util.List<java.awt.Point> points, java.awt.Point supplier, java.awt.Point client, @CheckForNull com.nomagic.magicdraw.commands.MacroCommand mc)
path - current pathpoints - new breakpointssupplier - supplierclient - clientmc - macroprotected void placeLayoutedPathLabel(PresentationElement pe, y.base.Edge edge, @CheckForNull com.nomagic.magicdraw.commands.MacroCommand mc)
protected java.util.Map<y.base.Edge,java.util.List<com.nomagic.magicdraw.uml.symbols.layout.CompositeEdgeLabelDescriptor>> getLabelDescriptorsNotAtEnd()
public void resetLabel(PresentationElement pe)
pe - the element that labels will be resetpublic y.geom.YPoint getEdgeLabelLocation(y.base.Edge e,
                                          y.layout.EdgeLabelLayout ell)
e - Edgeell - Edge Label Layout.public void dispose()
public void setMinimalGroupNodeSize(y.base.Node node,
                                    y.geom.YDimension dim)
node - the node that should have the minimal sizedim - the size of nodepublic boolean isGroupNode(y.base.Node node)
node - the node to checkpublic java.lang.String getStyle()
public void setPathStyle(java.lang.String style)
style - path style to setpublic void makeSubTrees(com.nomagic.magicdraw.commands.MacroCommand mc)
mc - macropublic void makeSubTree(y.base.Node node,
                        java.lang.Class<?> classType,
                        com.nomagic.magicdraw.commands.MacroCommand mc)
node - The given node.classType - The given class type.mc - Macro Command.public static boolean isTreeOverlapping(TreeView tree, int y, java.lang.Iterable<TreeView> trees)
tree - The given tree view.y - y coordinate of the horizontal bar of the tree view.trees - Collection of trees.public static void removeSubTrees(@CheckForNull
                                  com.nomagic.magicdraw.commands.MacroCommand mc,
                                  DiagramPresentationElement dpe,
                                  java.util.Set<PresentationElement> selection)
mc - MacroCommanddpe - DiagramPresentation.selection - if not null or empty removes only trees that groups all selected paths or
                  all path connectors.public boolean belongsToHierarchy(y.base.Node node)
node - The given node.public boolean belongsToHierarchy(y.base.Edge edge)
edge - The given edge.public boolean containsHierarchy()
public void createHierarchicInfo(@CheckForNull
                                 java.util.Collection<java.lang.Class<?>> classTypes)
classTypes - List of class type.public void drawResults()
public void setShouldResetLabels(boolean flag)
flag - flagpublic java.util.Set<PresentationElement> getSelected()
public y.base.EdgeMap addEdgeSelectionProvider(java.lang.Object provider,
                                               java.util.Collection<y.base.Edge> c)
provider - The given provider.c - Collection of Edge.public y.base.EdgeMap addEdgeSelectionProvider(java.lang.Object provider,
                                               y.base.Edge edge)
provider - The given provider.edge - single edgepublic void addGroupNodeInsetsProvider()
public void removeGroupNodeInsetsProvider()
public y.layout.grouping.GroupBoundsCalculator createGroupBoundsCalculator()
public y.base.NodeMap getNodeMap()
public y.base.EdgeMap getEdgeMap()
public java.util.Map<PresentationElement,java.lang.Object> getDataMap()
public void reverseAndAddToNoReverseList(y.base.Edge edg)
edg - the edge to reversepublic void reverseEdgeAndLabels(y.base.Edge edg)
public void reverseEdge(y.base.Edge edge)
reverseAndAddToNoReverseList method.reverseEdge in class y.base.Graphedge - edge to reversepublic java.util.Set<y.base.Edge> getReversedList()
public void setUseIntegratedLabels(boolean collect)
collect - determines if labels should be collectedpublic boolean getUseEdgeLabels()
public y.layout.grid.PartitionGrid getPartitionGrid()
public com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo getPartitionInfo()
public void setPartitionGrid(y.layout.grid.PartitionGrid partitionGrid)
partitionGrid - sets to use this partition grid as gridpublic void setPartitionInfo(com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlanePartitionInfo info)
info - the information of partitionspublic java.util.Map<y.base.Node,com.nomagic.magicdraw.uml.symbols.layout.activity.SwimlaneAndCellStructure> getNodeToSwimlaneStructure()
public void setSphereRadius(int radius)
radius - the radius that shapes are collectedpublic int getSphereRadius()
public void setSphereCenterPoint(java.awt.Point point)
point - new point of center, default is 0,0public java.awt.Point getSphereCenterPoint()
protected boolean isInSphereRadius(ShapeElement element)
public static void addProvider(com.nomagic.magicdraw.uml.symbols.layout.LayoutableSymbolProvider provider)
provider - providerpublic void setEdgeLabelFactory(com.nomagic.magicdraw.uml.symbols.layout.labels.EdgeLabelFactory edgeLabelFactory)