Class
caplin.element.buffer

DisplayBuffer

The DisplayBuffer class manages a 'throttle thread' that wakes up at regular intervals and refreshes buffered controls that have registered a request to refresh and/or flash. In this way, DisplayBuffer is used to restrict the update of a buffered control (one that implements caplin.element.buffer.Buffered) to at most one update in the interval at it operates. The DisplayBuffer manages a scheduled thread that manages buffered controls.

Constructor Summary

Attributes Name and Description
caplin.element.buffer.DisplayBuffer()

Method Summary

Attributes Name and Description
void cancel(caplin.element.renderer.StreamRenderer renderer)

Cancels any pending refreshes or flashes to the renderer and its control.

void finalize()

Releases all resources by clearing all queues and stopping the throttle thread.

Boolean isLive()

Returns true if the DisplayBuffer has a currently active update scheduler thread.

Boolean isQueueEmpty()

Returns true if there are no renderers waiting for notification to write their updates.

void refresh()

Refreshes all pending controls in the queue and removes any stale flashes.

void removeAllFlashes()

Resets the flash effect from all controls immediately, rather than waiting for them to go stale.

void requestRefresh(caplin.element.Renderer renderer)

Registers a request to update the specified control.

void requestRemoveFlash(caplin.element.Control control)

Registers a request to remove the flash of the specified control.

void start()

Starts the throttle thread to run at the specified interval.

void stop()

Stops the throttle thread.

String toString()

Returns a human-readable string representation of the object, which is useful for debugging.

Constructor Detail

caplin.element.buffer.DisplayBuffer()

Method Detail

void cancel(caplin.element.renderer.StreamRenderer renderer)

Cancels any pending refreshes or flashes to the renderer and its control.

Parameters
caplin.element.renderer.StreamRenderer renderer The control to be cancelled.

void finalize()

Releases all resources by clearing all queues and stopping the throttle thread.

Boolean isLive()

Returns true if the DisplayBuffer has a currently active update scheduler thread.

Returns
{Boolean} TRUE if update thread is currently running.

Boolean isQueueEmpty()

Returns true if there are no renderers waiting for notification to write their updates.

Returns
{Boolean} TRUE if no renderers are queued waiting for update write notification.

void refresh()

Refreshes all pending controls in the queue and removes any stale flashes.

void removeAllFlashes()

Resets the flash effect from all controls immediately, rather than waiting for them to go stale.

void requestRefresh(caplin.element.Renderer renderer)

Registers a request to update the specified control.

Parameters
caplin.element.Renderer renderer The control to be refreshed.

void requestRemoveFlash(caplin.element.Control control)

Registers a request to remove the flash of the specified control. The flash will be reset upon the next DisplayBuffer refresh.

Parameters
caplin.element.Control control The control that is to have its flash removed.

void start()

Starts the throttle thread to run at the specified interval.

void stop()

Stops the throttle thread.

String toString()

Returns a human-readable string representation of the object, which is useful for debugging.

Returns
{String} The string representation