Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class mil.navy.nps.awt.AwtPduViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--mil.navy.nps.awt.AwtPduViewer

public class AwtPduViewer
extends java.applet.Applet
implements java.lang.Runnable
AwtPduViewer is an applet that reads Pdus and displays their values on the screen. It is configured with a socket, which allows the applet to read data from the wire; it uses the package mil.navy.nps.dis, which implements the DIS protocol.

This file was generated by Microsquish J++, which is something of an experiment. We'll see how it works out. It's also my first applet that isn't completely trivial, so be a little gentle.

This is compliant with the JDK 1.02 spec; it makes use of deprecated aspects of that API rather than use JDK 1.1. This is primarily to get it working with Netscape 3.01. 1.1 browser implementations should be compatible, at least for the next release.

Netscape bitches & moans about doing a thread.suspend(), complaining about the possibility of deadlock. Not sure what this is all about, but it seems to work.

This takes two parameters from the HTML file, "PduSocket" and"MulticastGroup". The first is the socket the applet listens on. The second is a multicast group, a feature that is not implemented right now since Netscape doesn't do multicast.

Testing: sent ESPdus to host (madison) from both madison and pinafore using mil.navy.nps.dis.Benchmark. HISTORY

10Apr97 DMcG New

Version:
1.0
Author:
Don McGregor ( http://www.stl.nps.navy.mil/~mcgredo)

See Also:
UpdateThread, TextAreaStream, Serialized Form

Fields inherited from class java.awt.Panel
panelLayout
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, parent, peer, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
AwtPduViewer()
           
 
Method Summary
boolean action(java.awt.Event event, java.lang.Object what)
           
void destroy()
           
java.lang.String getAppletInfo()
           
java.lang.String[][] getParameterInfo()
           
boolean handleEvent(java.awt.Event evt)
           
void init()
          Applet initialization code
void paint(java.awt.Graphics g)
           
void run()
           
void start()
           
void stop()
           
void updateDisplay()
          Updates the display by querying the NetworkMonitor, returning any Pdus that have arrived since the last time we asked, and updating the display.
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
, addNotify, constructComponentName
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, doLayout, eventEnabled, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, nextFocus, paintComponents, paint, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, print, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, removeAll, remove, remove, removeContainerListener, removeNotify, setFocusOwner, setLayout, transferFocus, update, validate, validateTree
 
Methods inherited from class java.awt.Component
, action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

AwtPduViewer

public AwtPduViewer()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

init

public void init()
Applet initialization code
Overrides:
init in class java.applet.Applet

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

run

public void run()
Description copied from interface:
 
Specified by:
run() in interface java.lang.Runnable

updateDisplay

public void updateDisplay()
Updates the display by querying the NetworkMonitor, returning any Pdus that have arrived since the last time we asked, and updating the display. This is kicked off by its own thread, so it runs asyncronously from the app. the display is updated every X seconds. We need to lock access to pduPool, since this is global data used elsewhere in the applet in another thread. Not sure about the requirement to lock list, the GUI element that displays the scrolling list. This is the only place we do a _write_ to it, so I think it's OK.

action

public boolean action(java.awt.Event event,
                      java.lang.Object what)
Overrides:
action in class java.awt.Component

handleEvent

public boolean handleEvent(java.awt.Event evt)
Overrides:
handleEvent in class java.awt.Component

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD