edu.iu.cnets.klatsch.gui
Class WidgetGraph

java.lang.Object
  extended by edu.iu.cnets.klatsch.gui.Widget
      extended by edu.iu.cnets.klatsch.gui.WidgetGraph

public class WidgetGraph
extends Widget

The graph widget displays a visual layout of a graph.


Nested Class Summary
(package private)  class WidgetGraph.Location
           
(package private)  class WidgetGraph.Velocity
           
 
Field Summary
(package private)  Graph g
          the graph we're showing
(package private)  java.util.Map<java.lang.Object,WidgetGraph.Location> layout
          the current layout for the graph
 
Fields inherited from class edu.iu.cnets.klatsch.gui.Widget
parent, x1, x2, y1, y2
 
Constructor Summary
WidgetGraph(KlatschGui parent, Graph g, java.lang.String layout)
          Initializes a new graph widget.
 
Method Summary
protected  void draw()
          Draws the current graph.
(package private)  void layoutEnergy()
          Updates the layout using the Kamada-Kawai energy-based algorithm (or a crappy approximation to it).
(package private)  void layoutRadial()
          Positions the nodes radially.
(package private)  void layoutRandom()
          Positions the nodes randomly.
 
Methods inherited from class edu.iu.cnets.klatsch.gui.Widget
clear, in, keyPressed, keyReleased, mouseDragged, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

g

Graph g
the graph we're showing


layout

java.util.Map<java.lang.Object,WidgetGraph.Location> layout
the current layout for the graph

Constructor Detail

WidgetGraph

public WidgetGraph(KlatschGui parent,
                   Graph g,
                   java.lang.String layout)
Initializes a new graph widget.

Method Detail

draw

protected void draw()
Draws the current graph.

Specified by:
draw in class Widget

layoutEnergy

void layoutEnergy()
Updates the layout using the Kamada-Kawai energy-based algorithm (or a crappy approximation to it).


layoutRadial

void layoutRadial()
Positions the nodes radially.


layoutRandom

void layoutRandom()
Positions the nodes randomly.