interface org.aswing.util.Impulser

Declares API to fire one or more action events after a specified delay.

@author paling @author Igor Sadovskiy

Instance Fields

function addActionListener(listener:Dynamic ->Void?priority:Int, ?useWeakReference:Bool): Void

Adds an action listener to the Impulser instance.

 * @param listener the listener
 * @param priority the priority
 * @param useWeakReference Determines whether the reference to the listener is strong or weak.
 * @see org.aswing.event.AWEvent#ACT

function getDelay(): Int

Returns the delay between firings of events.

@see #setDelay() @see #getInitialDelay()

function getInitialDelay(): Int

Returns the Impulser's initial delay.

@see #setInitialDelay() @see #setDelay()

function isRepeats(): Bool

Returns true (the default) if the Impulser will send an action event to its listeners multiple times.

@see #setRepeats()

function isRunning(): Bool

Returns true if the Impulser is running.

@see #start()

function removeActionListener(listener:Dynamic ->Void): Void

Removes a action listener. @see org.aswing.event.AWEvent#ACT

listener

the listener to be removed.

function restart(): Void

Restarts the Impulser, canceling any pending firings and causing it to fire with its initial delay.

function setDelay(delay:Int): Void

Sets the Impulser's delay between fired events.

@see #setInitialDelay()

delay

the delay

function setInitialDelay(initialDelay:Int): Void

Sets the Impulser's initial delay, which by default is the same as the between-event delay. This is used only for the first action event. Subsequent events are spaced using the delay property.

@see #setDelay()

initialDelay

the delay between the invocation of the start method and the first event fired by this impulser

function setRepeats(flag:Int): Void

If flag is false, instructs the Impulser to send only once action event to its listeners after a start.

flag

specify false to make the impulser stop after sending its first action event.

function start(): Void

Starts the Impulser, causing it to start sending action events to its listeners.

@see #stop()

function stop(): Void

Stops the Impulser, causing it to stop sending action events to its listeners.

@see #start()