|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gameframe.engines.jdk11x.CPointer
Implementation of the pointer device for the Java 1.1 platform.
Field Summary | |
private static int |
BUTTONSTATE_DOWN
Enumerated value for state button is down. |
private static int |
BUTTONSTATE_UP
Enumerated value for state button is up. |
private static int |
BUTTONSTATE_WAS_DOWN_NOT_READ
Enumerated value for state where button was down but was not read during that time. |
private static int |
BUTTONSTATE_WAS_DOWN_READ
Enumerated value for state where button was down and was read during that time. |
private int[] |
m_aButtonStates
States of the buttons. |
private int[] |
m_aNumButtonPresses
Number of times the button was stroken. |
private java.awt.Component |
m_focusComponent
Reference to the focus component that is the source of keyboard events. |
private int |
m_x
The current X-coordinate of the mouse. |
private int |
m_y
The current Y-coordinate of the mouse. |
Constructor Summary | |
(package private) |
CPointer(java.awt.Component focusComponent)
Constructs a pointer device whose focus component is the given window. |
Method Summary | |
void |
finalize()
Releases all resources held by the pointer device implementation. |
int |
getButtonDownCount(int buttonId)
Returns the number of times the button has been stroken since last reading (after last call made to wasButtonDown or getButtonDownCount methods with the same button id number). |
private int |
getMouseButtonId(java.awt.event.MouseEvent event)
Returns the mouse button ID (number) from the given event. |
int |
getX()
Returns the X-coordinate of the pointer devices current location. |
int |
getY()
Returns the Y-coordinate of the pointer devices current location. |
boolean |
isButtonDown(int buttonId)
Returns true if the button is down. |
void |
mouseClicked(java.awt.event.MouseEvent event)
Called when mouse button is clicked in the focus window. |
void |
mouseDragged(java.awt.event.MouseEvent event)
Called when mouse is dragged inside the focus window. |
void |
mouseEntered(java.awt.event.MouseEvent event)
Called when mouse enters the focus window. |
void |
mouseExited(java.awt.event.MouseEvent event)
Called when mouse leaves the focus window. |
void |
mouseMoved(java.awt.event.MouseEvent event)
Called when mouse is moved inside the focus window. |
void |
mousePressed(java.awt.event.MouseEvent event)
Called when mouse is pressed inside the focus window. |
void |
mouseReleased(java.awt.event.MouseEvent event)
Called when mouse is released inside the focus window. |
boolean |
wasButtonDown(int buttonId)
Returns true if the button was briefly kept down after last reading of the buttons state and that event hasn't been read by any other method (after last call made to isButtonDown, wasButtonDown or getButtonDownCount methods with the same button id number). |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.awt.Component m_focusComponent
private int m_x
private int m_y
private int[] m_aButtonStates
private int[] m_aNumButtonPresses
private static final int BUTTONSTATE_UP
private static final int BUTTONSTATE_DOWN
private static final int BUTTONSTATE_WAS_DOWN_NOT_READ
private static final int BUTTONSTATE_WAS_DOWN_READ
Constructor Detail |
CPointer(java.awt.Component focusComponent)
focusComponent
- The component that receives the mouse events.Method Detail |
public int getX()
getX
in interface PointerDevice
public int getY()
getY
in interface PointerDevice
public boolean isButtonDown(int buttonId)
isButtonDown
in interface PointerDevice
buttonId
- The number of the button we want to query.public boolean wasButtonDown(int buttonId)
wasButtonDown
in interface PointerDevice
buttonId
- The number of the button we want to query.public int getButtonDownCount(int buttonId)
getButtonDownCount
in interface PointerDevice
buttonId
- The number of the button we want to query.public void mouseEntered(java.awt.event.MouseEvent event)
mouseEntered
in interface java.awt.event.MouseListener
event
- The event object that describes the event in more detail.public void mouseExited(java.awt.event.MouseEvent event)
mouseExited
in interface java.awt.event.MouseListener
event
- The event object that describes the event in more detail.public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
event
- The event object that describes the event in more detail.public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface java.awt.event.MouseMotionListener
event
- The event object that describes the event in more detail.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
event
- The event object that describes the event in more detail.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
event
- The event object that describes the event in more detail.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
event
- The event object that describes the event in more detail.private int getMouseButtonId(java.awt.event.MouseEvent event)
event
- The event object that describes the event in more detail.public void finalize()
finalize
in class java.lang.Object
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |