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 addDisplayLatencyListener(caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener)

Adds a listener that is interested in listening to the latency caused by the display.

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

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 removeDisplayLatencyListener(caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener)

Removes a listener previously added with addDisplayLatencyListener.

void requestRefresh(caplin.element.Renderer oRenderer)

Registers a request to update the specified control.

void requestRemoveFlash(caplin.element.Control oControl)

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 addDisplayLatencyListener(caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener)

Adds a listener that is interested in listening to the latency caused by the display. Note that this does not include the connection latency.

Parameters
caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener The listener to add.
See
caplin.element.buffer.DisplayLatencyListener

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

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

Parameters
caplin.element.renderer.StreamRenderer oRenderer 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
TRUE if update thread is currently running.

boolean isQueueEmpty()

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

Returns
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 removeDisplayLatencyListener(caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener)

Removes a listener previously added with addDisplayLatencyListener.

Parameters
caplin.element.buffer.DisplayLatencyListener oDisplayLatencyListener The listener to remove.

void requestRefresh(caplin.element.Renderer oRenderer)

Registers a request to update the specified control.

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

void requestRemoveFlash(caplin.element.Control oControl)

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 oControl 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
The string representation