javax.rad.ui.event
Class UIMouseEvent

java.lang.Object
  extended by javax.rad.ui.event.UIEvent
      extended by javax.rad.ui.event.UIMouseEvent

public class UIMouseEvent
extends UIEvent

Platform and technology independent mouse event definition. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .

See Also:
MouseEvent

Field Summary
static int MOUSE_CLICKED
          The "mouse clicked" event.
static int MOUSE_ENTERED
          The "mouse entered" event.
static int MOUSE_EXITED
          The "mouse exited" event.
static int MOUSE_FIRST
          The first number in the range of ids used for mouse events.
static int MOUSE_LAST
          The last number in the range of ids used for mouse events.
static int MOUSE_PRESSED
          The "mouse pressed" event.
static int MOUSE_RELEASED
          The "mouse released" event.
 
Fields inherited from class javax.rad.ui.event.UIEvent
ALT_GRAPH_MASK, ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
 
Constructor Summary
UIMouseEvent(IComponent pSource, int pId, long pWhen, int pModifiers, int pX, int pY, int pClickCount, boolean pPopupTrigger)
          Creates a new instance of UIMouseEvent.
 
Method Summary
protected  void checkId(int pId)
          Checks if the current Instance of UIEvent allows the given id.
 int getClickCount()
          Returns the number of mouse clicks associated with this event.
 int getX()
          Returns the horizontal x position of the event relative to the source component.
 int getY()
          Returns the vertical y position of the event relative to the source component.
 boolean isPopupTrigger()
          Returns whether or not this mouse event is the popup menu trigger event for the platform.
 
Methods inherited from class javax.rad.ui.event.UIEvent
getId, getModifiers, getSource, getWhen, isModifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOUSE_FIRST

public static final int MOUSE_FIRST
The first number in the range of ids used for mouse events.

See Also:
Constant Field Values

MOUSE_CLICKED

public static final int MOUSE_CLICKED
The "mouse clicked" event. This MouseEvent occurs when a mouse button is pressed and released.

See Also:
Constant Field Values

MOUSE_PRESSED

public static final int MOUSE_PRESSED
The "mouse pressed" event. This MouseEvent occurs when a mouse button is pushed down.

See Also:
Constant Field Values

MOUSE_RELEASED

public static final int MOUSE_RELEASED
The "mouse released" event. This MouseEvent occurs when a mouse button is let up.

See Also:
Constant Field Values

MOUSE_ENTERED

public static final int MOUSE_ENTERED
The "mouse entered" event. This MouseEvent occurs when the mouse cursor enters the unobscured part of component's geometry.

See Also:
Constant Field Values

MOUSE_EXITED

public static final int MOUSE_EXITED
The "mouse exited" event. This MouseEvent occurs when the mouse cursor exits the unobscured part of component's geometry.

See Also:
Constant Field Values

MOUSE_LAST

public static final int MOUSE_LAST
The last number in the range of ids used for mouse events.

See Also:
Constant Field Values
Constructor Detail

UIMouseEvent

public UIMouseEvent(IComponent pSource,
                    int pId,
                    long pWhen,
                    int pModifiers,
                    int pX,
                    int pY,
                    int pClickCount,
                    boolean pPopupTrigger)
Creates a new instance of UIMouseEvent.

Parameters:
pSource - the Source of this UIMouseEvent.
pId - the Id of this UIMouseEvent.
pWhen - the time the event occurred
pModifiers - represents the modifier keys and mouse buttons down while the event occurred
pX - the horizontal x coordinate for the mouse location
pY - the vertical y coordinate for the mouse location
pClickCount - the number of mouse clicks associated with event
pPopupTrigger - a boolean, true if this event is a trigger for a popup menu
Method Detail

checkId

protected void checkId(int pId)
Checks if the current Instance of UIEvent allows the given id.

Overrides:
checkId in class UIEvent
Parameters:
pId - the Id of this UIEvent.

getX

public int getX()
Returns the horizontal x position of the event relative to the source component.

Returns:
an integer indicating horizontal position relative to the component

getY

public int getY()
Returns the vertical y position of the event relative to the source component.

Returns:
an integer indicating vertical position relative to the component

getClickCount

public int getClickCount()
Returns the number of mouse clicks associated with this event.

Returns:
integer value for the number of clicks

isPopupTrigger

public boolean isPopupTrigger()
Returns whether or not this mouse event is the popup menu trigger event for the platform.

Note: Popup menus are triggered differently on different systems. Therefore, isPopupTrigger should be checked in both mousePressed and mouseReleased for proper cross-platform functionality.

Returns:
true if this event is the popup menu trigger for this platform


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.