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.AwtMulticastRelayClient

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

public class AwtMulticastRelayClient
extends java.applet.Applet
implements java.awt.event.ActionListener, java.awt.event.ItemListener
A quick applet that does local relay work for multicast. This is a bit better than a plain command line application. Lots of verbose and silly J++ comments included below.

Version:
1.0
Author:
Don McGregor http://www.stl.nps.navy.mil/~mcgredo
See Also:
Serialized Form

Field Summary
static boolean DEBUG
           
static java.lang.String DEFAULT_LOCAL_UNICAST
           
static java.lang.String DEFAULT_MCAST_ADDRESS
           
static java.lang.String DEFAULT_MCAST_PORT
           
static java.lang.String DEFAULT_SERVER_PORT
           
static java.lang.String DEFAULT_SERVER
           
java.awt.TextField localUnicastPort
           
boolean m_fStandAlone
           
static int MAX_PACKET_SIZE
           
java.awt.TextField mcastServer
           
java.awt.TextField mcastServerPort
           
java.awt.Checkbox multicastCheckbox
           
java.net.MulticastSocket multicastSocket
           
java.awt.TextField packetCount
           
java.awt.TextField port
           
java.awt.TextField sendAddress
           
boolean sending
           
static int SOCKET_TIMEOUT
           
java.awt.CheckboxGroup socketTypeRadio
           
java.awt.Button startButton
           
java.awt.Button stopButton
           
java.awt.Checkbox unicastCheckbox
           
java.net.DatagramSocket unicastSocket
           
 
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
AwtMulticastRelayClient()
          Main constructor, which lays out fields in the AWT.
 
Method Summary
void actionPerformed(java.awt.event.ActionEvent ae)
          ActionListener for the start and stop buttons.
static void debug(java.lang.String pDebugString)
          Debugging output aid
void destroy()
           
java.lang.String getAppletInfo()
           
void init()
           
void itemStateChanged(java.awt.event.ItemEvent e)
          itemStateChanged is the implementation of the interface ItemListener, which is used by checkboxes.
static void main(java.lang.String[] args)
           
void paint(java.awt.Graphics g)
           
void relayPackets()
          Does the dirty work of actually relaying the packets.
void start()
           
void stop()
           
 
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
 

Field Detail

DEFAULT_SERVER

public static final java.lang.String DEFAULT_SERVER

DEFAULT_SERVER_PORT

public static final java.lang.String DEFAULT_SERVER_PORT

DEFAULT_MCAST_ADDRESS

public static final java.lang.String DEFAULT_MCAST_ADDRESS

DEFAULT_MCAST_PORT

public static final java.lang.String DEFAULT_MCAST_PORT

DEFAULT_LOCAL_UNICAST

public static final java.lang.String DEFAULT_LOCAL_UNICAST

MAX_PACKET_SIZE

public static final int MAX_PACKET_SIZE

DEBUG

public static final boolean DEBUG

SOCKET_TIMEOUT

public static final int SOCKET_TIMEOUT

m_fStandAlone

boolean m_fStandAlone

mcastServer

java.awt.TextField mcastServer

mcastServerPort

java.awt.TextField mcastServerPort

sendAddress

java.awt.TextField sendAddress

port

java.awt.TextField port

localUnicastPort

java.awt.TextField localUnicastPort

packetCount

java.awt.TextField packetCount

socketTypeRadio

java.awt.CheckboxGroup socketTypeRadio

multicastCheckbox

java.awt.Checkbox multicastCheckbox

unicastCheckbox

java.awt.Checkbox unicastCheckbox

sending

boolean sending

startButton

java.awt.Button startButton

stopButton

java.awt.Button stopButton

unicastSocket

java.net.DatagramSocket unicastSocket

multicastSocket

java.net.MulticastSocket multicastSocket
Constructor Detail

AwtMulticastRelayClient

public AwtMulticastRelayClient()
Main constructor, which lays out fields in the AWT.
Method Detail

debug

public static void debug(java.lang.String pDebugString)
Debugging output aid

main

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

getAppletInfo

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

init

public void init()
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

relayPackets

public void relayPackets()
Does the dirty work of actually relaying the packets. Connects up to the server, reads the packets, and spits them back out again on this side.

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(java.awt.event.ActionEvent) in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged is the implementation of the interface ItemListener, which is used by checkboxes. The checkboxes add us as a listener, and we get their events. This is based on the Java 1.1 event model.
Specified by:
itemStateChanged(java.awt.event.ItemEvent) in interface java.awt.event.ItemListener

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