|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart.EventTrigger
Class responsible for defining a mapping from a user event to
a chart action. For example, EventTrigger
can be used
to map from a Shift+Left-mouse-button set of events to the
rotate action.
Note: By default, all event triggers are
mouse down-drag-up events (which occur as a single sequence of mouse
events) -- the only elements that can vary are the modifiers.
Field Summary | |
protected int |
action
|
static int |
CUSTOMIZE
|
static int |
DEPTH
|
static int |
EDIT
|
protected int |
modifiers
|
static int |
NONE
|
static int |
PICK
|
static int |
ROTATE
|
static int |
TRANSLATE
|
protected static int |
USE_BUTTON1_ALWAYS
|
protected static int |
USE_BUTTON1_EXCEPT_META
|
protected static int |
USE_BUTTON1_NEVER
|
protected int |
useButton1
|
static int |
ZOOM
|
Constructor Summary | |
EventTrigger(int mod,
int act)
A public constructor that creates a mapping from a series of modifiers to a chart action. |
|
EventTrigger(int mod,
int act,
boolean ub1)
A public constructor that creates a mapping from a series of modifiers to a chart action. |
Method Summary | |
static int |
adjustModifier(int mod)
Default adjust method. |
static int |
adjustModifier(int mod,
int useButton1)
Adjusts the modifier as used by chart to be a real modifier akin to that used by Swing. |
static int |
deAdjustModifier(int mod)
Default de-adjust method. |
static int |
deAdjustModifier(int mod,
int useButton1)
De-adjusts the modifier as used by Swing, adjusting it back to a modifier as used by chart. |
int |
getAction()
Gets the value of the Action property for this EventTrigger instance. |
int |
getModifiers()
Gets the value of the modifiers property for this EventTrigger
instance. |
void |
setAction(int act)
Sets the value of the action property for this EventTrigger instance. |
void |
setModifiers(int mod)
Sets the value of the modifiers property for this EventTrigger
instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int USE_BUTTON1_ALWAYS
protected static final int USE_BUTTON1_EXCEPT_META
protected static final int USE_BUTTON1_NEVER
protected int useButton1
protected int modifiers
protected int action
public static final int ROTATE
public static final int ZOOM
public static final int TRANSLATE
public static final int EDIT
public static final int PICK
public static final int DEPTH
public static final int CUSTOMIZE
public static final int NONE
Constructor Detail |
public EventTrigger(int mod, int act)
mod
- Bitfield of modifiers from Event
. Can include
Event.SHIFT_MASK
, Event.CTRL_MASK
, Event.META_MASK
, and
Event.ALT_MASK
. If META_MASK
is not included (which is the same as the
third mouse button 3 mask), it is assumed that the bitfield is intended to
be applied to the button 1 (the left mouse button).act
- action enum; one of ROTATE
, ZOOM
, TRANSLATE
,
EDIT
, PICK
, DEPTH
, or CUSTOMIZE
public EventTrigger(int mod, int act, boolean ub1)
mod
- Bitfield of modifiers from Event
. Can include
Event.SHIFT_MASK
, Event.CTRL_MASK
, Event.META_MASK
, and
Event.ALT_MASK
.act
- action enum; one of ROTATE
, ZOOM
, TRANSLATE
,
EDIT
, PICK
, DEPTH
, or CUSTOMIZE
ub1
- if true
, the bitfield will be adjusted to include
mouse button 1 (the left mouse button); if false
, the bitfield will
stand as setMethod Detail |
public int getModifiers()
EventTrigger
instance. The modifiers property specifies the modifier keys
that are pressed during mouse down-drag-up that trigger
the action.
Event.ALT_MASK
, Event.CTRL_MASK
,
Event.META_MASK
, and Event.SHIFT_MASK
public void setModifiers(int mod)
EventTrigger
instance. The modifiers property specifies the modifier keys
that are pressed during mouse down-drag-up that trigger
the action. If the constructor has specified to NOT assume
that mouse button 1 is to be used, a modifier of Event.ALT_MASK
can be used to specify the use of the middle mouse button for the
trigger. If the constructor has specified to NOT assume mouse
button 1 or if the default behaviour was specified, a modifier of
Event.META_MASK
can be used to specify the use of the right mouse
button for the trigger. If the constructor has specified that
mouse button 1 will always be used, any specified masks will be
adjusted to include the button 1 mask.
mod
- bit fields set using Event.ALT_MASK
, Event.CTRL_MASK
,
Event.META_MASK
, and Event.SHIFT_MASK
IllegalArgumentException
- If the modifier is not either 0,
Event.SHIFT_MASK, Event.ALT_MASK, Event.META_MASK or Event.CTRL_MASKpublic int getAction()
Action
property for this EventTrigger
instance.
The Action
property determines what action will be performed when
the specified AWT event occurs -- one of ROTATE
, ZOOM
,
TRANSLATE
, EDIT
, PICK
, DEPTH
, or CUSTOMIZE
.
public static int adjustModifier(int mod)
mod
-
public static int adjustModifier(int mod, int useButton1)
InputEvent.BUTTON1_MASK
so that the correct combination
-- the user clicking on the left mouse button accompanied by the
appropriate key -- triggers the action. Whether this is done or not
depends on the constructor used and whether the "use mouse button 1"
boolean was set.
mod
- useButton1
-
public static int deAdjustModifier(int mod)
mod
-
public static int deAdjustModifier(int mod, int useButton1)
InputEvent.BUTTON1_MASK
. Whether this is done or not
depends on the constructor used and whether the "use mouse button 1"
boolean was set.
mod
- useButton1
-
public void setAction(int act)
EventTrigger
instance.
The action property determines what action will be performed when
the specified AWT event occurs. One of ROTATE
, EDIT
, ZOOM
,
TRANSLATE
, PICK
, DEPTH
, or CUSTOMIZE
.
act
- enum specifying chart action
IllegalArgumentException
- If the action is not one of ROTATE
, ZOOM
,
TRANSLATE
, EDIT
, PICK
, DEPTH
, or CUSTOMIZE
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |