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

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.ContextMenuEvent
All Implemented Interfaces:
java.io.Serializable

public class ContextMenuEvent
extends InputEvent

Context Event (right click event).

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

Field Summary
static int CONTEXT_MENU_TRIGGERED
          Other (unknown) reason id (the value is 10001).
static int REASON_KEYBOARD
          Mouse caused reason id (the value is 1).
static int REASON_MOUSE
          Mouse caused reason id (the value is 0).
static int REASON_OTHER
          Other (unknown) reason id (the value is 2).
 
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
ContextMenuEvent(JQComponent source, long when, int reason, int modifiers, int x, int y, int globalX, int globalY)
          Constructs new MouseEvent object.
 
Method Summary
 Point getGlobalPoint()
          Returns global mouse position.
 int getGlobalX()
          Returns the x coordinate of the global mouse position.
 int getGlobalY()
          Returns the y coordinate of the global mouse position.
 Point getPoint()
          Returns point of the mouse pointer relative to the source component.
 int getReason()
          Returns reason why the event was sent.
 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

REASON_MOUSE

public static final int REASON_MOUSE
Mouse caused reason id (the value is 0).

See Also:
Constant Field Values

REASON_KEYBOARD

public static final int REASON_KEYBOARD
Mouse caused reason id (the value is 1).

See Also:
Constant Field Values

REASON_OTHER

public static final int REASON_OTHER
Other (unknown) reason id (the value is 2).

See Also:
Constant Field Values

CONTEXT_MENU_TRIGGERED

public static final int CONTEXT_MENU_TRIGGERED
Other (unknown) reason id (the value is 10001).

See Also:
Constant Field Values
Constructor Detail

ContextMenuEvent

public ContextMenuEvent(JQComponent source,
                        long when,
                        int reason,
                        int modifiers,
                        int x,
                        int y,
                        int globalX,
                        int globalY)
Constructs new MouseEvent object.

Parameters:
source - the source component
when - the time the event occurred
modifiers - the modifiers
reason - the reason
x - the x coordinate of the mouse point
y - the y coordinate of the mouse point
globalX - the global x coordinate of the mouse point
globalY - the global y coordinate of the mouse point
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

getGlobalX

public int getGlobalX()
Returns the x coordinate of the global mouse position.

Returns:
the x coordinate

getGlobalY

public int getGlobalY()
Returns the y coordinate of the global mouse position.

Returns:
the y coordinate

getGlobalPoint

public Point getGlobalPoint()
Returns global mouse position.

Returns:
point of the mouse pointer

getReason

public int getReason()
Returns reason why the event was sent.

Returns:
reason why the event was sent

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.