NASA World Wind

gov.nasa.worldwind.util.tree
Interface Scrollable

All Known Implementing Classes:
BasicTreeLayout

public interface Scrollable

An object that can be rendered in a ScrollFrame. A scrollable content object needs be able to determine its size, and render itself at a given location.

See Also:
ScrollFrame

Method Summary
 Dimension getSize(DrawContext dc, Dimension frameSize)
          Get the size of the object on screen.
 long getUpdateTime()
          Get the time in milliseconds since the Epoch at which the Scrollable contents last changed.
 void renderScrollable(DrawContext dc, Point location, Dimension frameSize, Rectangle clipBounds)
          Render the scrollable component.
 void setHighlighted(boolean highlighted)
          Set the highlight state of the content to match the frame.
 

Method Detail

getSize

Dimension getSize(DrawContext dc,
                  Dimension frameSize)
Get the size of the object on screen.

Parameters:
dc - Draw context.
frameSize - Size of the frame that will hold the the scrollable content. Implementations should be prepared to handle a null frame size because the frame may need to determine the content size before it can determine its own size.
Returns:
The size of the scrollable object.

getUpdateTime

long getUpdateTime()
Get the time in milliseconds since the Epoch at which the Scrollable contents last changed. ScrollFrame uses this timestamp to determine if the contents have updated since they were last rendered. Only events that might cause a change in the rendered content should change the update time.

Returns:
Time at which the contents were last updated.

renderScrollable

void renderScrollable(DrawContext dc,
                      Point location,
                      Dimension frameSize,
                      Rectangle clipBounds)
Render the scrollable component. The component should render itself with the lower left corner of the content located at location.in the rectangle specified by bounds. Note that some of the content may be clipped by the scroll frame.

Parameters:
dc - Draw context.
location - Point at which to draw the Scrollable contents. This point indicates the location of the lower left corner of the content, in GL screen coordinates (origin at lower left corner of the screen).
frameSize - Size of the frame that will hold the content.
clipBounds - Bounds of the clip rectangle. Any pixels outside of this box will be discarded, and do not need to be drawn. The rectangle is specified in GL screen coordinates.

setHighlighted

void setHighlighted(boolean highlighted)
Set the highlight state of the content to match the frame.

Parameters:
highlighted - true if the frame is highlighted.

NASA World Wind