Watcher.v2_1
Class WatcherWindow

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--Watcher.v2_1.WatcherWindow
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class WatcherWindow
extends javax.swing.JFrame

WatcherWindow is the main GUI class and extends JFrame. It consists of a JMenu and a JTabbedPane. WatcherWindow has reference to all the component classes; the two instances of Table (Actortable and RoleSessiontable), Overview, LogView and DebugView. These component classes is shown in their own tab.

Version:
December 2001
Author:
Lars Erik Liljebäck
See Also:
Serialized Form

Inner Class Summary
 class WatcherWindow.WatcherListener
          WatcherListener is an internal listener class which handles both WindowEvents and ActionEvents generated in the WatcherWindow class.
 
Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  java.lang.String[] actorHeaders
           
private  Table actorTable
           
private  java.awt.Color actorTableColor
           
private  int[] actorWidths
           
private  javax.swing.JCheckBoxMenuItem alwaysExpand
           
private  java.awt.Color backgroundColor
           
private  javax.swing.JMenuItem dbgView
           
private  DebugView debugview
           
private  javax.swing.JCheckBoxMenuItem enableDebugView
           
private  javax.swing.JRadioButtonMenuItem fullDbg
           
private  int height
           
private  javax.swing.JRadioButtonMenuItem immediate
           
private  javax.swing.JRadioButtonMenuItem interval_15
           
private  javax.swing.JRadioButtonMenuItem interval_30
           
private  int intervalSelected
           
private  javax.swing.JMenu level
           
private  LogView logview
           
private  javax.swing.JRadioButtonMenuItem muchDbg
           
private  javax.swing.JRadioButtonMenuItem noDbg
           
private  Overview overview
           
private  java.lang.String[] roleSessionHeaders
           
private  Table roleSessionTable
           
private  int[] roleSessionWidths
           
private  java.awt.Color rsTableColor
           
private  javax.swing.JRadioButtonMenuItem someDbg
           
private  javax.swing.JTabbedPane tabs
           
private  java.util.Vector tmpdebug
           
private  Watcher watcher
           
private  int width
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, windowClosingException, windowListenerK, visible, x, y
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WatcherWindow()
          Constructor which is only used for debugging.
WatcherWindow(Watcher watcher)
          Creates a new WatcherWindow and initializes the GUI components.
 
Method Summary
 void addActor(java.lang.String[] eventParts)
          Adds another Actor to the actor table.
 void addLogEntry(java.lang.String[] eventParts)
          Adds another entry to the log.
 void addRoleSession(java.lang.String[] eventParts)
          Adds another RoleSession to the roleSession table.
private  void dbg(java.lang.String dbg)
          Adds a new debug-string to the DebugView with the class name as prefix.
private  void dbg2(java.lang.String dbg)
          Adds a new debug-string to the DebugView with the class name as prefix.
 void debug(java.lang.String dbg)
          Adds a new debug-string to the DebugView.
 java.lang.String formatDate(java.util.Date date)
          Returns a string representation of the specified date of the form DD.MM.YYYY HH:MM:SS.
 java.lang.String getWatcherGAI()
          Returns the Watcher's GAI.
 void init()
          Initializes the GUI components.
static void main(java.lang.String[] args)
          Implements a main method for debugging purposes.
 java.lang.String parseDate(java.lang.String msec)
          Parses the specified string into a long and converts it into a date.
 void removeActor(java.lang.String[] eventParts)
          Searches through the actor table after an Actor identified by a GAI.
 void removeRoleSession(java.lang.String[] eventParts)
          Searches through the rolesession table after a RoleSession identified by a GAI.
 void selectTableRow(java.lang.String GAI, boolean isActorGAI)
          Selects the row in either the Actor table or the RoleSession table, depending on if isActorGAI is True or False respectively, where the specified GAI is found.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

actorTable

private Table actorTable

actorHeaders

private java.lang.String[] actorHeaders

actorWidths

private int[] actorWidths

actorTableColor

private java.awt.Color actorTableColor

roleSessionTable

private Table roleSessionTable

roleSessionHeaders

private java.lang.String[] roleSessionHeaders

roleSessionWidths

private int[] roleSessionWidths

rsTableColor

private java.awt.Color rsTableColor

logview

private LogView logview

overview

private Overview overview

debugview

private DebugView debugview

dbgView

private javax.swing.JMenuItem dbgView

