Search this API

y.layout
Class DefaultLayoutGraph

java.lang.Object
  extended by y.base.Graph
      extended by y.layout.LayoutGraph
          extended by y.layout.DefaultLayoutGraph
All Implemented Interfaces:
GraphInterface, GraphLayout

public class DefaultLayoutGraph
extends LayoutGraph

DefaultLayoutGraph is a default implementation of LayoutGraph which holds the complete layout information about the graph and its elements.

 

Field Summary
protected  java.util.Map edgeLabelFeatureMap
          A Map associating the owner of an edge label with the edge label itself.
protected  EdgeMap edgeLabelMap
          An EdgeMap associating EdgeLabelLayouts with the edges of this graph.
protected  java.util.Map nodeLabelFeatureMap
          A Map associating the owner of a node label with the node label itself.
protected  NodeMap nodeLabelMap
          A NodeMap associating NodeLabelLayouts with the nodes of this graph.
 
Fields inherited from class y.base.Graph
AFTER, BEFORE
 
Constructor Summary
DefaultLayoutGraph()
          Creates a new DefaultLayoutGraph instance with default settings.
DefaultLayoutGraph(DefaultLayoutGraph graph, YCursor nodeSubset)
          Creates a new DefaultLayoutGraph instance which is a copy of the given subgraph.
DefaultLayoutGraph(LayoutGraph argGraph)
          Creates a new DefaultLayoutGraph instance which is a copy of the given graph.
DefaultLayoutGraph(LayoutGraph graph, YCursor nodeSubset)
          Creates a new DefaultLayoutGraph instance which is a copy of the given subgraph.
 
Method Summary
protected  EdgeLayout createEdgeLayout()
          Creates a new implementation of EdgeLayout.
protected  GraphCopier.CopyFactory createGraphCopyFactory()
          Creates a factory that creates a LayoutGraph when copying a graph using GraphCopier.
protected  LabelLayoutFactory createLabelFactory()
          Creates a new LabelLayoutFactory for this LayoutGraph that can be used for copying layout information of labels.
protected  NodeLayout createNodeLayout()
          Creates a new implementation of NodeLayout.
 Edge getFeature(EdgeLabelLayout labelLayout)
          Returns the edge to which the given EdgeLabelLayout belongs.
 Node getFeature(NodeLabelLayout labelLayout)
          Returns the node to which the given NodeLabelLayout belongs.
 EdgeLabelLayout[] getLabelLayout(Edge edge)
          Returns the layout information for all labels associated with the given edge.
 NodeLabelLayout[] getLabelLayout(Node node)
          Returns the layout information for all labels associated with the given node.
 EdgeLayout getLayout(Edge edge)
          Returns the layout information for the given edge.
 NodeLayout getLayout(Node node)
          Returns the layout information for the given node.
 void setLabelLayout(Edge edge, EdgeLabelLayout[] layout)
          Specifies the layout information for all associated labels of the given edge.
 void setLabelLayout(Node node, NodeLabelLayout layout)
          Specifies the layout information for all associated labels of the given node in case there is only one label.
 void setLabelLayout(Node node, NodeLabelLayout[] layout)
          Specifies the layout information for all associated labels of the given node.
 void setLayout(Edge edge, EdgeLayout layout)
          Specifies the layout information for the given edge.
 void setLayout(Node node, NodeLayout layout)
          Specifies the layout information for the given node.
 
Methods inherited from class y.layout.LayoutGraph
getBoundingBox, getCenter, 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, setTargetPointRel
 
Methods inherited from class y.base.Graph
addDataProvider, 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, reverseEdge, setGraphCopyFactory, sortEdges, sortEdges, sortNodes, toString, unhide, unhide
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeLabelMap

protected NodeMap nodeLabelMap
A NodeMap associating NodeLabelLayouts with the nodes of this graph.

See Also:
setLabelLayout(Node,NodeLabelLayout[])

edgeLabelMap

protected EdgeMap edgeLabelMap
An EdgeMap associating EdgeLabelLayouts with the edges of this graph.

See Also:
setLabelLayout(Edge, EdgeLabelLayout[])

nodeLabelFeatureMap

protected java.util.Map nodeLabelFeatureMap
A Map associating the owner of a node label with the node label itself.


edgeLabelFeatureMap

protected java.util.Map edgeLabelFeatureMap
A Map associating the owner of an edge label with the edge label itself.

Constructor Detail

DefaultLayoutGraph

public DefaultLayoutGraph()
Creates a new DefaultLayoutGraph instance with default settings.


DefaultLayoutGraph

public DefaultLayoutGraph(LayoutGraph argGraph)
Creates a new DefaultLayoutGraph instance which is a copy of the given graph.

Parameters:
argGraph - the original graph

DefaultLayoutGraph

public DefaultLayoutGraph(LayoutGraph graph,
                          YCursor nodeSubset)
