qx.client
Class Timer

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.client.Timer

public class Timer
extends Target

Global timer support.

This class can be used to periodically fire an event. This event can be used to simulate e.g. a background task. The static method #once is a special case. It will call a function deferred after a given timeout.


Constructor Summary
Timer()
           
Timer(int interval)
           
 
Method Summary
 void _applyEnabled(java.lang.Object value, java.lang.Object old)
          Apply the enabled state of the timer.
 void _applyInterval(java.lang.Object value, java.lang.Object old)
          Apply the interval of the timer.
 void _oninterval()
          timer callback
 boolean getEnabled()
          Returns the (computed) value of the property enabled.
 java.lang.Integer getInterval()
          Returns the (computed) value of the property interval.
 void initEnabled(boolean arg)
          Calls the apply method and dispatches the change event of the property enabled with the default value defined by the class developer.
 void initInterval(java.lang.Integer arg)
          Calls the apply method and dispatches the change event of the property interval with the default value defined by the class developer.
 boolean isEnabled()
          Check whether the (computed) value of the boolean property enabled equals true.
 void resetEnabled()
          Resets the user value of the property enabled.
 void resetInterval()
          Resets the user value of the property interval.
 void restart()
          Restart the timer.
 void restartWith(java.lang.Integer interval)
          Restart the timer.
 void setEnabled(boolean arg)
          Sets the user value of the property enabled.
 void setInterval(java.lang.Integer arg)
          Sets the user value of the property interval.
 void start()
          Start the timer
 void startWith(java.lang.Integer interval)
          Start the timer with a given interval
 void stop()
          Stop the timer.
 boolean toggleEnabled()
          Toggles the (computed) value of the boolean property enabled.
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()

Timer

public Timer(int interval)
Method Detail

_applyEnabled

public void _applyEnabled(java.lang.Object value,
                          java.lang.Object old)

Apply the enabled state of the timer.


_applyInterval

public void _applyInterval(java.lang.Object value,
                           java.lang.Object old)

Apply the interval of the timer.


_oninterval

public void _oninterval()

timer callback


getEnabled

public boolean getEnabled()

Returns the (computed) value of the property enabled.

For further details take a look at the property definition: enabled.


getInterval

public java.lang.Integer getInterval()

Returns the (computed) value of the property interval.

For further details take a look at the property definition: interval.


initEnabled

public void initEnabled(boolean arg)

Calls the apply method and dispatches the change event of the property enabled with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: enabled.


initInterval

public void initInterval(java.lang.Integer arg)

Calls the apply method and dispatches the change event of the property interval with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: interval.


isEnabled

public boolean isEnabled()

Check whether the (computed) value of the boolean property enabled equals true.

For further details take a look at the property definition: enabled.


resetEnabled

public void resetEnabled()

Resets the user value of the property enabled.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: enabled.


resetInterval

public void resetInterval()

Resets the user value of the property interval.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: interval.


restart

public void restart()

Restart the timer. This makes it possible to change the interval of a running timer.


restartWith

public void restartWith(java.lang.Integer interval)

Restart the timer. with a given interval.


setEnabled

public void setEnabled(boolean arg)

Sets the user value of the property enabled.

For further details take a look at the property definition: enabled.


setInterval

public void setInterval(java.lang.Integer arg)

Sets the user value of the property interval.

For further details take a look at the property definition: interval.


start

public void start()

Start the timer


startWith

public void startWith(java.lang.Integer interval)

Start the timer with a given interval


stop

public void stop()

Stop the timer.


toggleEnabled

public boolean toggleEnabled()

Toggles the (computed) value of the boolean property enabled.

For further details take a look at the property definition: enabled.



Copyright © 2008 1&1. All Rights Reserved.