pedviz.graph
Class LayoutedGraph<N extends NodeView,E extends EdgeView>

java.lang.Object
  extended by pedviz.graph.LayoutedGraph<N,E>
Type Parameters:
N -
E -
All Implemented Interfaces:
NodeViewListener

public class LayoutedGraph<N extends NodeView,E extends EdgeView>
extends java.lang.Object
implements NodeViewListener

This class contains all layout informations for a Graph object. A single Graph can have one or more layouts.

Author:
Luki

Constructor Summary
LayoutedGraph(Graph graph, Layout layout, DefaultNodeView defaultNodeView, DefaultEdgeView defaultEdgeView)
          Creates a new LayoutedGaph object for the given Graph object with the given settings.
 
Method Summary
 java.util.HashMap<java.lang.Object,N> getAllNodes()
          Returns a collection of all nodes and all subnodes.
 java.awt.geom.Rectangle2D.Float getBounds()
           
 DefaultEdgeView getDefaultEdgeView()
          Returns the edge settings.
 DefaultNodeView getDefaultNodeView()
          Returns the node settings.
 java.util.ArrayList<E> getEdges()
          Returns a collection of all edges.
 Graph getGraph()
          Returns the Graph object.
 java.util.Collection<N> getNodes()
          Returns a collection of all nodes.
 N getNodeView(Node node)
           
 N getNodeView(java.lang.Object id)
          Returns the NodeView object by the given id.
 java.lang.Float getPosHierarchie(int i)
           
 java.util.Collection<N> getSubNodes()
          Returns a collection of all subnodes.
 void nodeChanged(NodeViewEvent event)
          Update bounds
 void setBounds(float x, float y, float width, float height)
           
 void setDefaultEdgeView(DefaultEdgeView defaultEdgeView)
          Sets the edge settings.
 void setDefaultNodeView(DefaultNodeView defaultNodeView)
          Sets the node settings.
 void setPosHierarchie(int i, float pos)
           
 void updateModel()
          Reloads all nodes and edges from the Graph object and updates the existing model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutedGraph

public LayoutedGraph(Graph graph,
                     Layout layout,
                     DefaultNodeView defaultNodeView,
                     DefaultEdgeView defaultEdgeView)
Creates a new LayoutedGaph object for the given Graph object with the given settings.

Parameters:
graph - Graph object.
layout - Layout object.
defaultNodeView - node settings.
defaultEdgeView - edge settings.
Method Detail

getEdges

public java.util.ArrayList<E> getEdges()
Returns a collection of all edges.

Returns:
a collection of all edges.

getGraph

public Graph getGraph()
Returns the Graph object.

Returns:
the Graph object.

getNodes

public java.util.Collection<N> getNodes()
Returns a collection of all nodes.

Returns:
a collection of all nodes.

getSubNodes

public java.util.Collection<N> getSubNodes()
Returns a collection of all subnodes.

Returns:
a collection of all subnodes.

getAllNodes

public java.util.HashMap<java.lang.Object,N> getAllNodes()
Returns a collection of all nodes and all subnodes.

Returns:
a collection of all nodes and all subnodes.

getNodeView

public N getNodeView(java.lang.Object id)
Returns the NodeView object by the given id.

Parameters:
id - the id of a node.
Returns:
the NodeView object by the given id.

getNodeView

public N getNodeView(Node node)

getDefaultEdgeView

public DefaultEdgeView getDefaultEdgeView()
Returns the edge settings.

Returns:
the edge settings.

setDefaultEdgeView

public void setDefaultEdgeView(DefaultEdgeView defaultEdgeView)
Sets the edge settings.

Parameters:
defaultEdgeView - the edge settings.

getDefaultNodeView

public DefaultNodeView getDefaultNodeView()
Returns the node settings.

Returns:
the node settings.

setDefaultNodeView

public void setDefaultNodeView(DefaultNodeView defaultNodeView)
Sets the node settings.

Parameters:
defaultNodeView - the node settings.

updateModel

public void updateModel()
Reloads all nodes and edges from the Graph object and updates the existing model.


nodeChanged

public void nodeChanged(NodeViewEvent event)
Update bounds

Specified by:
nodeChanged in interface NodeViewListener
Parameters:
event - informations about the event.

getBounds

public java.awt.geom.Rectangle2D.Float getBounds()

setBounds

public void setBounds(float x,
                      float y,
                      float width,
                      float height)

getPosHierarchie

public java.lang.Float getPosHierarchie(int i)

setPosHierarchie

public void setPosHierarchie(int i,
                             float pos)