All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class websphinx.util.GraphLayout

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----websphinx.util.GraphLayout

public class GraphLayout
extends Canvas
implements Runnable, ImageObserver

Constructor Index

 o GraphLayout()
Make a GraphLayout.

Method Index

 o addEdge(RenderedEdge)
Add an edge.
 o addNode(RenderedNode)
Add a node.
 o changedGraph()
Notify background thread that the graph has changed.
 o clear()
Erase the graph.
 o finalize()
 o getAlgorithm()
Get the graph-drawing algorithm in use.
 o getAutomaticLayout()
Test whether the graph is laid out automatically.
 o getEdgeColor()
Get the edge color.
 o getFontMetrics()
 o getGraph()
Get the graph.
 o getInterval()
Get the refresh interval (measured in seconds).
 o getIterations()
Get the layout algorithm iterations per refresh.
 o getNodeCharge()
Get the node charge.
 o getNodeColor()
Get the node background color.
 o getQuiescent()
Test whether the graph is quiescent (not changing in the background).
 o getRestLength()
Get the default rest length for new edges.
 o getRunning()
Test whether the graph layout thread is running in the background
 o getSelectedEdge()
Get edge currently under the mouse pointer, or null if no edge is under the mouse.
 o getSelectedNode()
Get node currently under the mouse pointer, or null if no node is under the mouse.
 o getSpringConstant()
Get the spring constant.
 o getThreshold()
Get the threshold.
 o getTipColor()
Get the popup tip color.
 o handleEvent(Event)
 o imageUpdate(Image, int, int, int, int, int)
Handle a loaded image.
 o paint(Graphics)
 o pick(int, int)
Find the object (Node or Edge) at position (x,y) relative to the window.
 o placeNodeOnGraph(RenderedNode, double, double)
 o placeNodeOnScreen(RenderedNode, int, int)
 o removeEdge(RenderedEdge)
Remove an edge.
 o removeNode(RenderedNode)
Remove a node.
 o repaint()
Notify background thread that the view has changed.
 o run()
 o setAlgorithm(GDAlgorithm)
Set the graph-drawing algorithm.
 o setAutomaticLayout(boolean)
Set whether the graph is laid out automatically.
 o setEdgeColor(Color)
Set the edge color.
 o setFont(Font)
 o setGraph(Graph)
Set the graph.
 o setInterval(int)
Set the refresh interval (in seconds).
 o setIterations(int)
Set the layout algorithm iterations per refresh.
 o setNodeCharge(double)
Set the node charge.
 o setNodeColor(Color)
Set the node background color.
 o setRestLength(double)
Set the default rest length for new edges.
 o setSpringConstant(double)
Set the spring constant.
 o setThreshold(double)
Set the threshold.
 o setTipColor(Color)
Set the popup tip color.
 o showControlPanel()
Show control panel for changing graph layout parameters.
 o start()
Start automatic graph layout (in the background).
 o stop()
Stop automatic graph layout.
 o update(Graphics)

Constructors

 o GraphLayout
 public GraphLayout()
Make a GraphLayout.

Methods

 o clear
 public synchronized void clear()
Erase the graph.

 o getGraph
 public synchronized Graph getGraph()
Get the graph.

 o setGraph
 public synchronized void setGraph(Graph graph)
Set the graph.

 o getAlgorithm
 public synchronized GDAlgorithm getAlgorithm()
Get the graph-drawing algorithm in use.

 o setAlgorithm
 public synchronized void setAlgorithm(GDAlgorithm algorithm)
Set the graph-drawing algorithm.

 o getRestLength
 public synchronized double getRestLength()
Get the default rest length for new edges.

 o setRestLength
 public synchronized void setRestLength(double restLength)
Set the default rest length for new edges.

 o getSpringConstant
 public synchronized double getSpringConstant()
Get the spring constant.

 o setSpringConstant
 public synchronized void setSpringConstant(double springConstant)
Set the spring constant.

 o getNodeCharge
 public synchronized double getNodeCharge()
Get the node charge.

 o setNodeCharge
 public synchronized void setNodeCharge(double nodeCharge)
