gumbo.interact
Class Interactors

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

public class Interactors
extends java.lang.Object

Constants and utilities related to interactors in general.

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

Nested Class Summary
static class Interactors.ImmutableInteractorState
          Immutable wrapper for a target interactor state.
static class Interactors.NoPickTarget
          See NO_PICK_TARGET.
 
Field Summary
static InteractorState EMPTY_INTERACTOR_STATE
          A singleton instance of an empty and immutable interactor state.
static Interactors.NoPickTarget NO_PICK_TARGET
          A singleton immutable target interactor representing a valid (non-null) pick with no hit.
 
Method Summary
static java.util.Collection findAllLeaves(java.util.Collection seeds, java.util.Collection retVal)
          Returns the leaf (non-group) interactors at and under a group of interactors.
static java.util.Collection findLeaves(Interactor seed, java.util.Collection retVal)
          Returns the leaf (non-group) interactors at and under a given interactor.
static boolean isLeaf(Interactor target)
          Returns true if the target is a leaf (non-group) interactor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PICK_TARGET

public static final Interactors.NoPickTarget NO_PICK_TARGET
A singleton immutable target interactor representing a valid (non-null) pick with no hit. Used for interaction specification, and pick input and output. Typically used as the pick target for clearing the current selection (click on the "background").


EMPTY_INTERACTOR_STATE

public static final InteractorState EMPTY_INTERACTOR_STATE
A singleton instance of an empty and immutable interactor state.

Method Detail

isLeaf

public static boolean isLeaf(Interactor target)
Returns true if the target is a leaf (non-group) interactor. Throws an exception if target is null.

Parameters:
target - Target interactor. Never null.
Returns:
The result.

findLeaves

public static java.util.Collection findLeaves(Interactor seed,
                                              java.util.Collection retVal)
Returns the leaf (non-group) interactors at and under a given interactor.

Parameters:
seed - Seed interactor. Never null.
retVal - Return value object. Leaf interactors (Interactor, not InteractorGroup). If seed is a leaf then the collection will contain only seed.
Returns:
reference to retVal. Never null.

findAllLeaves

public static java.util.Collection findAllLeaves(java.util.Collection seeds,
                                                 java.util.Collection retVal)
Returns the leaf (non-group) interactors at and under a group of interactors.

Parameters:
seeds - Seed interactors (Interactor). Never null.
retVal - Return value object. Leaf interactors (Interactor, not InteractorGroup). If seed is a leaf then the collection will contain only seed. Can be seeds.
Returns:
reference to retVal. Never null.