y.layout
Class CopiedLayoutGraph

java.lang.Object
  |
  +--y.base.Graph
        |
        +--y.layout.LayoutGraph
              |
              +--y.layout.CopiedLayoutGraph
All Implemented Interfaces:
GraphInterface, GraphLayout

public class CopiedLayoutGraph
extends LayoutGraph

This is a LayoutGraph implementation that serves as a copy of another LayoutGraph or as copy of a combined GraphInterface and and GraphLayout interface implementation.


Field Summary
 
Fields inherited from class y.base.Graph
AFTER, BEFORE, listeners
 
Constructor Summary
CopiedLayoutGraph(GraphInterface graph, GraphLayout layout)
          Initializes this graph as a copy of the given graph interface and graph layout.
CopiedLayoutGraph(LayoutGraph graph)
          Initializes this graph as a copy of the given graph
 
Method Summary
 void commitLayoutToOriginalGraph()
          Writes the current layout information to the original graph.
 Edge getCopiedEdge(Object e)
          Returns the copied edge that corresponds to the given original edge.
 Node getCopiedNode(Object v)
          Returns the copied node that corresponds to the given original node.
 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 e)
          Returns EdgeLabelLayout objects which describe the layouts of the labels that belong to the given edge.
 NodeLabelLayout[] getLabelLayout(Node v)
          Returns NodeLabelLayout objects which describe the layouts of the labels that belong 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.
 Object getOriginalEdge(Edge e)
          Returns the original edge that corresponds to the given edge.
 Object getOriginalNode(Node v)
          Returns the original node that corresponds to 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, getGraphListeners, getNodeArray, getRegisteredEdgeMaps, getRegisteredNodeMaps, getSource, getTarget, hide, hide, isEmpty, lastEdge, lastNode, moveSubGraph, moveToFirst, moveToFirst, moveToLast, moveToLast, N, nodeCount, nodeObjects, nodes, printNodeSlotSize, reInsertEdge, reInsertNode, removeDataProvider, removeEdge, removeGraphListener, removeNode, reverseEdge, sortEdges, toString, unhide, unhide
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CopiedLayoutGraph

public CopiedLayoutGraph(LayoutGraph graph)
Initializes this graph as a copy of the given graph


CopiedLayoutGraph

public CopiedLayoutGraph(GraphInterface graph,
                         GraphLayout layout)
Initializes this graph as a copy of the given graph interface and graph layout.

Method Detail

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.

getLayout

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

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

getLabelLayout

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

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

getLabelLayout

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

Specified by:
getLabelLayout in class LayoutGraph
Parameters:
e - 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

commitLayoutToOriginalGraph

public void commitLayoutToOriginalGraph()
Writes the current layout information to the original graph. Works only when the graph was constructed as copy of another graph.


getOriginalNode

public Object getOriginalNode(Node v)
Returns the original node that corresponds to the given node.

Parameters:
v - a node in this graph that is a copy of the returned node
Returns:
a node in the original graph whose copy is the given node

getOriginalEdge

public Object getOriginalEdge(Edge e)
Returns the original edge that corresponds to the given edge.

Parameters:
e - an edge in this graph that is a copy of the returned edge
Returns:
an edge in the original graph whose copy is the given edge

getCopiedNode

public Node getCopiedNode(Object v)
Returns the copied node that corresponds to the given original node.

Parameters:
v - a node in the original graph whose copy is in this graph
Returns:
a node in this graph that is the copy of the given original node

getCopiedEdge

public Edge getCopiedEdge(Object e)
Returns the copied edge that corresponds to the given original edge.

Parameters:
e - an edge in the original graph whose copy is in this graph
Returns:
an edge in this graph that is the copy of the given original edge

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

2003