yu.ac.bg.etf.javaqx.qswing.events
Class MouseEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byyu.ac.bg.etf.javaqx.qswing.events.QSwingEvent
          extended byyu.ac.bg.etf.javaqx.qswing.events.ComponentEvent
              extended byyu.ac.bg.etf.javaqx.qswing.events.InputEvent
                  extended byyu.ac.bg.etf.javaqx.qswing.events.MouseEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MouseWheelEvent

public class MouseEvent
extends InputEvent

Mouse Event.

NOTE: This class is not full compatible with java.awt.event.MouseEvent class!

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)
See Also:
Serialized Form

Field Summary
static int BUTTON1
          Indicates that button 1 changed state.
static int BUTTON2
          Indicates that button 2 changed state.
static int BUTTON3
          Indicates button 3 changed state.
static int MOUSE_CLICKED
          Mouse clicked id.
static int MOUSE_DRAGGED
          Mouse dragged id.
static int MOUSE_ENTERED
          Mouse entered id.
static int MOUSE_EXITED
          Mouse exited id.
static int MOUSE_MOVED
          Mouse moved id.
static int MOUSE_PRESSED
          Mouse pressed id.
static int MOUSE_RELEASED
          Mouse released id.
static int MOUSE_WHEEL
          Mouse wheel id.
static int NOBUTTON
          Indicates that no button changed state.
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.events.InputEvent
ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.events.ComponentEvent
COMPONENT_HIDDEN, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.events.QSwingEvent
ACTION_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTEXT_MENU_EVENT_MASK, CUSTOM_CONTEXT_MENU_EVENT_MASK, FOCUS_EVENT_MASK, id, KEY_EVENT_MASK, LOCATION_TOOL_TIP_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, PAINT_VIEW_EVENT_MASK, WINDOW_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MouseEvent(JQComponent source, int id, long when, int modifiers, int x, int y, int clickCount)
          Constructs new MouseEvent object.
MouseEvent(JQComponent source, int id, long when, int modifiers, int x, int y, int clickCount, int button)
          Constructs new MouseEvent object.
 
Method Summary
 int getButton()
          Returns the button that changed state.
 int getClickCount()
          Returns click count.
 Point getPoint()
          Returns point of the mouse pointer relative to the source component.
 int getX()
          Returns the x coordinate of the mouse position relative to the source component.
 int getY()
          Returns the y coordinate of the mouse position relative to the source component.
 java.lang.String paramString()
          Returns string representation of the event.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.events.InputEvent
consume, getModifiers, getModifiersText, getWhen, isAltDown, isConsumed, isControlDown, isMetaDown, isShiftDown
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.events.ComponentEvent
getComponent
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.events.QSwingEvent
getID, toString
 
Methods inherited from class java.util.EventObject
getSource
 
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
Mouse clicked id.

See Also:
Constant Field Values

MOUSE_PRESSED

public static final int MOUSE_PRESSED
Mouse pressed id.

See Also:
Constant Field Values

MOUSE_RELEASED

public static final int MOUSE_RELEASED
Mouse released id.

See Also:
Constant Field Values

MOUSE_MOVED

public static final int MOUSE_MOVED
Mouse moved id.

See Also:
Constant Field Values

MOUSE_ENTERED

public static final int MOUSE_ENTERED
Mouse entered id.

See Also:
Constant Field Values

MOUSE_EXITED

public static final int MOUSE_EXITED
Mouse exited id.

See Also:
Constant Field Values

MOUSE_DRAGGED

public static final int MOUSE_DRAGGED
Mouse dragged id.

See Also:
Constant Field Values

MOUSE_WHEEL

public static final int MOUSE_WHEEL
Mouse wheel id.

See Also:
Constant Field Values

NOBUTTON

public static final int NOBUTTON
Indicates that no button changed state.

See Also:
Constant Field Values

BUTTON1

public static final int BUTTON1
Indicates that button 1 changed state.

See Also:
Constant Field Values

BUTTON2

public static final int BUTTON2
Indicates that button 2 changed state.

See Also:
Constant Field Values

BUTTON3

public static final int BUTTON3
Indicates button 3 changed state.

See Also:
Constant Field Values
Constructor Detail

MouseEvent

public MouseEvent(JQComponent source,
                  int id,
                  long when,
                  int modifiers,
                  int x,
                  int y,
                  int clickCount,
                  int button)
Constructs new MouseEvent object.

Parameters:
source - the source component
id - the event id
when - the time the event occurred
modifiers - the modifiers
x - the x coordinate of the mouse point
y - the y coordinate of the mouse point
clickCount - the click count
button - the mouse button
Throws:
java.lang.IllegalArgumentException - if the source is null

MouseEvent

public MouseEvent(JQComponent source,
                  int id,
                  long when,
                  int modifiers,
                  int x,
                  int y,
                  int clickCount)
Constructs new MouseEvent object.

Parameters:
source - the source component
id - the event id
when - the time the event occurred
modifiers - the modifiers
x - the x coordinate of the mouse point
y - the y coordinate of the mouse point
clickCount - the click count
Throws:
java.lang.IllegalArgumentException - if the source is null
Method Detail

getX

public int getX()
Returns the x coordinate of the mouse position relative to the source component.

Returns:
the x coordinate

getY

public int getY()
Returns the y coordinate of the mouse position relative to the source component.

Returns:
the y coordinate

getPoint

public Point getPoint()
Returns point of the mouse pointer relative to the source component.

Returns:
point of the mouse pointer

getClickCount

public int getClickCount()
Returns click count.

Returns:
click count

getButton

public int getButton()
Returns the button that changed state.

Returns:
the button that changed state

paramString

public java.lang.String paramString()
Returns string representation of the event.

Overrides:
paramString in class ComponentEvent


Copyright © 2007 ETF and contributors. All Rights Reserved.