mil.navy.nps.awt
Class AwtEspduSender

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended bymil.navy.nps.awt.AwtEspduSender
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class AwtEspduSender
extends java.applet.Applet
implements java.awt.event.ActionListener

See Also:
Serialized Form

Nested Class Summary
 
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
static java.lang.String DATA_LAYOUT
           
static boolean DEBUG
           
static java.lang.String DEFAULT_FREQUENCY
           
static java.lang.String DEFAULT_MARKING
           
static java.lang.String DEFAULT_MCAST
           
static java.lang.String DEFAULT_PORT
           
static java.lang.String DEFAULT_TIMELIMIT
           
static java.lang.String DEFAULT_UNICAST_DEST_ADDR
           
static java.lang.String DEFAULT_UNICAST_DEST_PORT
           
protected static java.awt.TextArea espduData
           
protected static EspduDataUI espduDataUI
           
protected static java.awt.TextField frequency
           
static short HIGH_BYTE_MASK
           
static short LOW_BYTE_MASK
           
protected static boolean m_fStandAlone
           
static int MAX_TRANSMIT_TIME
           
protected static java.awt.TextField packetsSent
           
static java.lang.String RETURN_STRING
           
protected static boolean sendingPDUs
           
protected static SocketWriteUI socketWriteUI
           
protected static java.awt.Button startButton
           
protected static java.awt.Button stopButton
           
protected static java.awt.TextField timeLimit
           
 
Fields inherited from class java.applet.Applet
 
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
AwtEspduSender()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          ActionListener for the start and stop buttons.
static void debug(java.lang.String pDebugMessage)
           
 void destroy()
           
 short[] fieldValue(java.lang.String pFieldString)
          Pure chrome.
 java.lang.String getAppletInfo()
           
 int[] getBytesInIPAddress(java.net.InetAddress pAddress)
          This is a utility that really should be in another class.
 void init()
           
static void main(java.lang.String[] args)
           
 void paint(java.awt.Graphics g)
           
 void sendPDUs()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, 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, 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, processKeyEvent, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_fStandAlone

protected static boolean m_fStandAlone

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values

DEFAULT_MCAST

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

DEFAULT_PORT

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

DEFAULT_FREQUENCY

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

DEFAULT_MARKING

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

DEFAULT_UNICAST_DEST_PORT

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

DEFAULT_UNICAST_DEST_ADDR

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

DEFAULT_TIMELIMIT

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

DATA_LAYOUT

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

RETURN_STRING

public static final java.lang.String RETURN_STRING

MAX_TRANSMIT_TIME

public static final int MAX_TRANSMIT_TIME
See Also:
Constant Field Values

HIGH_BYTE_MASK

public static final short HIGH_BYTE_MASK
See Also:
Constant Field Values

LOW_BYTE_MASK

public static final short LOW_BYTE_MASK
See Also:
Constant Field Values

sendingPDUs

protected static boolean sendingPDUs

espduData

protected static java.awt.TextArea espduData

socketWriteUI

protected static SocketWriteUI socketWriteUI

espduDataUI

protected static EspduDataUI espduDataUI

frequency

protected static java.awt.TextField frequency

packetsSent

protected static java.awt.TextField packetsSent

timeLimit

protected static java.awt.TextField timeLimit

startButton

protected static java.awt.Button startButton

stopButton

protected static java.awt.Button stopButton
Constructor Detail

AwtEspduSender

public AwtEspduSender()
Method Detail

debug

public static void debug(java.lang.String pDebugMessage)

getBytesInIPAddress

public int[] getBytesInIPAddress(java.net.InetAddress pAddress)
This is a utility that really should be in another class. In an ideal world, this would have been added as a category to InetAddress, if we were using Objective-C. It returns a byte array corresponding to the string "131.120.7.205", or whatever, with byte 0 = 131, byte 1 = 120, etc.

Need to use an array of ints rather than bytes here, since bytes are unsigned, and something like 131 will wrap around, or cause a number format error when converting from a string. A short will also wrap to negative numbers when we bit mask a couple bytes together.


main

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

getAppletInfo

public java.lang.String getAppletInfo()

init

public void init()

destroy

public void destroy()

paint

public void paint(java.awt.Graphics g)

start

public void start()

stop

public void stop()

fieldValue

public short[] fieldValue(java.lang.String pFieldString)
Pure chrome. Let the user enter a field in the form of "131.120" and automatically translate it to an integer. Of course, if the field is already in the form of an integer, leave it alone.


sendPDUs

public void sendPDUs()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
ActionListener for the start and stop buttons. This uses the AWT 1.1 event model, and implemens the ActionListener interface.

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