edu
Class WB

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--edu.WB

public class WB
extends javax.swing.JFrame
implements java.awt.event.ActionListener

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  boolean advanceGranted
           
(package private)  java.util.Hashtable ctrlClasses
           
(package private)  java.util.Hashtable ctrlImages
           
(package private)  double currentTime
           
(package private)  Tool currentTool
           
(package private)  WBContainer display
           
(package private)  EntityManager eManager
           
(package private)  javax.swing.JMenuItem exitItem
           
(package private)  java.lang.String ExitTxt
           
(package private)  java.lang.String fedCnfName
           
(package private)  short federateId
           
(package private)  java.lang.String fedName
           
(package private)  java.lang.Object guard
           
(package private)  javax.swing.JPanel infoHolder
           
(package private)  boolean isConnected
           
(package private)  java.io.PrintWriter myLog
           
(package private)  java.lang.String myName
           
(package private)  AppletProps parent
           
(package private)  double requestTime
           
(package private)  RTIcap.RTIambassador rtiAmb
           
(package private)  double timeStep
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
WB(AppletProps a, RTIcap.RTIambassador _rtiAmb)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          ActionListener interface to collect the user events.
(package private)  void deleteObjects()
           
(package private)  void doExit()
          Move the frame back, and destroy the execution.
(package private)  void doExit(java.lang.String msg)
          Move the frame back, and destroy the execution.
(package private)  void doRealyConnect()
          Connects to the Federation Execution
(package private)  boolean getRtiIds()
          Gets the RTTI (Meta-Object Protocol MOP) handles.
(package private)  void giveError(java.lang.String mess)
          Displays the error message in the warning window.
(package private)  void init(AppletProps a)
           
 boolean isTimeAdvanceGranted()
           
(package private)  boolean joinFederationExecution(RTIcap.FederateAmbassador fedAmb)
          We want to join the Federation but we do not know its ID and whether it is on.
(package private)  void leaveFederationExecution()
          Before we leave the Federation 1.
protected  void processEvent(java.awt.AWTEvent e)
           
protected  void processWindowEvent(java.awt.event.WindowEvent e)
           
(package private)  boolean publishSubscribe()
          Describe our interest for publishing objects and attributes.
 void resetTimeAdvanceGranted()
           
 void setCurrentTime(double _newTime)
           
 void setTimeAdvanceGranted()
          This method will be invoked by HwFededarateAmbassador object whenever timeAdvanceGrant timeConstrainedEnabled timeRegulationEnabled messages received.
(package private)  void tickRTI()
          Ticks the RTIambassador.
 void tickRTI(long sleepTime)
          Ticks the RTIambassador.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, removeOwnedWindow, removeWindowListener, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

guard

java.lang.Object guard

fedName

java.lang.String fedName

fedCnfName

java.lang.String fedCnfName

rtiAmb

RTIcap.RTIambassador rtiAmb

myLog

java.io.PrintWriter myLog

parent

AppletProps parent

ctrlImages

java.util.Hashtable ctrlImages

ctrlClasses

java.util.Hashtable ctrlClasses

infoHolder

javax.swing.JPanel infoHolder

display

WBContainer display

currentTool

Tool currentTool

exitItem

javax.swing.JMenuItem exitItem

ExitTxt

java.lang.String ExitTxt

myName

java.lang.String myName

advanceGranted

boolean advanceGranted

currentTime

double currentTime

timeStep

double timeStep

requestTime

double requestTime

isConnected

boolean isConnected

federateId

short federateId

eManager

EntityManager eManager
Constructor Detail

WB

public WB(AppletProps a,
          RTIcap.RTIambassador _rtiAmb)
Method Detail

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Overrides:
processWindowEvent in class javax.swing.JFrame

processEvent

protected void processEvent(java.awt.AWTEvent e)
Overrides:
processEvent in class java.awt.Window

init

void init(AppletProps a)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
ActionListener interface to collect the user events.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent

getRtiIds

boolean getRtiIds()
Gets the RTTI (Meta-Object Protocol MOP) handles.

publishSubscribe

boolean publishSubscribe()
Describe our interest for publishing objects and attributes. Describe our interest for receiving objects and attributes. Describe our interest for publishing interations and parameters. Describe our interest for receiving interations and parameters.

joinFederationExecution

boolean joinFederationExecution(RTIcap.FederateAmbassador fedAmb)
We want to join the Federation but we do not know its ID and whether it is on. Therefore, we first try to create this Federation. If this federation is already exists, we will receive the exception. If not, it will be created for us. Then we need to join this execution and get ourself a federate id.

deleteObjects

void deleteObjects()

leaveFederationExecution

void leaveFederationExecution()
Before we leave the Federation 1. Delete all the object that we are suppose(promised) to simulate. 2. resign from the federation. 3. Try to destroy the federation execution. Note that if there are still federates in the Federation, the federation execution won't be stopped. Only, we resign it.

tickRTI

public void tickRTI(long sleepTime)
Ticks the RTIambassador.

tickRTI

void tickRTI()
Ticks the RTIambassador.

doRealyConnect

void doRealyConnect()
Connects to the Federation Execution

giveError

void giveError(java.lang.String mess)
Displays the error message in the warning window.
Parameters:
mess - Error message.

doExit

void doExit()
Move the frame back, and destroy the execution.

doExit

void doExit(java.lang.String msg)
Move the frame back, and destroy the execution.

resetTimeAdvanceGranted

public void resetTimeAdvanceGranted()

setTimeAdvanceGranted

public void setTimeAdvanceGranted()
This method will be invoked by HwFededarateAmbassador object whenever timeAdvanceGrant timeConstrainedEnabled timeRegulationEnabled messages received.

isTimeAdvanceGranted

public boolean isTimeAdvanceGranted()

setCurrentTime

public void setCurrentTime(double _newTime)