gumbo.interact
Class ControlAdapter

java.lang.Object
  |
  +--gumbo.interact.ControlAdapter

public class ControlAdapter
extends java.lang.Object

Base class for control feedback adapters. Converts discrete control events into a target interactor state (see InteractorFlags.CONTROL_???). Can work multiple targets, but relies on input events to do any cleanup before switching to a new target.

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

Constructor Summary
ControlAdapter()
          Creates an instance that recognizes all targets.
ControlAdapter(java.util.Collection targets)
          Creates an instance that recognizes a group of dynamic targets.
ControlAdapter(Interactor target)
          Creates an instance that recognizes a single static target.
 
Method Summary
 BooleanField.EventIn getArmedIn()
          True while the control is armed for firing.
 BooleanField.EventIn getCancelIn()
          True while the control is cancelled.
 BooleanField.EventIn getCaptureIn()
          True while the control is captured for arming, firing, or cancellation.
 BooleanField.EventIn getFireIn()
          True while the control is firing or has fired.
 InteractorField.EventIn getTargetIn()
          The current target.
 void setNoPickTarget(Interactor target)
          Sets the feedback target corresponding to NO_PICK_TARGET target in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlAdapter

public ControlAdapter()
Creates an instance that recognizes all targets.


ControlAdapter

public ControlAdapter(Interactor target)
Creates an instance that recognizes a single static target.

Parameters:
target - The recognized target. NO_PICK_TARGET for the no pick target. Never null.

ControlAdapter

public ControlAdapter(java.util.Collection targets)
Creates an instance that recognizes a group of dynamic targets. Master constructor.

Parameters:
targets - The group of recognized targets (Interactor). Live reference. Include NO_PICK_TARGET for the no pick target. Only affects new targets. If null, all targets are recognized.
Method Detail

setNoPickTarget

public void setNoPickTarget(Interactor target)
Sets the feedback target corresponding to NO_PICK_TARGET target in.

Parameters:
target - The feedback target. Null if none. The default is null.

getTargetIn

public InteractorField.EventIn getTargetIn()
The current target. None if null or not recognized.


getCaptureIn

public BooleanField.EventIn getCaptureIn()
True while the control is captured for arming, firing, or cancellation. Ignored if there is no target in.


getArmedIn

public BooleanField.EventIn getArmedIn()
True while the control is armed for firing. Ignored if there is no target in.


getFireIn

public BooleanField.EventIn getFireIn()
True while the control is firing or has fired. Ignored if there is no target in.


getCancelIn

public BooleanField.EventIn getCancelIn()
True while the control is cancelled. Ignored if there is no target in.