Class TimerInteractor

  extended by com.miginfocom.ashape.interaction.AbstractInteractor
      extended by com.miginfocom.ashape.interaction.TimerInteractor
All Implemented Interfaces:
Interactor, PropertyProvider, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class TimerInteractor
extends AbstractInteractor

An interactor that support delays of one or more commands. The commands will NOT be executed in the Swing event thread.

Field Summary
protected  InteractionBroker broker
          The broker to interact with.
static PropertyKey ON_TIME
          A trigger on a specific delay.
static PropertyKey PROP_INITIAL_DELAY
          Delay in milliseconds until the interaction fires.
static PropertyKey PROP_REPEAT_COUNT
          Number of repetitions.
static PropertyKey PROP_REPEAT_MILLIS
          Milliseconds between repetitions.
Fields inherited from class com.miginfocom.ashape.interaction.AbstractInteractor
Fields inherited from interface com.miginfocom.ashape.interaction.Interactor
Constructor Summary
TimerInteractor(InteractionBroker broker, java.util.Collection interactions)
Method Summary
 void addInteraction(Interaction inter)
          Adds an interaction.
 java.lang.Object getInteracted()
          Returns the object that this interactor is currently interacting with.
 InteractionBroker getInteractionBroker()
          Returns the interaction broker for this interactor.
protected  void installInteraction(Interaction inter)
          Sets up the timer.
Methods inherited from class com.miginfocom.ashape.interaction.AbstractInteractor
addInteractions, addOverride, addOverrideListener, addOverrideListener, containsProperty, fireOverrideChanged, getInteractions, getOverride, getOverrideById, getProperty, isOverridden, keyEventPost, keyEventPre, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseEventPost, mouseEventPre, mouseExited, mouseMoved, mousePressed, mouseReleased, processEvent, removeInteraction, removeOverride, removeOverrideById, removeOverrideListener, setInteractions, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static final PropertyKey ON_TIME
A trigger on a specific delay. Only Interactions with the trigger ON_TIME will be handled.
Set the expresstion in the interaction i a PropertyExpression. The property PROP_INITIAL_DELAY should be an Integer and that number of milliseconds will be the delay. If not set or set to null the delay will be 0.
PROP_REPEAT_MILLIS and PROP_REPEAT_COUNT can be set to an Integer to specify repetition delay and invocation count.


public static final PropertyKey PROP_INITIAL_DELAY
Delay in milliseconds until the interaction fires. key in the PropertyExpression. Value should be an Integer with the delay in milliseconds.


public static final PropertyKey PROP_REPEAT_MILLIS
Milliseconds between repetitions. (Integer) May be null.


public static final PropertyKey PROP_REPEAT_COUNT
Number of repetitions. (Integer) May be null.


protected final InteractionBroker broker
The broker to interact with.

Constructor Detail


public TimerInteractor(InteractionBroker broker,
                       java.util.Collection interactions)

broker - The AbstractInteractionBroker to send commands to
interactions - The interactions to start with.
Method Detail


public InteractionBroker getInteractionBroker()
Description copied from interface: Interactor
Returns the interaction broker for this interactor. The broker is normally responsible for effectuating DefaultCommands.

The interaction broker for this interactor. May be null if there is not broker.


public java.lang.Object getInteracted()
Description copied from interface: Interactor
Returns the object that this interactor is currently interacting with.

The object that this interactor is currently interacting with. May be null.


public void addInteraction(Interaction inter)
Description copied from interface: Interactor
Adds an interaction. No checking if the interaction already exists. Override to catch changes in the interaction list or to only add interactions that are of interest to the implementing class.

Specified by:
addInteraction in interface Interactor
addInteraction in class AbstractInteractor
inter - The interaction to add-


protected void installInteraction(Interaction inter)
Sets up the timer.

inter - The interaction to set up a timer for. Not null.

Copyright © 2009 MiG InfoCom AB. All Rights Reserved.