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

This class is a default implementation of the abstract class LayoutGraph.


Field Summary
protected  Map edgeLabelFeatureMap
          Map used to associate the owner of an edge label with the edge label itself.
protected  EdgeMap edgeLabelMap
          EdgeMap used to associate edge label layouts with the edges of this graph.
protected  Map nodeLabelFeatureMap
          Map used to associate the owner of a node label with the node label itself.
protected  NodeMap nodeLabelMap
          NodeMap used to associate node label layouts with the nodes of this graph.
 
Fields inherited from class y.base.Graph
AFTER, BEFORE
 
Constructor Summary
DefaultLayoutGraph()
          Creates a new Layout Graph
DefaultLayoutGraph(DefaultLayoutGraph graph, YCursor nodeSubset)
          Creates a copy of the given subgraph.
DefaultLayoutGraph(LayoutGraph argGraph)
          Creates a copy of the given subgraph.
DefaultLayoutGraph(LayoutGraph graph, YCursor nodeSubset)
          Creates a copy of the given subgraph.
 
Method Summary
protected  EdgeLayout createEdgeLayout()
          Override this to create your own EdgeLayouts.
protected  GraphCopier.CopyFactory createGraphCopyFactory()
          Creates a new LayoutGraphCopyFactory.HierarchicGraphCopyFactory.
protected  NodeLayout createNodeLayout()
          Override this to create your own NodeLayouts.
 Edge getFeature(EdgeLabelLayout labelLayout)
          Returns the edge which is described by a given label layout.
 Node getFeature(NodeLabelLayout labelLayout)
          Returns the node which is described by a given label layout.
 EdgeLabelLayout[] getLabelLayout(Edge edge)
          Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
 NodeLabelLayout[] getLabelLayout(Node node)
          Returns NodeLabelLayout objects that describe the layouts of the labels belonging to the given node.
 EdgeLayout getLayout(Edge e)
          Returns the layout information for an edge in the drawing.
 NodeLayout getLayout(Node v)
          Returns the layout information for a node in the drawing.
 void setLabelLayout(Edge edge, EdgeLabelLayout[] layout)
          Sets the EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
 void setLabelLayout(Node node, NodeLabelLayout layout)
          Sets the NodeLabelLayout object which describes the layout of the label that belongs to the given node.
 void setLabelLayout(Node node, NodeLabelLayout[] llayout)
          Sets the NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.
 void setLayout(Edge e, EdgeLayout layout)
          Sets the layout information for an edge in the drawing.
 void setLayout(Node v, NodeLayout layout)
          Sets the layout information for a node in the drawing.
 
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
NodeMap used to associate node label layouts with the nodes of this graph.

See Also:
setLabelLayout(y.base.Node,NodeLabelLayout[])

edgeLabelMap

protected EdgeMap edgeLabelMap
EdgeMap used to associate edge label layouts with the edges of this graph.

See Also:
setLabelLayout(y.base.Edge, EdgeLabelLayout[])

nodeLabelFeatureMap

protected Map nodeLabelFeatureMap
Map used to associate the owner of a node label with the node label itself.


edgeLabelFeatureMap

protected Map edgeLabelFeatureMap
Map used to associate the owner of an edge label with the edge label itself.

Constructor Detail

DefaultLayoutGraph

public DefaultLayoutGraph()
Creates a new Layout Graph


DefaultLayoutGraph

public DefaultLayoutGraph(LayoutGraph argGraph)
Creates a copy of the given subgraph.


DefaultLayoutGraph

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


DefaultLayoutGraph

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

Method Detail

createGraphCopyFactory

protected GraphCopier.CopyFactory createGraphCopyFactory()
Creates a new LayoutGraphCopyFactory.HierarchicGraphCopyFactory.

Specified by:
createGraphCopyFactory in class LayoutGraph
Returns:
the (possibly shared) instance.

getLayout

public NodeLayout getLayout(Node v)
Returns the layout information for a node in the drawing.

Specified by:
getLayout in class LayoutGraph
Parameters:
v - a node in the drawing.
Returns:
the layout information for node.

setLayout

public void setLayout(Node v,
                      NodeLayout layout)
Sets the layout information for a node in the drawing.


setLayout

public void setLayout(Edge e,
                      EdgeLayout layout)
Sets the layout information for an edge in the drawing.


getLayout

public EdgeLayout getLayout(Edge e)
Returns the layout information for an edge in the drawing.

Specified by:
getLayout in class LayoutGraph
Parameters:
e - a edge in the drawing.
Returns:
the layout information for the given edge.

getLabelLayout

public NodeLabelLayout[] getLabelLayout(Node node)
Returns NodeLabelLayout objects that describe the layouts of the labels belonging to the given node.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
node - a node in the drawing.
Returns:
the node label layout information for the given node.

setLabelLayout

public void setLabelLayout(Node node,
                           NodeLabelLayout layout)
Sets the NodeLabelLayout object which describes the layout of the label that belongs to the given node.

Parameters:
node - a node in the drawing.
layout - a layout object for the node label

setLabelLayout

public void setLabelLayout(Node node,
                           NodeLabelLayout[] llayout)
Sets the NodeLabelLayout objects which describe the layouts of the labels that belong to the given node.

Parameters:
node - a node in the drawing.
llayout - an array of node label layout objects

setLabelLayout

public void setLabelLayout(Edge edge,
                           EdgeLabelLayout[] layout)
Sets the EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.

Parameters:
edge - an edge in the drawing.
layout - an array of edge label layout objects

getLabelLayout

public EdgeLabelLayout[] getLabelLayout(Edge edge)
Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
edge - an edge in the drawing.
Returns:
the edge label layout information for the given edge.

getFeature

public Node getFeature(NodeLabelLayout labelLayout)
Returns the node which is described by a given label layout.

Specified by:
getFeature in class LayoutGraph

getFeature

public Edge getFeature(EdgeLabelLayout labelLayout)
Returns the edge which is described by a given label layout.

Specified by:
getFeature in class LayoutGraph

createEdgeLayout

protected EdgeLayout createEdgeLayout()
Override this to create your own EdgeLayouts.


createNodeLayout

protected NodeLayout createNodeLayout()
Override this to create your own NodeLayouts.


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