001package votorola.s.gwt.stage.light; // Copyright 2012, Michael Allan.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
002
003
004/** A controller that activates and directs a {@linkplain #light() stage light} according
005  * to the properties of an {@linkplain Light#assignActuator(Sensor) assigned sensor}.
006  * Lights and sensors may exist in any number.  Each coordinated light/sensor pair is
007  * mediated by an {@linkplain Light#assignActuator(Sensor) assigned actuator}.  The
008  * typical lines of visibility are thus:<pre>
009  *
010  *    Light  ←  Actuator  →  Sensor</pre>
011  *
012  * One purpose of this arrangement is to speed light direction by having the actuator
013  * pre-construct the directional data for its sensor and cache it for repeated use.
014  * Where this optimization is not required, the implementation of the actuator may be
015  * folded into the light, a single instance for all sensors:<pre>
016  *
017  *   (Light, Actuator)  →  Sensor</pre>
018  */
019public interface Actuator<S extends Sensor>
020{
021
022
023   // - A c t u a t o r ------------------------------------------------------------------
024
025
026    /** Responds to a change in the sensor's properties.
027      */
028    public void changed( S sensor );
029
030
031
032    /** The stage light that is directed.
033      */
034    public Light<S> light();
035
036
037
038    /** Responds to the user's point leaving the sensor.
039      */
040    public void out( S sensor );
041
042
043
044    /** Responds to the user's point entering the sensor.
045      */
046    public void over( S sensor );
047
048
049}