viewer
Class Interaction

java.lang.Object
  extended by viewer.Interaction

public class Interaction
extends java.lang.Object

Bridges the gap between input and the functions that need to be called to interact with the viewer.

Author:
Henry Gross, Ed Williams

Field Summary
static int LOOK_DOWN
           
static int LOOK_LEFT
           
static int LOOK_RIGHT
           
static int LOOK_UP
           
static int MOVE_BACKWARD
           
static int MOVE_FORWARD
           
static int MOVE_LEFT
           
static int MOVE_RIGHT
           
 
Constructor Summary
Interaction(Viewer viewer, GLViewer glViewer, Console console, Options options, Client client)
          create a new interaction instance and establish to links to everything it might interact with
 
Method Summary
 void attachInteractionListener(InteractionListener interactionListener)
          add an interaction listener to since we have to send some commands there
 void decreaseSensitivity()
          Decrease the sensitivity of movement
 void execute(java.lang.String command)
          parse and execute a command
 void executeFile(java.lang.String filename)
          execute all commands in a file
 int getHeight()
          get the height of the glCanvas
 double getSensitivity()
          Return the current sensitivity setting
 int getWidth()
          get the width of the glCanvas
 void increaseSensitivity()
          Increase the sensitivity of movement
 void move(int dir, boolean state)
          move in a certain direction
 void quit()
          we probably want to quit in some way
 void say(java.lang.String text)
          simply print something to stdout
 void serverExecute(java.lang.String command)
          parse commands the server send us mostly just send them to execute, but we might not want to execute all commands the server sends us
 void setFreeMove(java.lang.String enable)
          allow or disallow the user to move in the z-dimension
 void setSensitivity(double sens)
          set the sensitivity to a specific amount
 void spawn()
          go back to the spawn (start) point
 void takeScreenshot()
          Take a screenshot
 void toggleConsole()
          toggle whether to display the console or not
 void toggleOptions()
          toggle whether to display the options pane or not
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOVE_FORWARD

public static final int MOVE_FORWARD
See Also:
Constant Field Values

MOVE_BACKWARD

public static final int MOVE_BACKWARD
See Also:
Constant Field Values

MOVE_RIGHT

public static final int MOVE_RIGHT
See Also:
Constant Field Values

MOVE_LEFT

public static final int MOVE_LEFT
See Also:
Constant Field Values

LOOK_UP

public static final int LOOK_UP
See Also:
Constant Field Values

LOOK_DOWN

public static final int LOOK_DOWN
See Also:
Constant Field Values

LOOK_RIGHT

public static final int LOOK_RIGHT
See Also:
Constant Field Values

LOOK_LEFT

public static final int LOOK_LEFT
See Also:
Constant Field Values
Constructor Detail

Interaction

public Interaction(Viewer viewer,
                   GLViewer glViewer,
                   Console console,
                   Options options,
                   Client client)
create a new interaction instance and establish to links to everything it might interact with

Method Detail

attachInteractionListener

public void attachInteractionListener(InteractionListener interactionListener)
add an interaction listener to since we have to send some commands there

Parameters:
interactionListener - the interactionListeer to attach to

executeFile

public void executeFile(java.lang.String filename)
execute all commands in a file

Parameters:
filename - the name of the file to execute

serverExecute

public void serverExecute(java.lang.String command)
parse commands the server send us mostly just send them to execute, but we might not want to execute all commands the server sends us

Parameters:
command - the command to execute

execute

public void execute(java.lang.String command)
parse and execute a command

Parameters:
command - the command to execute

say

public void say(java.lang.String text)
simply print something to stdout

Parameters:
text -

move

public void move(int dir,
                 boolean state)
move in a certain direction

Parameters:
dir - the direction to move
state - true if we should move in that direction

spawn

public void spawn()
go back to the spawn (start) point


toggleConsole

public void toggleConsole()
toggle whether to display the console or not


toggleOptions

public void toggleOptions()
toggle whether to display the options pane or not


getHeight

public int getHeight()
get the height of the glCanvas

Returns:
the height of the glCanvas

getWidth

public int getWidth()
get the width of the glCanvas

Returns:
the width of the glCanvas

getSensitivity

public double getSensitivity()
Return the current sensitivity setting

Returns:
the current sensitivity setting

setSensitivity

public void setSensitivity(double sens)
set the sensitivity to a specific amount

Parameters:
sens - the level to set the sensitivity at

increaseSensitivity

public void increaseSensitivity()
Increase the sensitivity of movement


decreaseSensitivity

public void decreaseSensitivity()
Decrease the sensitivity of movement


takeScreenshot

public void takeScreenshot()
Take a screenshot


quit

public void quit()
we probably want to quit in some way


setFreeMove

public void setFreeMove(java.lang.String enable)
allow or disallow the user to move in the z-dimension

Parameters:
enable - true to allow movement along the z-axis