Set the node charge.

 o getInterval
 public synchronized int getInterval()
Get the refresh interval (measured in seconds).

 o setInterval
 public synchronized void setInterval(int interval)
Set the refresh interval (in seconds).

 o getIterations
 public synchronized int getIterations()
Get the layout algorithm iterations per refresh.

 o setIterations
 public synchronized void setIterations(int iterations)
Set the layout algorithm iterations per refresh.

 o getAutomaticLayout
 public synchronized boolean getAutomaticLayout()
Test whether the graph is laid out automatically.

 o setAutomaticLayout
 public synchronized void setAutomaticLayout(boolean f)
Set whether the graph is laid out automatically.

 o getQuiescent
 public synchronized boolean getQuiescent()
Test whether the graph is quiescent (not changing in the background).

 o getRunning
 public synchronized boolean getRunning()
Test whether the graph layout thread is running in the background

 o getThreshold
 public synchronized double getThreshold()
Get the threshold.

 o setThreshold
 public synchronized void setThreshold(double threshold)
Set the threshold.

 o getNodeColor
 public synchronized Color getNodeColor()
Get the node background color.

 o setNodeColor
 public synchronized void setNodeColor(Color nodeColor)
Set the node background color.

 o getEdgeColor
 public synchronized Color getEdgeColor()
Get the edge color.

 o setEdgeColor
 public synchronized void setEdgeColor(Color edgeColor)
Set the edge color.

 o getTipColor
 public synchronized Color getTipColor()
Get the popup tip color.

 o setTipColor
 public synchronized void setTipColor(Color tipColor)
Set the popup tip color.

 o getSelectedNode
 public synchronized RenderedNode getSelectedNode()
Get node currently under the mouse pointer, or null if no node is under the mouse.

 o getSelectedEdge
 public synchronized RenderedEdge getSelectedEdge()
Get edge currently under the mouse pointer, or null if no edge is under the mouse.

 o addNode
 public synchronized void addNode(RenderedNode node)
Add a node.

 o addEdge
 public synchronized void addEdge(RenderedEdge edge)
Add an edge.

 o removeNode
 public synchronized void removeNode(RenderedNode node)
Remove a node.

 o removeEdge
 public synchronized void removeEdge(RenderedEdge edge)
Remove an edge.

 o imageUpdate
 public synchronized boolean imageUpdate(Image img,
                                         int infoflags,
                                         int x,
                                         int y,
                                         int width,
                                         int height)
Handle a loaded image.

Overrides:
imageUpdate in class Component
 o start
 public synchronized void start()
Start automatic graph layout (in the background).

 o stop
 public synchronized void stop()
Stop automatic graph layout.

 o run
 public synchronized void run()
 o changedGraph
 public synchronized void changedGraph()
Notify background thread that the graph has changed.

 o repaint
 public synchronized void repaint()
Notify background thread that the view has changed.

Overrides:
repaint in class Component
 o showControlPanel
 public void showControlPanel()
Show control panel for changing graph layout parameters.

 o finalize
 protected void finalize() throws Throwable
Overrides:
finalize in class Object
 o placeNodeOnScreen
 public synchronized void placeNodeOnScreen(RenderedNode n,
                                            int x,
                                            int y)
 o placeNodeOnGraph
 public synchronized void placeNodeOnGraph(RenderedNode n,
                                           double x,
                                           double y)
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o paint
 public synchronized void paint(Graphics g)
Overrides:
paint in class Canvas
 o getFontMetrics
 public synchronized FontMetrics getFontMetrics()
 o setFont
 public synchronized void setFont(Font f)
Overrides:
setFont in class Component
 o handleEvent
 public boolean handleEvent(Event event)
Overrides:
handleEvent in class Component
 o pick
 public Object pick(int x,
                    int y)
Find the object (Node or Edge) at position (x,y) relative to the window.

Parameters:
x - X position
y - Y position
Returns:
topmost object under (x,y), or null if none

All Packages  Class Hierarchy  This Package  Previous  Next  Index