fr.inria.infovis.temporizer
Class AbstractTemporizer

java.lang.Object
  extended byfr.inria.infovis.temporizer.AbstractTemporizer
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Direct Known Subclasses:
GraphTemporizer, TableTemporizer, TreeTemporizer

public abstract class AbstractTemporizer
extends java.lang.Object
implements java.awt.event.ActionListener

Abstract Implementation of a Temporizer of notification for Infovis objects like Graph, Table or Tree. This class disable/enable notification mecanism periodically. This is very useful when Infovis Object is attached to a visualization. The visualization is refreshed periodically. It works as Decorator of Table. This method us a Swing Timer. a better implementation using java.util.Timer is also possible.

Author:
raf

Field Summary
static int DEFAULT_DELAY
          DEFAULT_DELAY period between two disable/enable notification
static int LIMIT_DELAY
          LIMIT_DELAY if the action will last more than this delay, the temporizer is stopped
 
Constructor Summary
AbstractTemporizer(int d, infovis.Table t)
          Construct a new temporizer for the infovis Object giving a delay
AbstractTemporizer(infovis.Table t)
          Construct a new temporizer for the infovis Object
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Perform the Timer action, basically : enable notification => firing pending events measure time to execute notification adapt the delay if necessary finally disable notification for next turn
 int getDelay()
           
 infovis.Table getTable()
           
 javax.swing.Timer getTimer()
           
 infovis.Visualization getVisualization()
           
 void setDelay(int delay)
           
 void setTable(infovis.Table t)
           
 void setVisualization(infovis.Visualization visualization)
           
 void start()
          Starts the temporization
 void stop()
          Stops the temporization and restore the notification
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELAY

public static int DEFAULT_DELAY
DEFAULT_DELAY period between two disable/enable notification


LIMIT_DELAY

public static int LIMIT_DELAY
LIMIT_DELAY if the action will last more than this delay, the temporizer is stopped

Constructor Detail

AbstractTemporizer

public AbstractTemporizer(infovis.Table t)
Construct a new temporizer for the infovis Object

Parameters:
t - : the Infovis object "temporized"

AbstractTemporizer

public AbstractTemporizer(int d,
                          infovis.Table t)
Construct a new temporizer for the infovis Object giving a delay

Parameters:
d - the delay
t - the temporozed object
Method Detail

start

public void start()
Starts the temporization


stop

public void stop()
Stops the temporization and restore the notification


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Perform the Timer action, basically :
  1. enable notification => firing pending events
  2. measure time to execute notification
  3. adapt the delay if necessary
  4. finally disable notification for next turn

Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getDelay

public int getDelay()
Returns:
Returns the delay.

setDelay

public void setDelay(int delay)
Parameters:
delay - The delay to set.

getTable

public infovis.Table getTable()
Returns:
Returns the graph.

setTable

public void setTable(infovis.Table t)

getTimer

public javax.swing.Timer getTimer()
Returns:
Returns the timer.

getVisualization

public infovis.Visualization getVisualization()
Returns:
Returns the visualization.

setVisualization

public void setVisualization(infovis.Visualization visualization)
Parameters:
visualization - The visualization to set.