Watcher.v1_1
Class WatcherGraphicsInterface

java.lang.Object
  |
  +--Watcher.v1_1.WatcherGraphicsInterface
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class WatcherGraphicsInterface
extends java.lang.Object
implements java.awt.event.ActionListener

This class implements the presentation of information than can be extracted by using the PaP Subscribe functionality. A class instance manage one window containing three different fields. Separate methods is defined for the purpose to manage the information in each of the three defined fields. In addition the event "close window" obtained by pushing the X button of th window can be reported back to the application using this class instance by using the 'ActionListener' interface.


Field Summary
private  int charCount
          Append a new log event to the list of log events.
private  java.awt.Frame fr
          The reporting window
private  java.awt.Rectangle frB
           
private  java.awt.Label l1
          Headings for the three defined fields
private  java.awt.Label l2
          Headings for the three defined fields
private  java.awt.Label l3
          Headings for the three defined fields
private  java.awt.event.ActionListener listner
          Holds the last registered actionListener, if used
private  java.awt.List ls1
          The two lists used to keep list of actors and Role sessions
private  java.awt.List ls2
          The two lists used to keep list of actors and Role sessions
private  java.awt.Panel p1
          The three panels defining containers for the three fields
private  java.awt.Panel p2
          The three panels defining containers for the three fields
private  java.awt.Panel p3
          The three panels defining containers for the three fields
private  java.awt.TextArea ta
          Text area used for reporting log events
 
Constructor Summary
WatcherGraphicsInterface()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Common listener for all components which has been registered with "addActionListener()".
 void addActionListener(java.awt.event.ActionListener al)
          Register of action listener for the object that manages this object
 void addActor(java.lang.String s)
          Add a new actor instance in the list of actor instances
private  java.awt.Label addLabel(java.awt.Frame fr, int x, int y, int xwidth, int ywidth, java.lang.String title)
           
 void addLogEvent(java.lang.String s)
           
 void addRoleSession(java.lang.String s)
          Add a new role session instance in the list of role session instances
 void disposeFrame()
          Dispose frame if existing
static void main(java.lang.String[] args)
          main() is supplied only for stand alone test purposes.
private  java.awt.Frame newFrame(int x, int y, int xwidth, int ywidth, java.lang.String title)
           
 void removeActor(java.lang.String s)
          Remove an existing actor instance in the list of actor instances
private  void removeListEntry(java.awt.List l, java.lang.String s, int entryNo)
          Remove a specified entry from the specified list if existing.
 void removeRoleSession(java.lang.String s)
          Remove an existing role session instance in the list of role session instances
 boolean subscribeInfoFrame(java.lang.String t)
          Defines the window that contains all subscribe presentation information.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ta

private java.awt.TextArea ta
Text area used for reporting log events

l1

private java.awt.Label l1
Headings for the three defined fields

l2

private java.awt.Label l2
Headings for the three defined fields

l3

private java.awt.Label l3
Headings for the three defined fields

fr

private java.awt.Frame fr
The reporting window

frB

private java.awt.Rectangle frB

p1

private java.awt.Panel p1
The three panels defining containers for the three fields

p2

private java.awt.Panel p2
The three panels defining containers for the three fields

p3

private java.awt.Panel p3
The three panels defining containers for the three fields

ls1

private java.awt.List ls1
The two lists used to keep list of actors and Role sessions

ls2

private java.awt.List ls2
The two lists used to keep list of actors and Role sessions

charCount

private int charCount
Append a new log event to the list of log events.

listner

private java.awt.event.ActionListener listner
Holds the last registered actionListener, if used
Constructor Detail

WatcherGraphicsInterface

public WatcherGraphicsInterface()
Method Detail

subscribeInfoFrame

public boolean subscribeInfoFrame(java.lang.String t)
                           throws java.lang.Exception
Defines the window that contains all subscribe presentation information. The frame contains three fields - two lists and one text area field.
Parameters:
t - The title to be shown in window heading line
Returns:
true if success or false if failed in creation.

addActor

public void addActor(java.lang.String s)
Add a new actor instance in the list of actor instances
Parameters:
s - The comma separated list of actor information. Actor ID must be second

removeActor

public void removeActor(java.lang.String s)
Remove an existing actor instance in the list of actor instances
Parameters:
s - The comma separated list of actor information. Actor ID must be second

addRoleSession

public void addRoleSession(java.lang.String s)
Add a new role session instance in the list of role session instances
Parameters:
s - The comma separated list of role session information. Role session ID must be second

removeRoleSession

public void removeRoleSession(java.lang.String s)
Remove an existing role session instance in the list of role session instances
Parameters:
s - The comma separated list of role session information. Role session ID must be second

addLogEvent

public void addLogEvent(java.lang.String s)

removeListEntry

private void removeListEntry(java.awt.List l,
                             java.lang.String s,
                             int entryNo)
Remove a specified entry from the specified list if existing.
Parameters:
l - The list to remove entry from
s - A comma separated entry.
entryNo - Specifies which element in the commaseparated list that identifies the entry.

newFrame

private java.awt.Frame newFrame(int x,
                                int y,
                                int xwidth,
                                int ywidth,
                                java.lang.String title)
                         throws java.lang.Exception

addLabel

private java.awt.Label addLabel(java.awt.Frame fr,
                                int x,
                                int y,
                                int xwidth,
                                int ywidth,
                                java.lang.String title)
                         throws java.lang.Exception

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Common listener for all components which has been registered with "addActionListener()".
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The reported event

disposeFrame

public void disposeFrame()
Dispose frame if existing

addActionListener

public void addActionListener(java.awt.event.ActionListener al)
Register of action listener for the object that manages this object
Parameters:
al - The action listener to receive event reports

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
main() is supplied only for stand alone test purposes. No arguments is supported