com.threerings.opengl.gui
Class ScrollBar

java.lang.Object
  extended by com.threerings.opengl.gui.Component
      extended by com.threerings.opengl.gui.Container
          extended by com.threerings.opengl.gui.ScrollBar
All Implemented Interfaces:
ConfigUpdateListener<ManagedConfig>, UIConstants

public class ScrollBar
extends Container
implements UIConstants

Displays a scroll bar for all your horizontal and vertical scrolling needs.


Field Summary
 
Fields inherited from class com.threerings.opengl.gui.Component
DEFAULT, DISABLED, HOVER
 
Fields inherited from interface com.threerings.opengl.gui.UIConstants
BOTTOM, CENTER, DEFAULT_SIZE, DEFAULT_SPACING, GLOW, HORIZONTAL, LEFT, NORMAL, OUTLINE, OVERLAPPING, PLAIN, RIGHT, SHADOW, TOP, VERTICAL
 
Constructor Summary
ScrollBar(GlContext ctx)
          Creates a vertical scroll bar with the default range, value and extent.
ScrollBar(GlContext ctx, int orientation)
          Creates a scroll bar with the default range, value and extent.
ScrollBar(GlContext ctx, int orientation, BoundedRangeModel model)
          Creates a scroll bar with the specified orientation which will interact with the supplied model.
ScrollBar(GlContext ctx, int orientation, int min, int value, int extent, int max)
          Creates a scroll bar with the specified orientation, range, value and extent.
 
Method Summary
 Component getHitComponent(int mx, int my)
          Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children.
 BoundedRangeModel getModel()
          Returns a reference to the scrollbar's range model.
 void wasAdded()
          This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).
 void wasRemoved()
          This method is called when we are removed from a hierarchy that is connected to a top-level window.
 
Methods inherited from class com.threerings.opengl.gui.Container
add, add, add, add, getComponent, getComponentCount, getComponentIndex, getLayoutManager, remove, remove, removeAll, replace, setAlpha, setEnabled, setHoverable, setLayoutManager, validate
 
Methods inherited from class com.threerings.opengl.gui.Component
acceptsFocus, addListener, boundsToString, configUpdated, contains, createDefaultTooltipComponent, createDefaultTooltipComponent, dispatchEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getContext, getCursor, getFocusTarget, getHeight, getInsets, getParent, getPreferredSize, getProperty, getState, getStyleConfigs, getTooltipText, getTooltipTimeout, getTooltipWindowStyle, getTransferHandler, getWidth, getX, getY, hasFocus, invalidate, isAdded, isEnabled, isHoverable, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeAllListeners, removeListener, render, requestFocus, scrollRectToVisible, setBackground, setBounds, setCursor, setLocation, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleConfig, setStyleConfig, setStyleConfig, setStyleConfigs, setTooltipRelativeToMouse, setTooltipText, setTransferHandler, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScrollBar

public ScrollBar(GlContext ctx)
Creates a vertical scroll bar with the default range, value and extent.


ScrollBar

public ScrollBar(GlContext ctx,
                 int orientation)
Creates a scroll bar with the default range, value and extent.


ScrollBar

public ScrollBar(GlContext ctx,
                 int orientation,
                 int min,
                 int value,
                 int extent,
                 int max)
Creates a scroll bar with the specified orientation, range, value and extent.


ScrollBar

public ScrollBar(GlContext ctx,
                 int orientation,
                 BoundedRangeModel model)
Creates a scroll bar with the specified orientation which will interact with the supplied model.

Method Detail

getModel

public BoundedRangeModel getModel()
Returns a reference to the scrollbar's range model.


wasAdded

public void wasAdded()
Description copied from class: Component
This method is called when we are added to a hierarchy that is connected to a top-level window (at which point we can rely on having a look and feel and can set ourselves up).


wasRemoved

public void wasRemoved()
Description copied from class: Component
This method is called when we are removed from a hierarchy that is connected to a top-level window. If we wish to clean up after things done in Component.wasAdded(), this is a fine place to do so.


getHitComponent

public Component getHitComponent(int mx,
                                 int my)
Description copied from class: Component
Returns the component "hit" by the specified mouse coordinates which might be this component or any of its children. This method should return null if the supplied mouse coordinates are outside the bounds of this component.

Overrides:
getHitComponent in class Container


Copyright © 2011. All Rights Reserved.