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 java.lang.Object
implements ElementInfoManager

This class represents the layout context. It provides several methods to access data as well as adding and removing elements.

 
Your browser does not support SVG content.

Method Summary
 void addEdgeLabel(EdgeLabelLayout label, Edge labeledElement)
          Adds a label to a given edge.
 void addNodeLabel(NodeLabelLayout label, Node labeledElement)
          Adds a label to a given node.
 Edge createEdge(Node source, Node target, java.lang.Object sameDataElementId)
          All methods of the ElementFactory have to use this method to create an edge.
 Node createNode(java.lang.Object sameDataElementId)
          All methods of the ElementFactory have to use this method to create a node.
 EdgeInfo getEdgeInfo(Edge edge)
          Returns the edge information object of the given edge.
 EdgeLabelInfo getEdgeLabelInfo(EdgeLabelLayout edgeLabelLayout)
          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 node)
          Returns the node information object of the given node.
 NodeLabelInfo getNodeLabelInfo(NodeLabelLayout nodeLabelLayout)
          Returns the node label layout information object of the given node label layout.
 Edge getOriginalEdge(java.lang.Object id)
          Returns the edge of the input graph with the given ID or null if there is no such edge.
 Node getOriginalNode(java.lang.Object id)
          Returns the node of the input graph with the given ID or null if there is no such node.
 Edge getPageEdge(java.lang.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(java.lang.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 a given edge.
 boolean removeNodeLabel(NodeLabelLayout label, Node labeledElement)
          Removes a label from a given 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,
                       java.lang.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(java.lang.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 given node.

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

addEdgeLabel

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

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

removeNodeLabel

public boolean removeNodeLabel(NodeLabelLayout label,
                               Node labeledElement)
Removes a label from a given 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 a given 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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 edgeLabelLayout)
Description copied from interface: ElementInfoManager
Returns the edge label information object of the given edge label layout.

Specified by:
getEdgeLabelInfo in interface ElementInfoManager
Parameters:
edgeLabelLayout - 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 nodeLabelLayout)
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:
nodeLabelLayout - 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 node)
Description copied from interface: ElementInfoManager
Returns the node information object of the given node.

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

getEdgeInfo

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

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

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