Search this API

y.layout
Class DefaultGraphLayout

java.lang.Object
  extended by y.layout.DefaultGraphLayout
All Implemented Interfaces:
GraphLayout

public class DefaultGraphLayout
extends java.lang.Object
implements GraphLayout

DefaultGraphLayout is a default implementation of the GraphLayout interface.

It provides layout information for nodes, edges and their associated labels as well as the graph as a whole.

 

Constructor Summary
DefaultGraphLayout()
          Creates a new DefaultGraphLayout instance.
 
Method Summary
 java.awt.Rectangle getBoundingBox()
          Returns the bounding box of this GraphLayout.
 EdgeLabelLayout[] getEdgeLabelLayout(java.lang.Object edge)
          Returns the layout information for all edge labels belonging to the given edge.
 EdgeLayout getEdgeLayout(java.lang.Object edge)
          Returns the layout information associated with the given edge.
 NodeLabelLayout[] getNodeLabelLayout(java.lang.Object node)
          Returns the layout information for all node labels belonging to the given node.
 NodeLayout getNodeLayout(java.lang.Object node)
          Returns the layout information associated with the given node.
 void setEdgeLabelLayout(java.lang.Object edge, EdgeLabelLayout[] layout)
          Specifies the layout information for all edge labels belonging to the given edge.
 void setEdgeLayout(java.lang.Object edge, EdgeLayout layout)
          Specifies the layout information associated with the given edge.
 void setNodeLabelLayout(java.lang.Object node, NodeLabelLayout[] layout)
          Specifies the layout information for all node labels belonging to the given node.
 void setNodeLayout(java.lang.Object node, NodeLayout layout)
          Specifies the layout information associated with the given node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGraphLayout

public DefaultGraphLayout()
Creates a new DefaultGraphLayout instance.

Method Detail

setNodeLayout

public void setNodeLayout(java.lang.Object node,
                          NodeLayout layout)
Specifies the layout information associated with the given node.

This information contains the location and size of the node.

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

setEdgeLayout

public void setEdgeLayout(java.lang.Object edge,
                          EdgeLayout layout)
Specifies the layout information associated with the given edge.

This information contains the coordinates of the source and target points as well as the coordinates of all control points.

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

getEdgeLayout

public EdgeLayout getEdgeLayout(java.lang.Object edge)
Description copied from interface: GraphLayout
Returns the layout information associated with the given edge.

This information contains the coordinates of the source and target points as well as the coordinates of all control points.

Specified by:
getEdgeLayout in interface GraphLayout
Parameters:
edge - the edge
Returns:
the layout information for the edge

getNodeLayout

public NodeLayout getNodeLayout(java.lang.Object node)
Description copied from interface: GraphLayout
Returns the layout information associated with the given node.

This information contains the location and size of the node.

Specified by:
getNodeLayout in interface GraphLayout
Parameters:
node - the node
Returns:
the layout information for the node

setNodeLabelLayout

public void setNodeLabelLayout(java.lang.Object node,
                               NodeLabelLayout[] layout)
Specifies the layout information for all node labels belonging to the given node.

This information contains the location and size of the labels.

Parameters:
node - the node that owns the labels
layout - the array of all labels that belong to the node

getNodeLabelLayout

public NodeLabelLayout[] getNodeLabelLayout(java.lang.Object node)
Description copied from interface: GraphLayout
Returns the layout information for all node labels belonging to the given node.

This information contains the location and size of the labels.

Specified by:
getNodeLabelLayout in interface GraphLayout
Parameters:
node - the node that owns the labels
Returns:
the array of all labels that belong to the given node

setEdgeLabelLayout

public void setEdgeLabelLayout(java.lang.Object edge,
                               EdgeLabelLayout[] layout)
Specifies the layout information for all edge labels belonging to the given edge.

This information contains the location and size of the labels.

Parameters:
edge - the edge that owns the labels
layout - the array of all labels that belong to the edge

getEdgeLabelLayout

public EdgeLabelLayout[] getEdgeLabelLayout(java.lang.Object edge)
Description copied from interface: GraphLayout
Returns the layout information for all edge labels belonging to the given edge.

This information contains the location and size of the labels.

Specified by:
getEdgeLabelLayout in interface GraphLayout
Parameters:
edge - the edge that owns the labels
Returns:
the array of all labels that belong to the given edge

getBoundingBox

public java.awt.Rectangle getBoundingBox()
Description copied from interface: GraphLayout
Returns the bounding box of this GraphLayout.

This box is the smallest rectangular area that contains all layout elements in this GraphLayout.

Specified by:
getBoundingBox in interface GraphLayout
Returns:
the surrounding box of all elements of the graph

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