com.golden.gamedev.engine.input
Class AWTInput

java.lang.Object
  |
  +--com.golden.gamedev.engine.input.AWTInput
All Implemented Interfaces:
BaseInput

public class AWTInput
extends Object
implements BaseInput


Nested Class Summary
protected  class AWTInput.InputListener
           
 
Field Summary
 
Fields inherited from interface com.golden.gamedev.engine.BaseInput
NO_BUTTON, NO_KEY
 
Constructor Summary
AWTInput(Component comp)
           
 
Method Summary
 void cleanup()
           
protected  AWTInput.InputListener createInputListener()
           
 Component getComponent()
          Returns the awt component used by this input.
 boolean[] getKeyDown()
           
 int getKeyPressed()
           
 int getKeyReleased()
           
 boolean[] getMouseDown()
           
 int getMouseDX()
           
 int getMouseDY()
           
 int getMousePressed()
           
 int getMouseReleased()
           
 int getMouseX()
           
 int getMouseY()
           
 boolean isKeyDown(int keyCode)
           
 boolean isKeyPressed(int keyCode)
           
 boolean isKeyReleased(int keyCode)
           
 boolean isMouseDown(int button)
           
 boolean isMouseExists()
           
 boolean isMousePressed(int button)
           
 boolean isMouseReleased(int button)
           
 void mouseMove(int x, int y)
          Move the mouse to x, y screen coordinate.
 void refresh()
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTInput

public AWTInput(Component comp)
Method Detail

createInputListener

protected AWTInput.InputListener createInputListener()

cleanup

public void cleanup()
Specified by:
cleanup in interface BaseInput

refresh

public void refresh()
Specified by:
refresh in interface BaseInput

update

public void update()
Specified by:
update in interface BaseInput

mouseMove

public void mouseMove(int x,
                      int y)
Description copied from interface: BaseInput
Move the mouse to x, y screen coordinate.

Specified by:
mouseMove in interface BaseInput
Parameters:
x - the x-coordinate of the new mouse location
y - the y-coordinate of the new mouse location

isMouseExists

public boolean isMouseExists()
Specified by:
isMouseExists in interface BaseInput

getMouseX

public int getMouseX()
Specified by:
getMouseX in interface BaseInput

getMouseY

public int getMouseY()
Specified by:
getMouseY in interface BaseInput

getMouseDX

public int getMouseDX()
Specified by:
getMouseDX in interface BaseInput

getMouseDY

public int getMouseDY()
Specified by:
getMouseDY in interface BaseInput

getMouseReleased

public int getMouseReleased()
Specified by:
getMouseReleased in interface BaseInput

isMouseReleased

public boolean isMouseReleased(int button)
Specified by:
isMouseReleased in interface BaseInput

getMousePressed

public int getMousePressed()
Specified by:
getMousePressed in interface BaseInput

isMousePressed

public boolean isMousePressed(int button)
Specified by:
isMousePressed in interface BaseInput

getMouseDown

public boolean[] getMouseDown()
Specified by:
getMouseDown in interface BaseInput

isMouseDown

public boolean isMouseDown(int button)
Specified by:
isMouseDown in interface BaseInput

getKeyReleased

public int getKeyReleased()
Specified by:
getKeyReleased in interface BaseInput

isKeyReleased

public boolean isKeyReleased(int keyCode)
Specified by:
isKeyReleased in interface BaseInput

getKeyPressed

public int getKeyPressed()
Specified by:
getKeyPressed in interface BaseInput

isKeyPressed

public boolean isKeyPressed(int keyCode)
Specified by:
isKeyPressed in interface BaseInput

getKeyDown

public boolean[] getKeyDown()
Specified by:
getKeyDown in interface BaseInput

isKeyDown

public boolean isKeyDown(int keyCode)
Specified by:
isKeyDown in interface BaseInput

getComponent

public Component getComponent()
Returns the awt component used by this input.