gumbo.interact.button
Class SimpleButtonTrigger

java.lang.Object
  |
  +--gumbo.interact.button.AbstractButtonTrigger
        |
        +--gumbo.interact.button.SimpleButtonTrigger
All Implemented Interfaces:
ButtonTrigger

public class SimpleButtonTrigger
extends AbstractButtonTrigger

A "simple" button trigger, which is stateless (can arm and fire simultaneously), button level (not edge) sensing, and does not perform trigger capture. Being level sensing and stateless, if firing conditions are satisfied the trigger will fire immediately when fireable in goes true.

Version:
$Revision: 1.3 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Constructor Summary
SimpleButtonTrigger(java.util.Collection triggerButtons, java.util.Collection chordButtons, java.util.Collection domainButtons, boolean onDown, boolean latching)
          Creates an instance.
 
Method Summary
protected  boolean checkFire()
          Called by the system to check for start or stop of trigger firing.
 boolean isLatching()
           
 boolean isOnDown()
           
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.
 
Methods inherited from class gumbo.interact.button.AbstractButtonTrigger
getActiveIn, getArmedOut, getButtonsIn, getCancelIn, getCancelOut, getCaptureOut, getChordButtons, getDomainButtons, getEnableIn, getFireableIn, getFireNotifyOut, getFireOut, getResetIn, getTriggerButtons, processCancelIn, processResetIn, startArmed, startCancel, startFire, startReset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleButtonTrigger

public SimpleButtonTrigger(java.util.Collection triggerButtons,
                           java.util.Collection chordButtons,
                           java.util.Collection domainButtons,
                           boolean onDown,
                           boolean latching)
Creates an instance. Master constructor.

Parameters:
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).
onDown - If true, buttons are active while down; otherwise, while up.
latching - If true, trigger latches after firing until reset; otherwise, trigger fires only while trigger conditions are satisfied.
Method Detail

isOnDown

public boolean isOnDown()

isLatching

public boolean isLatching()

checkFire

protected boolean checkFire()
Called by the system to check for start or stop of trigger firing. Default implementation: Checks buttons in. If latching, always true if fire out is true. False if trigger buttons and chord buttons are empty; false if trigger buttons is not empty but none are active; false if chord buttons is not empty but all are not active; false if domain buttons is not empty and any except trigger and domain are active; otherwise, true.


processButtonsIn

protected void processButtonsIn()
Description copied from class: AbstractButtonTrigger
Called by the system to process the corresponding input event. Only called if enable in and active in are true, and cancel out is false.

Specified by:
processButtonsIn in class AbstractButtonTrigger

processFireableIn

protected void processFireableIn()
Description copied from class: AbstractButtonTrigger
Called by the system to process the corresponding input event. Only called if enable in and active in are true.

Specified by:
processFireableIn in class AbstractButtonTrigger