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