Search this API

y.layout.multipage
Class LayoutContext

java.lang.Object
  extended by y.layout.multipage.LayoutContext
All Implemented Interfaces:
ElementInfoManager

public class LayoutContext
extends Object
implements ElementInfoManager

Class that represents the layout context.


Method Summary
 void addEdgeLabel(EdgeLabelLayout label, Edge labeledElement)
          Adds a label to an edge.
 void addNodeLabel(NodeLabelLayout label, Node labeledElement)
          Adds a label to a node.
 Edge createEdge(Node source, Node target, Object sameDataElementId)
          All methods of the ElementFactory have to use this method to create an edge.
 Node createNode(Object sameDataElementId)
          All methods of the ElementFactory have to use this method to create a node.
 EdgeInfo getEdgeInfo(Edge e)
          Returns the edge information object of the given edge.
 EdgeLabelInfo getEdgeLabelInfo(EdgeLabelLayout ell)
          Returns the edge label information object of the given edge label layout.
 LayoutGraph getGraph()
          Returns the relevant graph.
 MultiPageLayouter getLayouter()
          Returns the layouter object that belongs to this layout context.
 NodeInfo getNodeInfo(Node n)
          Returns the node information object of the given node.
 NodeLabelInfo getNodeLabelInfo(NodeLabelLayout nll)
          Returns the node label layout information object of the given node label layout.
 Edge getOriginalEdge(Object id)
          Returns the edge of the input graph with the given id or null if there is no such edge.
 Node getOriginalNode(Object id)
          Returns the node of the input graph with the given id or null if there is no such node.
 Edge getPageEdge(Object id)
          Returns the edge of a page graph (a graph that represents the result of the multi page layout) with the given id or null if there is no such edge.
 Node getPageNode(Object id)
          Returns the node of a page graph (a graph that represents the result of the multi page layout) with the given id or null if there is no such node.
 boolean removeEdgeLabel(EdgeLabelLayout label, Edge labeledElement)
          Removes a label from an edge.
 boolean removeNodeLabel(NodeLabelLayout label, Node labeledElement)
          Removes a label from a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createEdge

public Edge createEdge(Node source,
                       Node target,
                       Object sameDataElementId)
All methods of the ElementFactory have to use this method to create an edge.

Parameters:
source - the source of the edge.
target - the target of the edge.
sameDataElementId - the id of the edge whose data should be copied to the created edge (or null if no data should be copied).
Returns:
the created edge.
See Also:
ElementFactory

createNode

public Node createNode(Object sameDataElementId)
All methods of the ElementFactory have to use this method to create a node.

Parameters:
sameDataElementId - the id of the node whose data should be copied to the created node (or null if no data should be copied).
Returns:
the created node.
See Also:
ElementFactory

addNodeLabel

public void addNodeLabel(NodeLabelLayout label,
                         Node labeledElement)
Adds a label to a node.

Parameters:
label - the label that should be added to the node.
labeledElement - the node the label should be added to.

addEdgeLabel

public void addEdgeLabel(EdgeLabelLayout label,
                         Edge labeledElement)
Adds a label to an edge.

Parameters:
label - the label that should be added to the edge.
labeledElement - the edge the label should be added to.

removeNodeLabel

public boolean removeNodeLabel(NodeLabelLayout label,
                               Node labeledElement)
Removes a label from a node.

Parameters:
label - the label that should be removed.
labeledElement - the node owning the label.

removeEdgeLabel

public boolean removeEdgeLabel(EdgeLabelLayout label,
                               Edge labeledElement)
Removes a label from an edge.

Parameters:
label - the label that should be removed.
labeledElement - the edge owning the label.

getGraph

public LayoutGraph getGraph()
Returns the relevant graph.

Returns:
the relevant graph.

getLayouter

public MultiPageLayouter getLayouter()
Returns the layouter object that belongs to this layout context.

Returns:
the layouter object that belongs to this layout context.

getPageNode

public Node getPageNode(Object id)
Returns the node of a page graph (a graph that represents the result of the multi page layout) with the given id or null if there is no such node.

Parameters:
id - the id of the node that should be returned.
Returns:
the node of a page graph with the given id or null if there is no such node.

getPageEdge

public Edge getPageEdge(Object id)
Returns the edge of a page graph (a graph that represents the result of the multi page layout) with the given id or null if there is no such edge.

Parameters:
id - the id of the edge that should be returned.
Returns:
the edge of a page graph with the given id or null if there is no such edge.

getOriginalNode

public Node getOriginalNode(Object id)
Returns the node of the input graph with the given id or null if there is no such node.

Parameters:
id - the id of the node that should be returned.
Returns:
the node of the input graph with the given id or null if there is no such node.

getOriginalEdge

public Edge getOriginalEdge(Object id)
Returns the edge of the input graph with the given id or null if there is no such edge.

Parameters:
id - the id of the edge that should be returned.
Returns:
the edge of the input graph with the given id or null if there is no such edge.

getEdgeLabelInfo

public EdgeLabelInfo getEdgeLabelInfo(EdgeLabelLayout ell)
Description copied from interface: ElementInfoManager
Returns the edge label information object of the given edge label layout.

Specified by:
getEdgeLabelInfo in interface ElementInfoManager
Parameters:
ell - the edge label layout for which the information object should be returned.
Returns:
the edge label information object of the given edge label layout.

getNodeLabelInfo

public NodeLabelInfo getNodeLabelInfo(NodeLabelLayout nll)
Description copied from interface: ElementInfoManager
Returns the node label layout information object of the given node label layout.

Specified by:
getNodeLabelInfo in interface ElementInfoManager
Parameters:
nll - the node label layout for which the information object should be returned.
Returns:
the node label information object of the given node label layout.

getNodeInfo

public NodeInfo getNodeInfo(Node n)
Description copied from interface: ElementInfoManager
Returns the node information object of the given node.

Specified by:
getNodeInfo in interface ElementInfoManager
Parameters:
n - the node for which the information object should be returned.
Returns:
the node information object of the given node.

getEdgeInfo

public EdgeInfo getEdgeInfo(Edge e)
Description copied from interface: ElementInfoManager
Returns the edge information object of the given edge.

Specified by:
getEdgeInfo in interface ElementInfoManager
Parameters:
e - the edge for which the information object should be returned.
Returns:
the edge information object of the given edge.

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