Boeing Simulation 3.1 API Specification

command.visualizer
Class GraphicalTCVisualizer

java.lang.Object
  |
  +--visualizer.SocketVisualizerTemplate
        |
        +--command.visualizer.GraphicalTCVisualizer
All Implemented Interfaces:
CommandControlVisualizer

public class GraphicalTCVisualizer
extends SocketVisualizerTemplate
implements CommandControlVisualizer

A visualizer that prints out when the server receives an WorldState update and takes input to move Targetable units around.

Version:
$Revision: 1.5 $
Author:
Rob LeGrand

Field Summary
protected static double CLICK_SIGNIFICANCE
          The distance on the unit square at which the user's click is defined as clicking on a displayed object.
private  world.WorldState currentState
          The most recent WorldState sent by the ComponentizedSimulator.
private  objects.Location destination
          The destination Location currently selected for the units in units to move to.
private static long serialVersionUID
          This is for cross-machine compatibility
private  connect.SupplierChannel toTargetControl
          The supplier connection to the TargetControl that is connected.
private  boolean unitListed
          Whether selected objects are added to the units list.
private  Set units
          The Set of all Targetable units currently selected for the MoveMission waiting to be sent.
private  visualizer.WorldStateViz worldViz
          This visualization for the World.
 
Fields inherited from class visualizer.SocketVisualizerTemplate
 
Constructor Summary
GraphicalTCVisualizer(connect.CreatesConnection remoteComponent)
           
 
Method Summary
protected  void addUnit(objects.Location clickLoc)
          Identifies the closest Targetable object within the significant range and add it to list of units.
private  void moveUnits(String direction)
          Sends an order to move the currently selected Targetable units.
protected  void processAcceptedConnection(Class hostType, connect.ChannelBundle acceptedConnection)
          When a component connects to the component that it requested the connection to, this method is called.
private  void resetMission()
          Resets the current list of units and destination.
private  void sendMission()
          Sends the TargetControl a Set containing one or more units and a Location to which they should move.
 
Methods inherited from class visualizer.SocketVisualizerTemplate
connect, getComponentEmissary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
This is for cross-machine compatibility

See Also:
Constant Field Values

worldViz

private visualizer.WorldStateViz worldViz
This visualization for the World.


currentState

private world.WorldState currentState
The most recent WorldState sent by the ComponentizedSimulator.


CLICK_SIGNIFICANCE

protected static final double CLICK_SIGNIFICANCE
The distance on the unit square at which the user's click is defined as clicking on a displayed object.

See Also:
Constant Field Values

unitListed

private boolean unitListed
Whether selected objects are added to the units list.


units

private Set units
The Set of all Targetable units currently selected for the MoveMission waiting to be sent.


destination

private objects.Location destination
The destination Location currently selected for the units in units to move to.


toTargetControl

private connect.SupplierChannel toTargetControl
The supplier connection to the TargetControl that is connected.

Constructor Detail

GraphicalTCVisualizer

public GraphicalTCVisualizer(connect.CreatesConnection remoteComponent)
Method Detail

addUnit

protected void addUnit(objects.Location clickLoc)
Identifies the closest Targetable object within the significant range and add it to list of units.


processAcceptedConnection

protected void processAcceptedConnection(Class hostType,
                                         connect.ChannelBundle acceptedConnection)
Description copied from class: SocketVisualizerTemplate
When a component connects to the component that it requested the connection to, this method is called.

Specified by:
processAcceptedConnection in class SocketVisualizerTemplate

sendMission

private void sendMission()
Sends the TargetControl a Set containing one or more units and a Location to which they should move. If either the set is empty or the location is null, the current mission is reset and nothing is sent.


resetMission

private void resetMission()
Resets the current list of units and destination.


moveUnits

private void moveUnits(String direction)
Sends an order to move the currently selected Targetable units. The direction String can be "left", "down", "up", "right", "stop" (stop random movement) or "go" (resume random movement).


Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.