jcontrol.ui.vole
Class ScrollBar

java.lang.Object
  |
  +--jcontrol.ui.vole.Component
        |
        +--jcontrol.ui.vole.ScrollBar

public class ScrollBar
extends Component

This class ScrollBar implements a graphical scroll bar. The scroll bar can be scrolled manually by e.g. a controllet to realise graphical scrolling. The scroll value range is 0..100.

Author:
Marcus Timmermann, Wolfgang Klingauf

Field Summary
static boolean HORIZONTAL
          Horizontal scroll bar.
static boolean VERTICAL
          Vertical scroll bar.
 
Fields inherited from class jcontrol.ui.vole.Component
focusOwner, font, g, height, listener, parent, visible, width, x, y
 
Constructor Summary
ScrollBar(int x, int y, int size, boolean orientation)
          Constructs a new scroll bar.
 
Method Summary
 void paint()
          Repaint the ScrollBar.
 void setValue(int value)
          Sets a new scroll value in percent and repaints the scrollbar.
 boolean transferFocus()
          We never gain the input focus.
 
Methods inherited from class jcontrol.ui.vole.Component
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setLocation, setParent, setVisible, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Field Detail

HORIZONTAL

public static final boolean HORIZONTAL
Horizontal scroll bar.

See Also:
Constant Field Values

VERTICAL

public static final boolean VERTICAL
Vertical scroll bar.

See Also:
Constant Field Values
Constructor Detail

ScrollBar

public ScrollBar(int x,
                 int y,
                 int size,
                 boolean orientation)
Constructs a new scroll bar.

Parameters:
x - the upper left x coordinate.
y - the upper left y coordinate.
size - the size in pixels (at least 23).
orientation - HORIZONTAL or VERTICAL.
Method Detail

paint

public void paint()
Repaint the ScrollBar.

Overrides:
paint in class Component

setValue

public void setValue(int value)
Sets a new scroll value in percent and repaints the scrollbar.

Parameters:
value - The new scroll value

transferFocus

public boolean transferFocus()
We never gain the input focus.

Overrides:
transferFocus in class Component
Returns:
true, if the focus was transferred successfully.