Class GraphPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----GraphPanel
- public class GraphPanel
- extends Panel
- implements Runnable, MouseListener, MouseMotionListener
A panel representing and showing a directed graph. Graph layout is performed by an iterative algorithm in a background thread
-
delay
- Delay between each layout iteration
-
firstSpreadDone
-
-
nIterations
- Number of layout iterations since the last spreadNodes() of nodes
-
random
-
-
relaxer
- The Thread object providing background processing
-
stress
-
-
getMinimumSize()
-
-
getPreferredSize()
- Guess the space we may need
-
mouseClicked(MouseEvent)
-
-
mouseDragged(MouseEvent)
-
-
mouseEntered(MouseEvent)
-
-
mouseExited(MouseEvent)
-
-
mouseMoved(MouseEvent)
-
-
mousePressed(MouseEvent)
-
-
mouseReleased(MouseEvent)
-
-
processMouseEvent(MouseEvent)
-
-
run()
-
-
start()
- Randomize the nodes so the algorithm may later converge, and start the layout/redraw thread
-
stop()
-
-
update(Graphics)
- Draws the graph, asking help to Edge and Node.
nIterations
public long nIterations
- Number of layout iterations since the last spreadNodes() of nodes
relaxer
protected Thread relaxer
- The Thread object providing background processing
stress
public boolean stress
random
public boolean random
delay
public long delay
- Delay between each layout iteration
firstSpreadDone
protected boolean firstSpreadDone
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class Container
getPreferredSize
public Dimension getPreferredSize()
- Guess the space we may need
- Overrides:
- getPreferredSize in class Container
run
public void run()
update
public synchronized void update(Graphics g)
- Draws the graph, asking help to Edge and Node. Done here instead of paint() to avoid flickering
- Overrides:
- update in class Container
mouseEntered
public void mouseEntered(MouseEvent e)
mousePressed
public synchronized void mousePressed(MouseEvent e)
processMouseEvent
public void processMouseEvent(MouseEvent e)
- Overrides:
- processMouseEvent in class Component
mouseClicked
public void mouseClicked(MouseEvent e)
mouseDragged
public synchronized void mouseDragged(MouseEvent e)
mouseMoved
public void mouseMoved(MouseEvent e)
mouseReleased
public synchronized void mouseReleased(MouseEvent e)
mouseExited
public void mouseExited(MouseEvent e)
start
public void start()
- Randomize the nodes so the algorithm may later converge, and start the layout/redraw thread
stop
public void stop()
|