support.queue
Class QueueVisualizer

java.lang.Object
  extended by support.queue.QueueVisualizer
All Implemented Interfaces:
SwingConstants

public class QueueVisualizer
extends Object
implements SwingConstants


Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
QueueVisualizer()
           
 
Method Summary
 void addPaneLabel(JPanel pane, String lab)
           
 void buildQueue()
          Visualizes the queue by shattering encapsulation, using the dataobject to access your private array that stores all the information for your queue.
 void buildSnapshot(Object elem)
          Visualizes the current elements in the snapshot iterator.
 void catchError(String method, Exception e)
          Method used to display error messages that get caught while executing methods in the queue.
 void createBox(int boxType, String lab, int left, boolean iter)
          Visualizes the elements for the queue or iterator.
 Component createComponents()
          Creates the components for visualizing the queue.
 Component createIterator()
          Creates the iterator panel with manipulation buttons.
 Component createOptions()
          Creates the queue manipulating buttons.
 Component createQuit()
           
 Component createWriter()
          Creates the components for visualizing results of queue manipulations.
 void dequeue()
           
 void displayEvent()
           
 void displayResult()
           
 void elements()
           
 void enqueue(Object elem)
          Queue methods.
 void front()
           
 int getNextLeft()
           
 void hasNext()
           
 void init()
           
 void isEmpty()
           
static void main(String[] args)
           
 void nextObject()
           
 void object()
           
 void reset()
          Iterator methods.
 void size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueVisualizer

public QueueVisualizer()
Method Detail

createIterator

public Component createIterator()
Creates the iterator panel with manipulation buttons.


createComponents

public Component createComponents()
Creates the components for visualizing the queue.


createWriter

public Component createWriter()
Creates the components for visualizing results of queue manipulations.


createOptions

public Component createOptions()
Creates the queue manipulating buttons.


createQuit

public Component createQuit()

init

public void init()

enqueue

public void enqueue(Object elem)
Queue methods.


dequeue

public void dequeue()

isEmpty

public void isEmpty()

front

public void front()

size

public void size()

elements

public void elements()

reset

public void reset()
Iterator methods.


hasNext

public void hasNext()

object

public void object()

nextObject

public void nextObject()

catchError

public void catchError(String method,
                       Exception e)
Method used to display error messages that get caught while executing methods in the queue.


displayEvent

public void displayEvent()

displayResult

public void displayResult()

buildSnapshot

public void buildSnapshot(Object elem)
Visualizes the current elements in the snapshot iterator.


buildQueue

public void buildQueue()
                throws Exception
Visualizes the queue by shattering encapsulation, using the dataobject to access your private array that stores all the information for your queue. Since we want to visualize your queue as accurately as possible we use the front index and the size to determine what to display. So if your queue isn't visualizing the way it should be, you should check your index for the front and/or how you keep track of your size.

Throws:
Exception

addPaneLabel

public void addPaneLabel(JPanel pane,
                         String lab)

getNextLeft

public int getNextLeft()

createBox

public void createBox(int boxType,
                      String lab,
                      int left,
                      boolean iter)
Visualizes the elements for the queue or iterator.


main

public static void main(String[] args)