Creates a new DefaultLayoutGraph instance which is a copy of the given subgraph.

Parameters:
graph - the original graph
nodeSubset - the nodes that induce a subgraph of the original graph

DefaultLayoutGraph

public DefaultLayoutGraph(DefaultLayoutGraph graph,
                          YCursor nodeSubset)
Creates a new DefaultLayoutGraph instance which is a copy of the given subgraph.

Parameters:
graph - the original graph
nodeSubset - the nodes that induce a subgraph of the original graph
Method Detail

createGraphCopyFactory

protected GraphCopier.CopyFactory createGraphCopyFactory()
Creates a factory that creates a LayoutGraph when copying a graph using GraphCopier.

This implementation returns a factory which can handle copying hierarchically grouped graphs.

Specified by:
createGraphCopyFactory in class LayoutGraph
Returns:
a new instance of GraphCopier.CopyFactory that builds up a CopiedLayoutGraph
See Also:
LayoutGraphCopyFactory.HierarchicGraphCopyFactory

getLayout

public NodeLayout getLayout(Node node)
Description copied from class: LayoutGraph
Returns the layout information for the given node.

The layout information consists of the location and size of the node.

Specified by:
getLayout in class LayoutGraph
Parameters:
node - the node
Returns:
the layout information for the node

setLayout

public void setLayout(Node node,
                      NodeLayout layout)
Specifies the layout information for the given node.

The layout information consists of the location and size of the node.

Parameters:
node - the node
layout - the layout information for the node

setLayout

public void setLayout(Edge edge,
                      EdgeLayout layout)
Specifies the layout information for the given edge.

The layout information consists of the locations of the control and end points of the edge.

Parameters:
edge - the edge
layout - the layout information for the edge

getLayout

public EdgeLayout getLayout(Edge edge)
Description copied from class: LayoutGraph
Returns the layout information for the given edge.

The layout information consists of the locations of the control points and end points of the edge.

Specified by:
getLayout in class LayoutGraph
Parameters:
edge - the edge
Returns:
the layout information for the edge

getLabelLayout

public NodeLabelLayout[] getLabelLayout(Node node)
Description copied from class: LayoutGraph
Returns the layout information for all labels associated with the given node.

The layout information consists of the location, size and orientation of the label.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
node - the node
Returns:
the layout information for the node's labels

setLabelLayout

public void setLabelLayout(Node node,
                           NodeLabelLayout layout)
Specifies the layout information for all associated labels of the given node in case there is only one label.

The layout information consists of the location, size and orientation of the label.

Parameters:
node - the node
layout - the layout information for the label of the node

setLabelLayout

public void setLabelLayout(Node node,
                           NodeLabelLayout[] layout)
Specifies the layout information for all associated labels of the given node.

The layout information consists of the location, size and orientation of the label.

Parameters:
node - the node
layout - the layout information for the labels of the node

setLabelLayout

public void setLabelLayout(Edge edge,
                           EdgeLabelLayout[] layout)
Specifies the layout information for all associated labels of the given edge.

The layout information consists of the location, size and orientation of the label.

Parameters:
edge - the edge
layout - the layout information for the labels of the edge

getLabelLayout

public EdgeLabelLayout[] getLabelLayout(Edge edge)
Description copied from class: LayoutGraph
Returns the layout information for all labels associated with the given edge.

The layout information consists of the location, size and orientation of the label.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
edge - the edge
Returns:
the layout information for the edge's labels

getFeature

public Node getFeature(NodeLabelLayout labelLayout)
Description copied from class: LayoutGraph
Returns the node to which the given NodeLabelLayout belongs.

Specified by:
getFeature in class LayoutGraph
Parameters:
labelLayout - the label's layout information
Returns:
the node that owns the label

getFeature

public Edge getFeature(EdgeLabelLayout labelLayout)
Description copied from class: LayoutGraph
Returns the edge to which the given EdgeLabelLayout belongs.

Specified by:
getFeature in class LayoutGraph
Parameters:
labelLayout - the label's layout information
Returns:
the edge that owns the label

createEdgeLayout

protected EdgeLayout createEdgeLayout()
Creates a new implementation of EdgeLayout.

This method is called by getLayout(Edge) if there is no layout information assigned to an edge, yet. It may be overridden to create custom EdgeLayouts.

Returns:
the layout of an edge

createNodeLayout

protected NodeLayout createNodeLayout()
Creates a new implementation of NodeLayout.

This method is called by getLayout(Node) if there is no layout information assigned to a node, yet. It may be overridden to create custom NodeLayouts.

Returns:
the layout of a node

createLabelFactory

protected LabelLayoutFactory createLabelFactory()
Description copied from class: LayoutGraph
Creates a new LabelLayoutFactory for this LayoutGraph that can be used for copying layout information of labels.

Specified by:
createLabelFactory in class LayoutGraph
Returns:
the new LabelLayoutFactory

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.