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.


Constructor Index

 o SortItem()

Method Index

 o getAlgorithm()
 o init()
Initialize the applet.
 o mouseClicked(MouseEvent)
 o mouseEntered(MouseEvent)
 o mouseExited(MouseEvent)
 o mousePressed(MouseEvent)
 o mouseReleased(MouseEvent)
 o paint(Graphics)
Paint the array of numbers as a list of horizontal lines of varying lenghts.
 o run()
Run the sorting algorithm.
 o setAlgorithm(String)
 o start()
(re)start the applet.
 o stop()
Stop the applet.
 o update(Graphics)
Update without erasing the background.

Constructors

 o SortItem
 public SortItem()

Methods

 o init
 public void init()
Initialize the applet.

Overrides:
init in class Applet
 o start
 public void start()
(re)start the applet.

Overrides:
start in class Applet
 o 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
 o update
 public void update(Graphics g)
Update without erasing the background.

Overrides:
update in class Component
 o 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
 o stop
 public synchronized void stop()
Stop the applet. Kill any sorting algorithm that is still sorting.

Overrides:
stop in class Applet
 o mouseClicked
 public void mouseClicked(MouseEvent evt)
 o mousePressed
 public synchronized void mousePressed(MouseEvent evt)
 o mouseReleased
 public void mouseReleased(MouseEvent evt)
 o mouseEntered
 public void mouseEntered(MouseEvent evt)
 o mouseExited
 public void mouseExited(MouseEvent evt)
 o getAlgorithm
 public String getAlgorithm()
 o setAlgorithm
 public void setAlgorithm(String alg)

All Packages  Class Hierarchy  This Package  Previous  Next  Index