Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

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

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
 
static java.lang.String  DEFAULT_SERVER_PORT
 
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, containerListenerK, cursor, enabled, eventMask, focusListener, focusListenerK, font, foreground, height, incRate, isInc, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, 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, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
 , addNotify
 
Methods inherited from class java.awt.Container
 add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, dispatchEventImpl, doLayout, eventEnabled, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, nextFocus, paint, paintComponents, paramString, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setLayout, transferFocus, update, validate, validateTree
 
Methods inherited from class java.awt.Component
 , action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, eventEnabled, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isFocusTraversable, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, postsOldMouseEvents, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setCursor, 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, notify, notifyAll, 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.
Implements:
actionPerformed 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.
Implements:
itemStateChanged in interface java.awt.event.ItemListener

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS