All Packages Class Hierarchy This Package Previous Next Index
Class sunw.demo.sort.SortItem
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----sunw.demo.sort.SortItem
- public class SortItem
- extends Applet
- implements Runnable, MouseListener
A simple applet class to demonstrate a sort algorithm.
You can specify a sorting algorithm using the "alg"
attribyte. When you click on the applet, a thread is
forked which animates the sorting algorithm.
-
SortItem()
-
-
getAlgorithm()
-
-
init()
- Initialize the applet.
-
mouseClicked(MouseEvent)
-
-
mouseEntered(MouseEvent)
-
-
mouseExited(MouseEvent)
-
-
mousePressed(MouseEvent)
-
-
mouseReleased(MouseEvent)
-
-
paint(Graphics)
- Paint the array of numbers as a list
of horizontal lines of varying lenghts.
-
run()
- Run the sorting algorithm.
-
setAlgorithm(String)
-
-
start()
- (re)start the applet.
-
stop()
- Stop the applet.
-
update(Graphics)
- Update without erasing the background.
SortItem
public SortItem()
init
public void init()
- Initialize the applet.
- Overrides:
- init in class Applet
start
public void start()
- (re)start the applet.
- Overrides:
- start in class Applet
paint
public void paint(Graphics g)
- Paint the array of numbers as a list
of horizontal lines of varying lenghts.
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- Update without erasing the background.
- Overrides:
- update in class Component
run
public void run()
- Run the sorting algorithm. This method is
called by class Thread once the sorting algorithm
is started.
- See Also:
- run, mouseClicked
stop
public synchronized void stop()
- Stop the applet. Kill any sorting algorithm that
is still sorting.
- Overrides:
- stop in class Applet
mouseClicked
public void mouseClicked(MouseEvent evt)
mousePressed
public synchronized void mousePressed(MouseEvent evt)
mouseReleased
public void mouseReleased(MouseEvent evt)
mouseEntered
public void mouseEntered(MouseEvent evt)
mouseExited
public void mouseExited(MouseEvent evt)
getAlgorithm
public String getAlgorithm()
setAlgorithm
public void setAlgorithm(String alg)
All Packages Class Hierarchy This Package Previous Next Index