charvax.swing
Class JScrollBar

java.lang.Object
  extended bycharva.awt.Component
      extended bycharvax.swing.JComponent
          extended bycharvax.swing.JScrollBar
All Implemented Interfaces:
Adjustable

public class JScrollBar
extends JComponent
implements Adjustable

An implementation of a scrollbar. The user positions the knob in the scrollbar to determine the contents of the viewing area.


Field Summary
protected  java.util.Vector _adjustmentListeners
          A list of AdjustmentListeners registered for this component.
 
Fields inherited from class charvax.swing.JComponent
_border
 
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface charva.awt.Adjustable
HORIZONTAL, VERTICAL
 
Constructor Summary
JScrollBar()
          Creates a vertical scrollbar with default values.
JScrollBar(int orientation_)
          Creates a scrollbar with the specified orientation and with default values.
JScrollBar(int orientation_, int value_, int extent_, int min_, int max_)
          Creates a scrollbar with the specified orientation, value, extent, min and max.
 
Method Summary
 void addAdjustmentListener(AdjustmentListener listener_)
          Register an AdjustmentListener object for this component.
 void debug(int level_)
           
 void draw()
          Draws the border of the component (if there is one).
 int getBlockIncrement()
          Gets the block increment (the amount by which the value will change when the arrow keys are pressed).
 int getHeight()
           
 int getMaximum()
          Gets the maximum value of the adjustable object.
 int getMinimum()
          Gets the minimum value of the adjustable object.
 int getOrientation()
          Gets the scrollbar's orientation (VERTICAL or HORIZONTAL)
 Dimension getSize()
          Get the screen size of the scrollbar.
 int getValue()
          Gets the value of the adjustable object.
 int getVisibleAmount()
          Gets the length of the proportional indicator.
 int getWidth()
           
 Dimension minimumSize()
           
 void processAdjustmentEvent(AdjustmentEvent evt_)
           
 void processKeyEvent(KeyEvent ke_)
          Invoke all the KeyListener callbacks that may have been registered for this component.
 void removeAdjustmentListener(AdjustmentListener listener_)
           
 void requestFocus()
          This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.
 void setBlockIncrement(int val_)
          Sets the block increment of the scrollbar.
 void setMaximum(int max_)
          Set the scrollbar's maximum value.
 void setMinimum(int min_)
          Set the scrollbar's minimum value.
 void setSize(Dimension size_)
          Set the size of the component on the screen.
 void setValue(int value_)
          Set the scrollbar's value.
 void setVisibleAmount(int extent_)
          Set the scrollbar's extent (a.k.a "visible amount").
 
Methods inherited from class charvax.swing.JComponent
getBorder, getInsets, setBorder
 
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, processEvent, processFocusEvent, processMouseEvent, repaint, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_adjustmentListeners

protected java.util.Vector _adjustmentListeners
A list of AdjustmentListeners registered for this component.

Constructor Detail

JScrollBar

public JScrollBar()
Creates a vertical scrollbar with default values.


JScrollBar

public JScrollBar(int orientation_)
Creates a scrollbar with the specified orientation and with default values.


JScrollBar

public JScrollBar(int orientation_,
                  int value_,
                  int extent_,
                  int min_,
                  int max_)
Creates a scrollbar with the specified orientation, value, extent, min and max.

Method Detail

getOrientation

public int getOrientation()
Gets the scrollbar's orientation (VERTICAL or HORIZONTAL)

Specified by:
getOrientation in interface Adjustable

setMinimum

public void setMinimum(int min_)
Set the scrollbar's minimum value.

Specified by:
setMinimum in interface Adjustable

setValue

public void setValue(int value_)
Set the scrollbar's value.

Specified by:
setValue in interface Adjustable

setVisibleAmount

public void setVisibleAmount(int extent_)
Set the scrollbar's extent (a.k.a "visible amount").

Specified by:
setVisibleAmount in interface Adjustable

setMaximum

public void setMaximum(int max_)
Set the scrollbar's maximum value.

Specified by:
setMaximum in interface Adjustable

setBlockIncrement

public void setBlockIncrement(int val_)
Sets the block increment of the scrollbar.

Specified by:
setBlockIncrement in interface Adjustable

setSize

public void setSize(Dimension size_)
Set the size of the component on the screen. If the scrollbar is vertical, ignore the specified width, and if it is horizontal, ignore the specified height.


getSize

public Dimension getSize()
Get the screen size of the scrollbar.

Specified by:
getSize in class Component

getWidth

public int getWidth()
Specified by:
getWidth in class Component

getHeight

public int getHeight()
Specified by:
getHeight in class Component

draw

public void draw()
Description copied from class: JComponent
Draws the border of the component (if there is one).

Overrides:
draw in class JComponent

processKeyEvent

public void processKeyEvent(KeyEvent ke_)
Description copied from class: Component
Invoke all the KeyListener callbacks that may have been registered for this component. The KeyListener objects may modify the keycodes, and can also set the "consumed" flag.

Overrides:
processKeyEvent in class Component

requestFocus

public void requestFocus()
Description copied from class: Component
This method should be invoked by all subclasses of Component which override this method; because this method generates the FOCUS_GAINED event when the component gains the keyboard focus.

Overrides:
requestFocus in class Component

addAdjustmentListener

public void addAdjustmentListener(AdjustmentListener listener_)
Register an AdjustmentListener object for this component.

Specified by:
addAdjustmentListener in interface Adjustable

removeAdjustmentListener

public void removeAdjustmentListener(AdjustmentListener listener_)
Specified by:
removeAdjustmentListener in interface Adjustable

processAdjustmentEvent

public void processAdjustmentEvent(AdjustmentEvent evt_)
Specified by:
processAdjustmentEvent in interface Adjustable

debug

public void debug(int level_)
Specified by:
debug in class Component

minimumSize

public Dimension minimumSize()
Specified by:
minimumSize in class Component

getMinimum

public int getMinimum()
Description copied from interface: Adjustable
Gets the minimum value of the adjustable object.

Specified by:
getMinimum in interface Adjustable

getValue

public int getValue()
Description copied from interface: Adjustable
Gets the value of the adjustable object.

Specified by:
getValue in interface Adjustable

getVisibleAmount

public int getVisibleAmount()
Description copied from interface: Adjustable
Gets the length of the proportional indicator.

Specified by:
getVisibleAmount in interface Adjustable

getMaximum

public int getMaximum()
Description copied from interface: Adjustable
Gets the maximum value of the adjustable object.

Specified by:
getMaximum in interface Adjustable

getBlockIncrement

public int getBlockIncrement()
Description copied from interface: Adjustable
Gets the block increment (the amount by which the value will change when the arrow keys are pressed).

Specified by:
getBlockIncrement in interface Adjustable