level

private javax.swing.JMenu level

enableDebugView

private javax.swing.JCheckBoxMenuItem enableDebugView

noDbg

private javax.swing.JRadioButtonMenuItem noDbg

someDbg

private javax.swing.JRadioButtonMenuItem someDbg

muchDbg

private javax.swing.JRadioButtonMenuItem muchDbg

fullDbg

private javax.swing.JRadioButtonMenuItem fullDbg

tmpdebug

private java.util.Vector tmpdebug

tabs

private javax.swing.JTabbedPane tabs

watcher

private Watcher watcher

immediate

private javax.swing.JRadioButtonMenuItem immediate

interval_15

private javax.swing.JRadioButtonMenuItem interval_15

interval_30

private javax.swing.JRadioButtonMenuItem interval_30

intervalSelected

private int intervalSelected

alwaysExpand

private javax.swing.JCheckBoxMenuItem alwaysExpand

width

private int width

height

private int height

backgroundColor

private java.awt.Color backgroundColor
Constructor Detail

WatcherWindow

public WatcherWindow()
Constructor which is only used for debugging.

WatcherWindow

public WatcherWindow(Watcher watcher)
Creates a new WatcherWindow and initializes the GUI components.
Parameters:
watcher - Reference to an instance of Watcher.
Method Detail

init

public void init()
Initializes the GUI components.

addActor

public void addActor(java.lang.String[] eventParts)
Adds another Actor to the actor table.
Parameters:
eventParts - Array of strings which together formed the report of this ActorCreate event.

addLogEntry

public void addLogEntry(java.lang.String[] eventParts)
Adds another entry to the log.
Parameters:
eventParts - Array of strings which together formed the report of the event to be logged.

addRoleSession

public void addRoleSession(java.lang.String[] eventParts)
Adds another RoleSession to the roleSession table.
Parameters:
eventParts - Array of strings which together formed the report of this RoleSessionCreate event.

removeActor

public void removeActor(java.lang.String[] eventParts)
Searches through the actor table after an Actor identified by a GAI. If found the Actor is removed by removing the row where the GAI was found.
Parameters:
eventParts - Array of strings which together formed the report of this ActorRemove event.

removeRoleSession

public void removeRoleSession(java.lang.String[] eventParts)
Searches through the rolesession table after a RoleSession identified by a GAI. If found the RoleSesson is removed by removing the row where the GAI was found.
Parameters:
eventParts - Array of strings which together formed the report of this ActorRemove event.

debug

public void debug(java.lang.String dbg)
Adds a new debug-string to the DebugView. If the reference to the DebugView is null the debug-string is added to a Vector and later added to the DebugView.
Parameters:
dbg - The debug-string to be added.

parseDate

public java.lang.String parseDate(java.lang.String msec)
Parses the specified string into a long and converts it into a date. Then it calls formatDate() and returns a string representation of the date of the form DD.MM.YYYY HH:MM:SS. If a NumberFormatException is caught the specified string is returned unconverted.
Parameters:
msec - Number of milliseconds since Jan. 1 1970 as a String.
Returns:
The converted Date represented as a String.

formatDate

public java.lang.String formatDate(java.util.Date date)
Returns a string representation of the specified date of the form DD.MM.YYYY HH:MM:SS.
Parameters:
date - The date to be formated.
Returns:
The formated date as a string.

getWatcherGAI

public java.lang.String getWatcherGAI()
Returns the Watcher's GAI. It calls the respective method in Watcher.
Returns:
The GAI represented as a string.

selectTableRow

public void selectTableRow(java.lang.String GAI,
                           boolean isActorGAI)
Selects the row in either the Actor table or the RoleSession table, depending on if isActorGAI is True or False respectively, where the specified GAI is found. If the GAI is not found in the table, no row is selected.
Parameters:
GAI - The GAI to be found.
isActorGAI - Specifies which table to search through.

dbg

private void dbg(java.lang.String dbg)
Adds a new debug-string to the DebugView with the class name as prefix.
Parameters:
dbg - The debug-string to be added.

dbg2

private void dbg2(java.lang.String dbg)
Adds a new debug-string to the DebugView with the class name as prefix. This is a convenience method used for grouping debug information in the DebugView.
Parameters:
dbg - The debug-string to be added.

main

public static void main(java.lang.String[] args)
Implements a main method for debugging purposes.