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

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
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ContextMenuEvent, KeyEvent, MouseEvent

public class InputEvent
extends ComponentEvent

Input Event.

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

Field Summary
static int ALT_MASK
          The alt modifier mask.
static int BUTTON1_MASK
          The button1 modifier mask.
static int BUTTON2_MASK
          The button2 modifier mask.
static int BUTTON3_MASK
          The button3 modifier mask.
static int CTRL_MASK
          The control modifier mask.
static int META_MASK
          The meta modifier mask.
static int SHIFT_MASK
          The shift modifier 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
protected InputEvent(JQComponent source, int id, int modifiers)
          Constructs new InputEvent object.
protected InputEvent(JQComponent source, int id, long when, int modifiers)
          Constructs new InputEvent object.
 
Method Summary
 void consume()
          Consumes the event.
 int getModifiers()
          Returns the modifiers.
static java.lang.String getModifiersText(int modifiers)
          Returns a string representation of the modifiers.
 long getWhen()
          Returns the timestamp of when this event occurred.
 boolean isAltDown()
          Returns true if alt modifier is down.
 boolean isConsumed()
          Returns true if the event is consumed.
 boolean isControlDown()
          Returns true if control modifier is down.
 boolean isMetaDown()
          Returns true if meta modifier is down.
 boolean isShiftDown()
          Returns true if shift modifier is down.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.events.ComponentEvent
getComponent, paramString
 
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

SHIFT_MASK

public static final int SHIFT_MASK
The shift modifier mask.

See Also:
Constant Field Values

CTRL_MASK

public static final int CTRL_MASK
The control modifier mask.

See Also:
Constant Field Values

META_MASK

public static final int META_MASK
The meta modifier mask.

See Also:
Constant Field Values

ALT_MASK

public static final int ALT_MASK
The alt modifier mask.

See Also:
Constant Field Values

BUTTON1_MASK

public static final int BUTTON1_MASK
The button1 modifier mask.

See Also:
Constant Field Values

BUTTON2_MASK

public static final int BUTTON2_MASK
The button2 modifier mask.

See Also:
Constant Field Values

BUTTON3_MASK

public static final int BUTTON3_MASK
The button3 modifier mask.

See Also:
Constant Field Values
Constructor Detail

InputEvent

protected InputEvent(JQComponent source,
                     int id,
                     long when,
                     int modifiers)
Constructs new InputEvent object.

Parameters:
source - the event source
id - the event id
when - the time the event occurred
modifiers - the modifiers
Throws:
java.lang.IllegalArgumentException - if the source is null

InputEvent

protected InputEvent(JQComponent source,
                     int id,
                     int modifiers)
Constructs new InputEvent object.

Parameters:
source - the event source
id - the event id
modifiers - the modifiers
Throws:
java.lang.IllegalArgumentException - if the source is null
Method Detail

getWhen

public long getWhen()
Returns the timestamp of when this event occurred.

Returns:
the timestamp of when this event occurred

getModifiers

public int getModifiers()
Returns the modifiers.

Returns:
the modifiers

isShiftDown

public boolean isShiftDown()
Returns true if shift modifier is down.

Returns:
true if shift modifier is down

isControlDown

public boolean isControlDown()
Returns true if control modifier is down.

Returns:
true if control modifier is down

isMetaDown

public boolean isMetaDown()
Returns true if meta modifier is down.

Returns:
true if meta modifier is down

isAltDown

public boolean isAltDown()
Returns true if alt modifier is down.

Returns:
true if alt modifier is down

getModifiersText

public static java.lang.String getModifiersText(int modifiers)
Returns a string representation of the modifiers.

Parameters:
modifiers - the modifiers
Returns:
a string representation of the modifiers

isConsumed

public boolean isConsumed()
Returns true if the event is consumed.

Overrides:
isConsumed in class QSwingEvent
Returns:
true if the event is consumed

consume

public void consume()
Consumes the event.

Overrides:
consume in class QSwingEvent


Copyright © 2007 ETF and contributors. All Rights Reserved.