Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.openmosix.applet
Class openMosixApplet  view openMosixApplet download openMosixApplet.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byjavax.swing.JApplet
                      extended byorg.openmosix.applet.openMosixApplet
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.lang.Runnable, java.io.Serializable

public class openMosixApplet
extends javax.swing.JApplet
implements java.lang.Runnable, java.awt.event.KeyListener, java.awt.event.ActionListener

Contains the applet's main code. The applet:

The applet implements three Java interfaces:

Version:
$Id: openMosixApplet.java,v 1.11 2003/01/27 21:25:47 mcaserta Exp $

Nested Class Summary
 
Nested classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JTextArea aboutArea
           
 java.util.LinkedList answerLL
           
 java.awt.Dimension appletDim
           
 javax.swing.JLabel appletEndLabel
           
 javax.swing.JPanel appletEndPanel
           
private  int appletLook
           
 javax.swing.JTabbedPane appletTabbedPane
           
 javax.swing.JCheckBox autoResizeMode
           
private  javax.swing.JLabel bgColorLabel
           
static java.lang.String BUILD
           
private  ChartCode chartcode
           
private  javax.swing.JButton colorButton
           
private  boolean debugMode
           
 boolean done
           
 javax.swing.JCheckBox enableHistoryMode
           
 javax.swing.JCheckBox enableSubsetRotation
           
 int EXIT_FAILURE
           
 int EXIT_SUCCESS
           
 javax.swing.JCheckBox fillInterior
           
private  boolean hideDeadNodes
           
 boolean historyLabelsYetDone
           
 java.util.LinkedList historyLL
           
private  java.lang.String[] infosArray
           
 javax.swing.JTextField ipField
           
 boolean JDK14OrGreaterVersion
           
static java.lang.String MAJOR
           
 int maxValuesInHistoryLL
           
private  java.lang.Thread me
           
static java.lang.String MINOR
           
 NetCode netcode
           
 java.util.LinkedList nodeIds
           
 java.util.LinkedList nodeValues
           
private  javax.swing.JPanel optionPanel
           
 javax.swing.JButton reconnectButton
           
static java.lang.String RELEASE
           
private  java.lang.String request
           
 java.lang.String requiredNodeInfo
           
private  javax.swing.JScrollPane scrollAboutArea
           
private  javax.swing.JScrollPane scrollOptions
           
private  javax.swing.JScrollPane scrollSupportedKeys
           
 javax.swing.JScrollPane scrollTaskOutput
           
private  javax.swing.JButton selButton
           
 java.lang.String selectiveMonitoringParams
           
 javax.swing.JTextField selField
           
private  javax.swing.JLabel selMonLabel
           
 boolean showTaskOutput
           
private  long startTimeOfThisRun
           
 javax.swing.JCheckBox stopChartRefreshIfTabChanged
           
private  javax.swing.JTextArea supportedKeys
           
private  javax.swing.ImageIcon tabIcon
           
private  javax.swing.JTextArea taskOutput
           
 int threadRefreshInterval
           
private  boolean TRACE_NETCODE_debugMode
           
private  Utils utils
           
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.applet.Applet
 
Fields inherited from class java.awt.Panel
 
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
openMosixApplet()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Manages action events (buttons,...).
 void callSimpleRefresh()
          Call a simple refersh of the applet
 void closeApplet(java.lang.String strMsg)
          Closes the applet: shows a message, closes the socket and then invokes the Garbage Collector.
 void cycleAmongInfos(boolean upOrDown)
          Creates an array-based queue
 void forceRefreshStop()
          Stops the applet refresh (this is the step before closing teh applet..
 void getAppletHTMLParams()
          Checks all available applet parameters (from the calling HTML page).
 void handleNetErrors()
          Handles all network errors: if possible, it allows a reconnection.
 void init()
          First standard method called by Java to start the applet
 void initAllComponents()
          Initializes the tabbed panel and all the included components (including the chart).
 void initHistoryLL()
          Initializes the historyLL
 void keyPressed(java.awt.event.KeyEvent e)
          Manages pressed key events.
 void keyReleased(java.awt.event.KeyEvent e)
          Manages released key events.
 void keyTyped(java.awt.event.KeyEvent e)
          Manages typed key events.
 void paintComponent(java.awt.Graphics g)
          Java's standard method to refresh the graphics (and force chart refresh)
 void run()
          Standard Java thread method.
 void setInfosArrays()
          Creates the array to clycle with UP & DOWN keys.
 void showDebugMsg(java.lang.String strInfoType, java.lang.String strToPrint)
          If debug mode is active, prints a debug message on the screen.
 void start()
          Second standard method called by Java to start the applet
 void startComponents()
          Starts all the components.
 int storeNewReceivedValues()
          Stores response values (provided by an oMInfoServger daemon) in two LinkedLists.
 void traceConnDbgMsg(java.lang.String strToPrint)
          If connection tracing mode is active, prints a debug message on the screen.
 java.lang.String verifySelMonParam(java.lang.String strToTest)
          Verifies if a string contains a valid parametr for selective monitoring
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusDownCycle, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRACE_NETCODE_debugMode

private final boolean TRACE_NETCODE_debugMode
See Also:
Constant Field Values

EXIT_SUCCESS

public final int EXIT_SUCCESS
See Also:
Constant Field Values

EXIT_FAILURE

public final int EXIT_FAILURE
See Also:
Constant Field Values

MAJOR

public static final java.lang.String MAJOR
See Also:
Constant Field Values

MINOR

public static final java.lang.String MINOR
See Also:
Constant Field Values

BUILD

public static final java.lang.String BUILD
See Also:
Constant Field Values

RELEASE

public static final java.lang.String RELEASE
See Also:
Constant Field Values

threadRefreshInterval

public int threadRefreshInterval

requiredNodeInfo

public java.lang.String requiredNodeInfo

selectiveMonitoringParams

public java.lang.String selectiveMonitoringParams

request

private java.lang.String request

nodeValues

public java.util.LinkedList nodeValues

nodeIds

public java.util.LinkedList nodeIds

answerLL

public java.util.LinkedList answerLL

historyLL

public java.util.LinkedList historyLL

maxValuesInHistoryLL

public int maxValuesInHistoryLL

historyLabelsYetDone

public boolean historyLabelsYetDone

chartcode

private ChartCode chartcode

netcode

public NetCode netcode

utils

private Utils utils

done

public boolean done

me

private java.lang.Thread me

debugMode

private boolean debugMode

appletLook

private int appletLook

JDK14OrGreaterVersion

public boolean JDK14OrGreaterVersion

appletDim

public java.awt.Dimension appletDim

appletTabbedPane

public javax.swing.JTabbedPane appletTabbedPane

taskOutput

private javax.swing.JTextArea taskOutput

supportedKeys

private javax.swing.JTextArea supportedKeys

aboutArea

private javax.swing.JTextArea aboutArea

scrollTaskOutput

public javax.swing.JScrollPane scrollTaskOutput

scrollSupportedKeys

private javax.swing.JScrollPane scrollSupportedKeys

scrollAboutArea

private javax.swing.JScrollPane scrollAboutArea

scrollOptions

private javax.swing.JScrollPane scrollOptions

optionPanel

private javax.swing.JPanel optionPanel

stopChartRefreshIfTabChanged

public javax.swing.JCheckBox stopChartRefreshIfTabChanged

enableHistoryMode

public javax.swing.JCheckBox enableHistoryMode

autoResizeMode

public javax.swing.JCheckBox autoResizeMode

bgColorLabel

private javax.swing.JLabel bgColorLabel

colorButton

private javax.swing.JButton colorButton

ipField

public javax.swing.JTextField ipField

reconnectButton

public javax.swing.JButton reconnectButton

selMonLabel

private javax.swing.JLabel selMonLabel

selButton

private javax.swing.JButton selButton

selField

public javax.swing.JTextField selField

appletEndPanel

public javax.swing.JPanel appletEndPanel

appletEndLabel

public javax.swing.JLabel appletEndLabel

fillInterior

public javax.swing.JCheckBox fillInterior

enableSubsetRotation

public javax.swing.JCheckBox enableSubsetRotation

tabIcon

private javax.swing.ImageIcon tabIcon

showTaskOutput

public boolean showTaskOutput

startTimeOfThisRun

private long startTimeOfThisRun

hideDeadNodes

private boolean hideDeadNodes

infosArray

private java.lang.String[] infosArray
Constructor Detail

openMosixApplet

public openMosixApplet()
Method Detail

init

public void init()
First standard method called by Java to start the applet


start

public void start()
Second standard method called by Java to start the applet


startComponents

public void startComponents()
Starts all the components.


run

public void run()
Standard Java thread method. Contains the loop code for the thread. This method is called by Java when the start() method of Thread-object is invoked. This method: 1) Tries to open connection to a oMInfoServer daemon (applet params are in the calling HTML page). 2) Gets daemon's banner. 3) Sends (continuosly) requests for node info to the daemon. 4) Gets request answers from the daemon. 5) Call Java's standard paintComponent() method to refresh the graphics (and the chart!) 6) Closes connection to the daemon.

Specified by:
run in interface java.lang.Runnable

forceRefreshStop

public void forceRefreshStop()
Stops the applet refresh (this is the step before closing teh applet..


paintComponent

public void paintComponent(java.awt.Graphics g)
Java's standard method to refresh the graphics (and force chart refresh)


initAllComponents

public void initAllComponents()
Initializes the tabbed panel and all the included components (including the chart).


storeNewReceivedValues

public int storeNewReceivedValues()
Stores response values (provided by an oMInfoServger daemon) in two LinkedLists.


initHistoryLL

public void initHistoryLL()
Initializes the historyLL


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Manages action events (buttons,...). This method is a Java's standard one (required by ActionListener interface).

Specified by:
actionPerformed in interface java.awt.event.ActionListener

verifySelMonParam

public java.lang.String verifySelMonParam(java.lang.String strToTest)
Verifies if a string contains a valid parametr for selective monitoring


keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Manages typed key events. This method is a Java's standard one (required by KeyListener interface).

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

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Manages pressed key events. This method is a Java's standard one (required by KeyListenr interface).

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

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Manages released key events. This method is a Java's standard one (required by KeyListenr interface).

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

showDebugMsg

public void showDebugMsg(java.lang.String strInfoType,
                         java.lang.String strToPrint)
If debug mode is active, prints a debug message on the screen.


traceConnDbgMsg

public void traceConnDbgMsg(java.lang.String strToPrint)
If connection tracing mode is active, prints a debug message on the screen.


setInfosArrays

public void setInfosArrays()
Creates the array to clycle with UP & DOWN keys.


cycleAmongInfos

public void cycleAmongInfos(boolean upOrDown)
Creates an array-based queue


getAppletHTMLParams

public void getAppletHTMLParams()
Checks all available applet parameters (from the calling HTML page). Calls validateHTMLParam() method to check each available applet parameter.


handleNetErrors

public void handleNetErrors()
Handles all network errors: if possible, it allows a reconnection.


closeApplet

public void closeApplet(java.lang.String strMsg)
Closes the applet: shows a message, closes the socket and then invokes the Garbage Collector.


callSimpleRefresh

public void callSimpleRefresh()
Call a simple refersh of the applet