jist.runtime.guilog
Class GuiLog

java.lang.Object
  extended by jist.runtime.guilog.GuiLog

public class GuiLog
extends java.lang.Object

Title: GuiLog

Description: Creates a GUI that displays event information.


Nested Class Summary
static class GuiLog.ButtonHandler
          Defines how mouse clicks on the buttons are handled.
static class GuiLog.ChildrenCellEditor
          ChildrenCellEditor is a customized TableCellEditor for JiST Events.
 class GuiLog.EventCellRenderer
          EventCellRenderer is a customized TableCellRenderer for JiST Events.
static class GuiLog.EventNode
          An EventNode encapsulates the construct formed by an Event and the relationships it has with its parent and children Events.
static class GuiLog.EventNodeComparator
          The EventNodeComparator class defines how to sort two Events.
static class GuiLog.EventTableModel
          The EventTableModel class is the data model for the JTable.
static class GuiLog.MouseAdapterHandler
          Defines how mouse clicks on the Parent column are handled.
static class GuiLog.UntilTask
          UntilTask is a task that can be scheduled to either Pause or Resume the GuiLog.
 
Field Summary
static javax.swing.JButton cellDownButton
          Re-used JButton.
static javax.swing.JButton cellUpButton
          Re-used JButton.
static javax.swing.ImageIcon downIcon
          Re-used Icon.
static GuiLog.EventNodeComparator EVENT_COMPARE
          Used for sorting Events.
static javax.swing.JFrame frame
          The JFrame for displaying the GUI.
static javax.swing.ImageIcon pauseIcon
          Re-used Icon.
static javax.swing.ImageIcon resumeIcon
          Re-used Icon.
static javax.swing.ImageIcon stepIcon
          Re-used Icon.
static java.awt.Font tableFont
          The font used for most of the table.
static javax.swing.ImageIcon untilIcon
          Re-used Icon.
static javax.swing.ImageIcon upIcon
          Re-used Icon.
 
Constructor Summary
GuiLog(int maxNumEvents)
          GuiLog creates and shows the GUI when an outside synchronized thread instantiates an instance of GuiLog.
 
Method Summary
 void add(Event id, Event parent)
          Adds an Event to the GUI.
 void checkListSize()
          Checks the number of Events in the list.
 void checkLock()
          If not stepping through one Event, checkLock attempts to acquire a lock on pauseLock.
static javax.swing.ImageIcon createImageIcon(java.lang.String path)
          Creates an ImageIcon.
 void del(Event id)
          Deletes an Event from the GUI.
static javax.swing.JButton getPauseButton()
          Getter method.
static javax.swing.JButton getStepButton()
          Getter method.
static javax.swing.JButton getUntilButton()
          Getter method.
static void main(java.lang.String[] args)
          Test program.
static void pause()
          Sets paused to true.
static void resume()
          Sets paused to false and notifies all methods that are synchronized on pauseLock.
static void stepEvent()
          Step through one Event.
static void untilTimer()
          Prompts the user for the number of seconds to unpause the GuiLog, then unpauses it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableFont

public static java.awt.Font tableFont
The font used for most of the table.


pauseIcon

public static javax.swing.ImageIcon pauseIcon
Re-used Icon. Displayed on pauseButton.


resumeIcon

public static javax.swing.ImageIcon resumeIcon
Re-used Icon. Displayed on pauseButton.


stepIcon

public static javax.swing.ImageIcon stepIcon
Re-used Icon. Displayed on stepButton.


untilIcon

public static javax.swing.ImageIcon untilIcon
Re-used Icon. Displayed on untilButton.


upIcon

public static javax.swing.ImageIcon upIcon
Re-used Icon. Displayed on upButton.


downIcon

public static javax.swing.ImageIcon downIcon
Re-used Icon. Displayed on downButton.


cellUpButton

public static javax.swing.JButton cellUpButton
Re-used JButton. Points upwards to indicate position of event-relative.


cellDownButton

public static javax.swing.JButton cellDownButton
Re-used JButton. Points downwards to indicate position of event-relative.


frame

public static javax.swing.JFrame frame
The JFrame for displaying the GUI.


EVENT_COMPARE

public static final GuiLog.EventNodeComparator EVENT_COMPARE
Used for sorting Events.

Constructor Detail

GuiLog

public GuiLog(int maxNumEvents)
GuiLog creates and shows the GUI when an outside synchronized thread instantiates an instance of GuiLog.

Parameters:
maxNumEvents - int Maximum number of Events allowed to be displayed in table.
Method Detail

createImageIcon

public static javax.swing.ImageIcon createImageIcon(java.lang.String path)
Creates an ImageIcon.

Parameters:
path - String The path where the image is located.
Returns:
ImageIcon with the specified image.

getPauseButton

public static javax.swing.JButton getPauseButton()
Getter method.

Returns:
JButton

getStepButton

public static javax.swing.JButton getStepButton()
Getter method.

Returns:
JButton

getUntilButton

public static javax.swing.JButton getUntilButton()
Getter method.

Returns:
JButton

add

public void add(Event id,
                Event parent)
Adds an Event to the GUI.

Parameters:
id - Event
parent - Event

del

public void del(Event id)
Deletes an Event from the GUI.

Parameters:
id - Event

checkLock

public void checkLock()
If not stepping through one Event, checkLock attempts to acquire a lock on pauseLock. If it is successful, the method returns; otherwise, it waits. If stepping through one Event, then checkLock returns once so that one Event can be added.


stepEvent

public static void stepEvent()
Step through one Event.


untilTimer

public static void untilTimer()
Prompts the user for the number of seconds to unpause the GuiLog, then unpauses it. After the user-entered time, pauses the GuiLog.


checkListSize

public void checkListSize()
Checks the number of Events in the list. If the thresh hold limit has been reached, one event is deleted.


pause

public static void pause()
Sets paused to true.


resume

public static void resume()
Sets paused to false and notifies all methods that are synchronized on pauseLock.


main

public static void main(java.lang.String[] args)
Test program. Creates a GUI with a JTable. Creates Events, then adds and deletes them from the GuiLog.

Parameters:
args - String[]