|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.interact.button.AbstractButtonTrigger | +--gumbo.interact.button.FancyButtonTrigger | +--gumbo.interact.button.LatchButtonTrigger
A latching button trigger that is stateful (must be armed before firing), button edge (not level) sensing, and can perform trigger capture. The critical/capturing state for a latch button is the armed state. If trigger buttons are specified then only a trigger button can fire the trigger; otherwise, any chord button will fire it. Being edge sensing and stateful, firing conditions must be met after, not before, fireable in goes true.
If a one-shot trigger, fire out remains true until the trigger is reset; otherwise, it remains true only until the trigger is rearmed.
If a capturing trigger, defines an additional button trigger state, rearmable. If the trigger is armed, it becomes rearmable if fireable in goes false, and it becomes rearmed if fireable in goes true again.
Constructor Summary | |
LatchButtonTrigger(java.util.Collection triggerButtons,
java.util.Collection chordButtons,
java.util.Collection domainButtons)
Creates a default trigger (fires on button release, captures during the armed state, multi-shot). |
|
LatchButtonTrigger(java.util.Collection triggerButtons,
java.util.Collection chordButtons,
java.util.Collection domainButtons,
boolean onPress,
boolean capturing,
boolean oneShot)
Creates an instance. |
Method Summary | |
boolean |
isOneShot()
|
protected void |
processButtonsIn()
Called by the system to process the corresponding input event. |
protected void |
processFireableIn()
Called by the system to process the corresponding input event. |
protected void |
startArmed()
Default implementation: If capturing, starts capturing, then starts armed. |
protected void |
startFire()
Default implementation: Starts fire then, if capturing, stops capturing. |
protected void |
startRearmable()
Called by the system to transit to the trigger rearmable state. |
Methods inherited from class gumbo.interact.button.FancyButtonTrigger |
checkStartCritical, checkStopCritical, isCapturing, isOnPress, isStartCriticalTriggered, isStopCriticalTriggered, processCancelIn |
Methods inherited from class gumbo.interact.button.AbstractButtonTrigger |
getActiveIn, getArmedOut, getButtonsIn, getCancelIn, getCancelOut, getCaptureOut, getChordButtons, getDomainButtons, getEnableIn, getFireableIn, getFireNotifyOut, getFireOut, getResetIn, getTriggerButtons, processResetIn, startCancel, startReset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LatchButtonTrigger(java.util.Collection triggerButtons, java.util.Collection chordButtons, java.util.Collection domainButtons)
triggerButtons
- Value of trigger button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger). If trigger buttons are specified
then only a trigger button can fire the trigger.chordButtons
- Value of chord button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger).domainButtons
- Value of domain button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger).public LatchButtonTrigger(java.util.Collection triggerButtons, java.util.Collection chordButtons, java.util.Collection domainButtons, boolean onPress, boolean capturing, boolean oneShot)
triggerButtons
- Value of trigger button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger).chordButtons
- Value of chord button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger).domainButtons
- Value of domain button flags (Object,
specifically MouseSensors.BUTTON_???, KeyboardSensors.KEY_???).
None if null. (See ButtonTrigger).onPress
- If true, the trigger fires when buttons are pressed;
otherwise, when released.capturing
- If true, trigger is captured during critical states;
otherwise, capture is always false.oneShot
- If true, the trigger must be reset before it can fire
again; otherwise, it resets each time before rearming.Method Detail |
public boolean isOneShot()
protected void startRearmable()
protected void processButtonsIn()
AbstractButtonTrigger
processButtonsIn
in class AbstractButtonTrigger
protected void processFireableIn()
AbstractButtonTrigger
processFireableIn
in class AbstractButtonTrigger
protected void startArmed()
startArmed
in class AbstractButtonTrigger
protected void startFire()
startFire
in class AbstractButtonTrigger
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |