edu.berkeley.guir.ptk.output
Class IconOutput

java.lang.Object
  extended byedu.berkeley.guir.ptk.PTK
      extended byedu.berkeley.guir.ptk.output.Output
          extended byedu.berkeley.guir.ptk.output.IconOutput
All Implemented Interfaces:
Animatable, java.lang.Runnable

public class IconOutput
extends Output
implements Animatable

Provides the default Animatable methods for event data that is displayed as an icon (move slowly, and flash off and on five times for interrupt).

The Transition class calls the Animatable methods in a default order. Before passing events to the methods in this class, the Transition object copies them. So, there is no reason to copy events here.

Author:
jmankoff

Field Summary
 javax.swing.JLabel icon
          The icon associated with this output
static int NUM_STEPS
           
 
Fields inherited from class edu.berkeley.guir.ptk.output.Output
animatable, d_queue, data_ids_I_want, history, ITEMS_LENGTH, metadata_I_want, num_ids, num_metadata, output_cycle_time, transition
 
Fields inherited from class edu.berkeley.guir.ptk.PTK
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG
 
Constructor Summary
IconOutput(java.awt.Container c, int x, int y, java.lang.String image)
          Passes "true" into the super constructor, indicating this class is Animatable.
 
Method Summary
 Event alternateStep(Event prev_event, Event new_event, int step)
          Returns an event that represents the "alternate" or "opposite" of what is displayed by the other transition methods in order to create a "flashing" effect.
 Event changeblindTransStep(Event prev_event, Event new_event, int step_num)
          Returns an inter-mediary step between the start and end methods: used in change blind transitions to move image slowly out to up and then slowly back in to its regular location.
protected  void displayEvent(Event e)
          Displays a text message from an event on the TPanel.
 Event endTransition(Event prev_event, Event new_event, int step)
          Returns the last event to be displayed in a transition: the new event.
 javax.swing.JLabel getIcon()
          Gets the icon associated with this output
 Event interruptTransStep(Event prev_event, Event new_event, int step_num)
          Returns an event that is somewhere between the start and end points of a interrupt transition, depending on the display_step and the number of steps involved in the transition.
static void main(java.lang.String[] args)
           
 Event makeawareTransStep(Event prev_event, Event new_event, int step_num)
          Returns an event that is somewhere between the start and end points of a make aware transition, depending on the display_step and the number of steps involved in the transition.
 void setIcon(javax.swing.JLabel icon)
          Sets the icon associated with this output
 Event startTransition(Event prev_event, Event new_event, int step)
          Returns the first event to be displayed in a transition: the previous event (unless null, then the new event).
 
Methods inherited from class edu.berkeley.guir.ptk.output.Output
addDataID, addMetadataIWant, checkAction, doIWant, getAllMetadata, getDataIDs, getFirstMetadata, getHistory, handleEvent, interDisplayEvent, isAnimatable, printMetadataIWant, run, setChangeblindTransitionSteps, setDataIDsIWant, setInterruptTransitionSteps, setMakeawareTransitionSteps, setTimeBetweenDisplayEvents, setTransition, setUnsetNotification
 
Methods inherited from class edu.berkeley.guir.ptk.PTK
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_STEPS

public static final int NUM_STEPS
See Also:
Constant Field Values

icon

public javax.swing.JLabel icon
The icon associated with this output

Constructor Detail

IconOutput

public IconOutput(java.awt.Container c,
                  int x,
                  int y,
                  java.lang.String image)
Passes "true" into the super constructor, indicating this class is Animatable.

Method Detail

main

public static void main(java.lang.String[] args)

startTransition

public Event startTransition(Event prev_event,
                             Event new_event,
                             int step)
Returns the first event to be displayed in a transition: the previous event (unless null, then the new event).

Specified by:
startTransition in interface Animatable
Parameters:
step - a number that indicates what order the event returned from this method will be displayed in the transition's set of events.
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
Returns:
Event

endTransition

public Event endTransition(Event prev_event,
                           Event new_event,
                           int step)
Returns the last event to be displayed in a transition: the new event.

Specified by:
endTransition in interface Animatable
Parameters:
step - a number that indicates what order the event returned from this method will be displayed in the transition's set of events.
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
Returns:
Event

changeblindTransStep

public Event changeblindTransStep(Event prev_event,
                                  Event new_event,
                                  int step_num)
Returns an inter-mediary step between the start and end methods: used in change blind transitions to move image slowly out to up and then slowly back in to its regular location.

Specified by:
changeblindTransStep in interface Animatable
Parameters:
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
step_num - a number indicating the display order of the event returned if the Transition is creating a set of events.
Returns:
Event

makeawareTransStep

public Event makeawareTransStep(Event prev_event,
                                Event new_event,
                                int step_num)
Description copied from interface: Animatable
Returns an event that is somewhere between the start and end points of a make aware transition, depending on the display_step and the number of steps involved in the transition. Only need to implement if the application uses make aware transitions.

Specified by:
makeawareTransStep in interface Animatable
Parameters:
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
step_num - a number indicating the display order of the event returned if the Transition is creating a set of events.
Returns:
Event

interruptTransStep

public Event interruptTransStep(Event prev_event,
                                Event new_event,
                                int step_num)
Description copied from interface: Animatable
Returns an event that is somewhere between the start and end points of a interrupt transition, depending on the display_step and the number of steps involved in the transition. Only need to implement if the application uses interrupt transitions.

Specified by:
interruptTransStep in interface Animatable
Parameters:
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
step_num - a number indicating the display order of the event returned if the Transition is creating a set of events.
Returns:
Event

alternateStep

public Event alternateStep(Event prev_event,
                           Event new_event,
                           int step)
Returns an event that represents the "alternate" or "opposite" of what is displayed by the other transition methods in order to create a "flashing" effect. Here, it is used to delete all the text in an event. Used in interrupt transitions, where the effect is text flashing between the the new event text (returned by endTransition) and no text (returned by alternateStep).

Specified by:
alternateStep in interface Animatable
Parameters:
step - a number that indicates what order the event returned from this method will be displayed in the transition's set of events.
prev_event - the previous event sent to this Output (null if the new event is the first).
new_event - the new event to be displayed on the Output.
Returns:
Event

displayEvent

protected void displayEvent(Event e)
Displays a text message from an event on the TPanel. Called by the PTK when a new event arrives for the Output.

Specified by:
displayEvent in class Output
Parameters:
e - This event to be displayed

getIcon

public javax.swing.JLabel getIcon()
Gets the icon associated with this output

Returns:
JLabel icon

setIcon

public void setIcon(javax.swing.JLabel icon)
Sets the icon associated with this output