com.yospace.yae.yogi
Class YogiScrollBar

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiRange
              |
              +--com.yospace.yae.yogi.YogiScrollBar

public class YogiScrollBar
extends YogiRange

This class provides the scroll bars that YogiScrollPanes use. Scrollbars are typically contained within a YogiScrollPane, although this is not mandatory. Scrollbars may be customised with respect to configuration, which controls when a scrollbar will appear, and placement, which controls how a scrollbar will be painted.


Field Summary
static int APPEAR_ALWAYS
          Used to define a scrollbar that will always appear.
static int APPEAR_AS_NEEDED
          Used to define a scrollbar that will appear as needed.
static int APPEAR_NEVER
          Used to define a scrollbar that will never appear.
static int MODE_CONTRACTED
          Scrollbar mode constant representing the contracted state.
static int MODE_MAXIMIZED
          Scrollbar mode constant representing the maximized state.
static int MODE_MINIMIZED
          Scrollbar mode constant representing the minimized state.
static int PLACEMENT_BOTTOM
          Constant the defines that the scrollbar will appear on the bottom of its scrollpane.
static int PLACEMENT_LEFT
          Constant the defines that the scrollbar will appear on the left of its scrollpane.
static int PLACEMENT_RIGHT
          Constant the defines that the scrollbar will appear on the right of its scrollpane.
static int PLACEMENT_TOP
          Constant the defines that the scrollbar will appear on the top of its scrollpane.
static int PROPERTY_CONFIG
          Constant for config property.
static int PROPERTY_MODE
          Constant for mode property.
static int PROPERTY_PLACEMENT
          Constant for placement property.
static int PROPERTY_VIEW_SIZE
          Constant for view size property.
 
Fields inherited from class com.yospace.yae.yogi.YogiRange
maxValue, minValue, PROPERTY_BLOCK_INCREMENT, PROPERTY_MAX_VALUE, PROPERTY_MIN_VALUE, PROPERTY_UNIT_INCREMENT, PROPERTY_VALUE, value
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
YogiScrollBar()
          Default constructor.
YogiScrollBar(int config, int placement)
          Constructor taking configuration and placement settings.
 
Method Summary
 int getConfig()
          Gets the configuration of the scrollbar.
 int getMode()
          Gets the scrollbar mode.
 int getPlacement()
          Gets the placement of the scrollbar.
 int getViewSize()
          Gets the length of the scrollbar.
 int parsePlacement(java.lang.String placement)
          Method used internally in conjunction with setProperty() to read a scrollbar's placement from xml.
 void setConfig(int config)
          Sets the configuration of the scrollbar.
 boolean setMode(int mode)
          Sets the mode of the scrollbar.
 void setPlacement(int placement)
          Sets the placement of the scrollbar.
 void setViewSize(int viewSize)
          Sets the length of the scrollbar.
 
Methods inherited from class com.yospace.yae.yogi.YogiRange
getBlockIncrement, getMaxValue, getMinValue, getRange, getUnitIncrement, getValue, setBlockIncrement, setMaxValue, setMinValue, setUnitIncrement, setValue
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, add, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CONFIG

public static final int PROPERTY_CONFIG
Constant for config property.

PROPERTY_PLACEMENT

public static final int PROPERTY_PLACEMENT
Constant for placement property.

PROPERTY_VIEW_SIZE

public static final int PROPERTY_VIEW_SIZE
Constant for view size property.

PROPERTY_MODE

public static final int PROPERTY_MODE
Constant for mode property.

APPEAR_NEVER

public static final int APPEAR_NEVER
Used to define a scrollbar that will never appear.

APPEAR_AS_NEEDED

public static final int APPEAR_AS_NEEDED
Used to define a scrollbar that will appear as needed.

APPEAR_ALWAYS

public static final int APPEAR_ALWAYS
Used to define a scrollbar that will always appear.

PLACEMENT_BOTTOM

public static final int PLACEMENT_BOTTOM
Constant the defines that the scrollbar will appear on the bottom of its scrollpane.

PLACEMENT_TOP

public static final int PLACEMENT_TOP
Constant the defines that the scrollbar will appear on the top of its scrollpane.

PLACEMENT_LEFT

public static final int PLACEMENT_LEFT
Constant the defines that the scrollbar will appear on the left of its scrollpane.

PLACEMENT_RIGHT

public static final int PLACEMENT_RIGHT
Constant the defines that the scrollbar will appear on the right of its scrollpane.

MODE_MINIMIZED

public static final int MODE_MINIMIZED
Scrollbar mode constant representing the minimized state. Scrollbars are not visible when in minimized mode.

MODE_CONTRACTED

public static final int MODE_CONTRACTED
Scrollbar mode constant representing the contracted state. Scrollbars are in contracted mode when two appear in the same YogiScrollPane and thus cannot occupy the full extent of the scroll pane.

MODE_MAXIMIZED

public static final int MODE_MAXIMIZED
Scrollbar mode constant representing the maximized state. Scrollbars will occupy the fully extent of the YogiScrollPane in this mode.
Constructor Detail

YogiScrollBar

public YogiScrollBar()
Default constructor. Creates a scroll bar that will appear as needed.

YogiScrollBar

public YogiScrollBar(int config,
                     int placement)
Constructor taking configuration and placement settings.
Parameters:
config - the scrollbar configuration. Must be one of APPEAR_NEVER, APPEAR_AS_NEEDED, APPEAR_ALWAYS.
placement - the scrollbar placement. Must be one of PLACEMENT_BOTTOM, PLACEMENT_TOP, PLACEMENT_LEFT, PLACEMENT_RIGHT.
Method Detail

setViewSize

public void setViewSize(int viewSize)
Sets the length of the scrollbar.
Parameters:
viewSize - the length in pixels of the scrollbar.

getViewSize

public int getViewSize()
Gets the length of the scrollbar.
Returns:
the scrollbar length in pixels.

setConfig

public void setConfig(int config)
Sets the configuration of the scrollbar. Must be one of APPEAR_NEVER, APPEAR_AS_NEEDED, APPEAR_ALWAYS.
Parameters:
config - the new scrollbar configuration setting.

getConfig

public int getConfig()
Gets the configuration of the scrollbar.
Returns:
the scrollbar configuration.

setPlacement

public void setPlacement(int placement)
Sets the placement of the scrollbar. Must be one of PLACEMENT_BOTTOM, PLACEMENT_TOP, PLACEMENT_LEFT, PLACEMENT_RIGHT.
Parameters:
placement - the new scrollbar placement setting.

getPlacement

public int getPlacement()
Gets the placement of the scrollbar.
Returns:
the scrollbar placement.

setMode

public boolean setMode(int mode)
Sets the mode of the scrollbar. Must be one of MODE_MINIMIZED, MODE_CONTRACTED, MODE_MAXIMIZED.
Parameters:
mode - the new mode for the scrollbar.
Returns:
true if the mode changed, false otherwise.

getMode

public int getMode()
Gets the scrollbar mode.
Returns:
the scrollbar mode.

parsePlacement

public int parsePlacement(java.lang.String placement)
Method used internally in conjunction with setProperty() to read a scrollbar's placement from xml.
Parameters:
placement - scrollbar placement.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.