org.zaval.lw.event
Class LwMouseEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.zaval.lw.event.LwAWTEvent
              |
              +--org.zaval.lw.event.LwMouseEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LwMouseMotionEvent

public class LwMouseEvent
extends LwAWTEvent

This class is used with light weight components to describe mouse events.

See Also:
Serialized Form

Field Summary
protected  int ax
           
protected  int ay
           
protected  int clickCount
           
protected  int mask
           
static int MOUSE_CLICKED
          The mouse clicked event type.
static int MOUSE_ENTERED
          The mouse entered event type.
static int MOUSE_EXITED
          The mouse exited event type.
static int MOUSE_PRESSED
          The mouse pressed event type.
static int MOUSE_RELEASED
          The mouse released event type.
protected  int x
           
protected  int y
           
 
Fields inherited from class org.zaval.lw.event.LwAWTEvent
COMP_UID, CONT_UID, FOCUS_UID, id, KEY_UID, MOTION_UID, MOUSE_UID, WIN_UID
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LwMouseEvent(LwComponent target, int id, int ax, int ay, int mask, int clickCount)
          Constructs the event object with the specified source object, the event id, the absolute mouse pointer location, mask and click count.
 
Method Summary
 int getAbsX()
          Gets the x coordinate of the mouse pointer relatively the desktop parent component.
 int getAbsY()
          Gets the y coordinate of the mouse pointer relatively the desktop parent component.
 int getClickCount()
          Gets the number of consecutive mouse clicks.
 int getMask()
          Gets the mask.
 int getUID()
          Gets the UID of the event.
 int getX()
          Gets the x coordinate of the mouse pointer relatively the source component.
 int getY()
          Gets the y coordinate of the mouse pointer relatively the source component.
 void reset(LwComponent target, int id, int ax, int ay, int mask, int clickCount)
           
 
Methods inherited from class org.zaval.lw.event.LwAWTEvent
getID, getLwComponent
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOUSE_CLICKED

public static final int MOUSE_CLICKED
The mouse clicked event type.

MOUSE_PRESSED

public static final int MOUSE_PRESSED
The mouse pressed event type.

MOUSE_RELEASED

public static final int MOUSE_RELEASED
The mouse released event type.

MOUSE_ENTERED

public static final int MOUSE_ENTERED
The mouse entered event type.

MOUSE_EXITED

public static final int MOUSE_EXITED
The mouse exited event type.

x

protected int x

y

protected int y

ax

protected int ax

ay

protected int ay

mask

protected int mask

clickCount

protected int clickCount
Constructor Detail

LwMouseEvent

public LwMouseEvent(LwComponent target,
                    int id,
                    int ax,
                    int ay,
                    int mask,
                    int clickCount)
Constructs the event object with the specified source object, the event id, the absolute mouse pointer location, mask and click count. The location defines x and y coordinates relatively the desktop parent component of the light weight source component.
Parameters:
target - the object where the event originated.
id - the specified event id.
ax - the x coordinate relatively the desktop parent component.
ay - the y coordinate relatively the desktop parent component.
mask - the specified mask. The mask can be used to check trigger keys status.
clickCount - the number of consecutive clicks.
Method Detail

reset

public void reset(LwComponent target,
                  int id,
                  int ax,
                  int ay,
                  int mask,
                  int clickCount)

getMask

public int getMask()
Gets the mask. The mask can be used to test if the "Ctrl", "Alt" and so on keys are pressed or not. Use java.awt.event.InputEvent key modifiers constants for the purpose.
Returns:
a mask.

getAbsX

public int getAbsX()
Gets the x coordinate of the mouse pointer relatively the desktop parent component.
Returns:
a x coordinate.

getAbsY

public int getAbsY()
Gets the y coordinate of the mouse pointer relatively the desktop parent component.
Returns:
an y coordinate.

getX

public int getX()
Gets the x coordinate of the mouse pointer relatively the source component.
Returns:
a x coordinate.

getY

public int getY()
Gets the y coordinate of the mouse pointer relatively the source component.
Returns:
an y coordinate.

getUID

public int getUID()
Gets the UID of the event. The class uses LwAWTEvent.MOUSE_UID as the event UID.
Overrides:
getUID in class LwAWTEvent
Returns:
an UID.

getClickCount

public int getClickCount()
Gets the number of consecutive mouse clicks.
Returns:
a number of consecutive mouse clicks.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org