MicroTAPAS
Class MicroBaseFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--MicroTAPAS.MicroBaseFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, ControlInterface, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.MenuContainer, java.io.Serializable

public class MicroBaseFrame
extends java.awt.Frame
implements java.io.Serializable, java.awt.event.KeyListener, java.awt.event.ActionListener, java.awt.event.ItemListener, ControlInterface

This class implements an interactive debug client window for entities MicroPNES, MicroPAS. It is based on the PaP class BaseFrame.java.

See Also:
Serialized Form

Field Summary
private  java.awt.Button bGo
           
private  java.awt.Choice cCommand
           
private  int charCount
          Main method to print anything to the window
protected  Debug debug
           
protected  boolean debugActive
           
private  boolean doDebug
           
private  java.awt.MenuBar menuBar
           
private  java.awt.Menu mFile
           
private  java.awt.MenuItem miClose
           
private  java.awt.MenuItem miExit
           
private  java.awt.MenuItem miListActors
           
private  java.awt.Menu mInfo
           
private  java.awt.MenuItem miStatus
           
private static int numWindows
           
private  ControlInterface owner
           
private  int pCL
           
private static int posX
           
private static int posY
           
protected  java.util.Properties properties
           
private  java.lang.String selectedCommand
           
private  java.lang.String selfNode
           
private  double startTime
           
private  double stopTime
           
private  java.awt.TextArea ta
           
private  java.awt.TextField tf
           
private  java.util.Vector vCCL
           
private  java.util.Vector vCL
           
private static java.util.Vector vFrames
           
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MicroBaseFrame(java.lang.String pTitle, int pX, int pY, ControlInterface pOwner)
          Constructor to initialize window properties and data fields
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Detects and handles ActionEvents, i.e. a button is pressed.
 void addCommandLine(java.lang.String pCL)
          Adds a command line string to the input line history of the debug client window
 void cleanUp()
          Gives this TAPAS instance a chance to clean up when the DebugWindow is closed.
 void close()
          Closes the window, if last window -> exit
 RequestResult control(java.lang.String cmd, java.lang.String[] args)
          Control method from ControlInterface, only armed if there's no attached owner
 java.lang.String[] getKeywords()
          Returns the actual set of debug trace keywords for the owner entity
private  void init(int pX, int pY)
          Initialization method.
 void itemStateChanged(java.awt.event.ItemEvent ie)
          Detects a change in the Choice list.
 void keyPressed(java.awt.event.KeyEvent ke)
          Utility to process the event of keyPressed
 void keyReleased(java.awt.event.KeyEvent ke)
           
 void keyTyped(java.awt.event.KeyEvent ke)
           
static void main(java.lang.String[] argv)
           
private  void outputText(java.lang.String s)
           
 void pln(java.lang.String[] pKW, java.lang.String pMessage)
          Prints debug trace info into a degug client window and sends it to attached DebugServer
 void print(int l, java.lang.String s)
           
 void printerr(java.lang.String s, java.lang.Exception e)
           
 void println(int l, java.lang.String s)
           
 void setIcon(java.lang.String icon)
          Method to set the icon of the frame.Can make it easier to distinguish between several frames.
 void setKeywords(java.lang.String[] pKW)
          Sets debug trace keywords for the owner entity
 void setTitle(java.lang.String title)
          Method to set the frame title
 void stdout(java.lang.String s)
           
 void term()
           
 void updateCommandLines(java.lang.String oldNode, java.lang.String newNode)
          Updates the command lines to reflect changes in local address
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

owner

private ControlInterface owner

menuBar

private java.awt.MenuBar menuBar

mFile

private java.awt.Menu mFile

mInfo

private java.awt.Menu mInfo

miClose

private java.awt.MenuItem miClose

miExit

private java.awt.MenuItem miExit

miStatus

private java.awt.MenuItem miStatus

miListActors

private java.awt.MenuItem miListActors

cCommand

private java.awt.Choice cCommand

ta

private java.awt.TextArea ta

tf

private java.awt.TextField tf

bGo

private java.awt.Button bGo

vCL

private java.util.Vector vCL

vCCL

private java.util.Vector vCCL

pCL

private int pCL

selectedCommand

private java.lang.String selectedCommand

debug

protected Debug debug

debugActive

protected boolean debugActive

properties

protected java.util.Properties properties

numWindows

private static int numWindows

vFrames

private static java.util.Vector vFrames

doDebug

private boolean doDebug

startTime

private double startTime

stopTime

private double stopTime

selfNode

private java.lang.String selfNode

posX

private static int posX

posY

private static int posY

charCount

private int charCount
Main method to print anything to the window

Constructor Detail

MicroBaseFrame

public MicroBaseFrame(java.lang.String pTitle,
                      int pX,
                      int pY,
                      ControlInterface pOwner)
Constructor to initialize window properties and data fields

Parameters:
pTitle - Window title
pX - Window width
pY - Window height
pOwner - The entity to report user control events to
Method Detail

init

private void init(int pX,
                  int pY)
Initialization method.

Parameters:
pX - Window width
pY - Window height

close

public void close()
Closes the window, if last window -> exit


setKeywords

public void setKeywords(java.lang.String[] pKW)
Sets debug trace keywords for the owner entity

Parameters:
pKW - The new set of keywords

getKeywords

public java.lang.String[] getKeywords()
Returns the actual set of debug trace keywords for the owner entity

Returns:
The actual set of keywords

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Detects and handles ActionEvents, i.e. a button is pressed.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae - The ActionEvent that was triggered.

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Utility to process the event of keyPressed

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Specified by:
keyTyped in interface java.awt.event.KeyListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent ie)
Detects a change in the Choice list.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
ie - The triggered ItemEvent.

pln

public void pln(java.lang.String[] pKW,
                java.lang.String pMessage)
Prints debug trace info into a degug client window and sends it to attached DebugServer

Parameters:
pKW - A set of keywords to match with the debug trace filtering keywords
pMessage - The actual debug trace message that carries the debug information

stdout

public void stdout(java.lang.String s)

print

public void print(int l,
                  java.lang.String s)

println

public void println(int l,
                    java.lang.String s)

printerr

public void printerr(java.lang.String s,
                     java.lang.Exception e)

addCommandLine

public void addCommandLine(java.lang.String pCL)
Adds a command line string to the input line history of the debug client window

Parameters:
pCL - The command line string to be added

updateCommandLines

public void updateCommandLines(java.lang.String oldNode,
                               java.lang.String newNode)
Updates the command lines to reflect changes in local address


control

public RequestResult control(java.lang.String cmd,
                             java.lang.String[] args)
Control method from ControlInterface, only armed if there's no attached owner

Specified by:
control in interface ControlInterface
Parameters:
cmd - Control command
args - Arguments for the control command

outputText

private void outputText(java.lang.String s)

setIcon

public void setIcon(java.lang.String icon)
Method to set the icon of the frame.Can make it easier to distinguish between several frames.


setTitle

public void setTitle(java.lang.String title)
Method to set the frame title

Overrides:
setTitle in class java.awt.Frame

cleanUp

public void cleanUp()
Gives this TAPAS instance a chance to clean up when the DebugWindow is closed.

Specified by:
cleanUp in interface ControlInterface

term

public void term()

main

public static void main(java.lang.String[] argv)


The Telematics Architecture for Plug-and-Play Systems (TAPAS) is a research project undertaken by the Norwegian University of Science and Technology's Telematics department which aims at developing an architecture for network-based service systems with a) flexibility and adaptability, b) robustness and survivability, and c) QoS awareness and resource control.

More information can be found at the project's homepage at http://tapas.item.ntnu.no and the project manager, Professor Finn Arve Aagesen, can be reached at finn.arve.aagesen@item.ntnu.no.