org.globalse.arena.sword.hci
Class SwordControl

java.lang.Object
  |
  +--org.globalse.arena.sword.hci.SwordControl

public class SwordControl
extends java.lang.Object
implements java.awt.event.ActionListener, EventSink

The class AdventurerControl is responsible for fetching the input data from Mouse, SpeechRecognizer and HeadMotionTracker. It takes as input the x and y coordinates from Mouse, the Bytes from the HeadMotionTracker which can be 0, 1 or 2,the Strings from Speechrecognizer, and commands from the GUI like from Buttons or menues. During the game it listens to any events from the devices (if they are activated by the launcher). It passes the events to SWORDengine. $Id: SwordControl.html,v 1.1 2003/02/12 18:06:21 schoecke Exp $


Constructor Summary
SwordControl(DrawManager pDrawManager, ObjectManager pObjectManager, Adventurer pAdventurer, GameGUI gui)
          Constructor with parameter.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Control for the HMT
 void attackButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void distributeChatMessage(java.lang.String msg)
          distributes a chatMessage to all peers
 void dropButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 java.lang.String getObjectInInfluenceRange()
          Gets the Object near the position
 void handleRecognizedPhrase(java.lang.String function)
          Handles the recognized phrase.
 void loadChar()
          Method loadChar, opens a dialog, calls loadCharacter from gameManager
 void lookAtButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void magicButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void mapMouseDown(java.awt.event.MouseEvent event)
          Handles mouse events by map.
 void menuGameExit_actionPerformed(java.awt.event.ActionEvent e)
          This method exits the game when you enter the menu and click on Exit Game.
 void menuSelectionGUI()
          Gets the GUI's menu commands
 void messageToVoice(java.lang.String msg)
           
 void moveTo(int speed)
          Gets the moving input from keyboard or tracker moves the adventurer forward or backward stop when caps are releasd or tracker in neutral position
 void pickUpButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void processEvent(Event e)
           
 void rotate(int speed)
          Gets the rotating input from keyboard or tracker rotates the adventurer left or right stop when caps are releasd or tracker in neutral position
 void saveChar()
          Method saveChar, opens adialog, and calls saveCharacter from gameManager
 void saveGame()
          Method saveGame.
 void setAdventurer(Adventurer a)
          Method setAdventurer.
 boolean setSelectedObject(java.lang.String pSelectedObject)
          Selected item was changed.
 boolean speechControlAvailable()
           
 void startRecognizer()
          Starts the SpeechRecognition which is only available for Mac OSX by now
 void stopRecognizer()
          Stops the SpeechRecognition
 void talkButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void useWithButton_actionPerformed(java.awt.event.ActionEvent event)
          Gets the Input from the GUI like Items or command-buttons clicked
 void worldKeyPressed(java.awt.event.KeyEvent event)
          Handles the key press events.
 void worldKeyReleased(java.awt.event.KeyEvent event)
          Handles the key released events.
 void worldMouseDown(java.awt.event.MouseEvent event, MathVector pMathVector)
          Handles mouse events by world.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwordControl

public SwordControl(DrawManager pDrawManager,
                    ObjectManager pObjectManager,
                    Adventurer pAdventurer,
                    GameGUI gui)
Constructor with parameter.
Parameters:
ObjectManager, - Adventurer
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Control for the HMT
Specified by:
actionPerformed in interface java.awt.event.ActionListener

speechControlAvailable

public boolean speechControlAvailable()

startRecognizer

public void startRecognizer()
Starts the SpeechRecognition which is only available for Mac OSX by now
Parameters:
none -  
Returns:
none

stopRecognizer

public void stopRecognizer()
Stops the SpeechRecognition
Parameters:
none -  
Returns:
none

getObjectInInfluenceRange

public java.lang.String getObjectInInfluenceRange()
Gets the Object near the position
Parameters:
MathVector - realWorldCoordinates
Returns:
FRAGObject or null

handleRecognizedPhrase

public void handleRecognizedPhrase(java.lang.String function)
Handles the recognized phrase. Was called from the API.
Parameters:
String - recognized Phrase

worldKeyPressed

public void worldKeyPressed(java.awt.event.KeyEvent event)
Handles the key press events.
Parameters:
keyEvent -  
Returns:
none

worldKeyReleased

public void worldKeyReleased(java.awt.event.KeyEvent event)
Handles the key released events.
Parameters:
KeyEvent -  
Returns:
none

worldMouseDown

public void worldMouseDown(java.awt.event.MouseEvent event,
                           MathVector pMathVector)
Handles mouse events by world.
Parameters:
MouseEvent, - MathVector the top-left corner
Returns:
boolean returned true, if the cursor change

mapMouseDown

public void mapMouseDown(java.awt.event.MouseEvent event)
Handles mouse events by map.
Parameters:
MouseEvent -  
Returns:
none

moveTo

public void moveTo(int speed)
Gets the moving input from keyboard or tracker moves the adventurer forward or backward stop when caps are releasd or tracker in neutral position

rotate

public void rotate(int speed)
Gets the rotating input from keyboard or tracker rotates the adventurer left or right stop when caps are releasd or tracker in neutral position

attackButton_actionPerformed

public void attackButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

pickUpButton_actionPerformed

public void pickUpButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

dropButton_actionPerformed

public void dropButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

useWithButton_actionPerformed

public void useWithButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

talkButton_actionPerformed

public void talkButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

magicButton_actionPerformed

public void magicButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

lookAtButton_actionPerformed

public void lookAtButton_actionPerformed(java.awt.event.ActionEvent event)
Gets the Input from the GUI like Items or command-buttons clicked

setSelectedObject

public boolean setSelectedObject(java.lang.String pSelectedObject)
Selected item was changed.
Parameters:
String - item

menuGameExit_actionPerformed

public void menuGameExit_actionPerformed(java.awt.event.ActionEvent e)
This method exits the game when you enter the menu and click on Exit Game.
Parameters:
ActionEvent - when clicking on Exit Game in the menu

menuSelectionGUI

public void menuSelectionGUI()
Gets the GUI's menu commands

saveGame

public void saveGame()
Method saveGame. saves the game, opens a dialog

loadChar

public void loadChar()
Method loadChar, opens a dialog, calls loadCharacter from gameManager

saveChar

public void saveChar()
Method saveChar, opens adialog, and calls saveCharacter from gameManager
Parameters:
e -  

setAdventurer

public void setAdventurer(Adventurer a)
Method setAdventurer. sets the adventurer field in this object
Parameters:
a - instanceof Adventurer

processEvent

public void processEvent(Event e)
Specified by:
processEvent in interface EventSink

distributeChatMessage

public void distributeChatMessage(java.lang.String msg)
distributes a chatMessage to all peers

messageToVoice

public void messageToVoice(java.lang.String msg)



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)