multivalent.gui

Class VScrollbar

public class VScrollbar extends Leaf implements EventListener

Scrollbars, both vertical and horizontal. Communication is done with logical values, as opposed to visual or display coordinates. Unless otherwise noted, method parameters and return values that are geometric are relative to the source being scrolled, not the internal scrollbar display. The scrollbar visually indicates the amount of the document displayed.

Version: $Revision: 1.11 $ $Date: 2003/06/02 05:20:34 $

See Also: IScrollPane

Field Summary
static intBOTTOMARROW
Logical parts of scrollbar reported by idLocation.
static intBOTTOMTROUGH
Logical parts of scrollbar reported by idLocation.
static intHORIZONTAL
Scrollbar orientation to pass in constructor.
static intNIB
Logical parts of scrollbar reported by idLocation.
static intNOWHERE
Logical parts of scrollbar reported by idLocation.
static byteSHOW_ALWAYS
Policy for showing scrollbar.
static byteSHOW_AS_NEEDED
Policy for showing scrollbar.
static byteSHOW_NEVER
Policy for showing scrollbar.
static intSIZE
Width of scrollbar (height if horizontal).
static intTOPARROW
Logical parts of scrollbar reported by idLocation.
static intTOPTROUGH
Logical parts of scrollbar reported by idLocation.
static intVERTICAL
Scrollbar orientation to pass in constructor.
Constructor Summary
VScrollbar(int orientation)
VScrollbar(String name, Map<String,Object> attr, INode parent, int orientation)
Method Summary
voidevent(AWTEvent e)
booleaneventNode(AWTEvent e, Point rel)
booleanformatNode(int width, int height, Context cx)
intgetBlockIncrement()
intgetLineIncrement()
intgetMax()
intgetMin()
bytegetShowPolicy()
intgetValue()
intidLocation(Point rel)
Figure out what scrollbar part lies under the passed point, such as TOPARROW.
booleanpaintNodeContent(Context cx, int start, int end)
Subclass for different scrollbar appearances.
voidsetMinMax(int minimum, int maximum)
Set min and max values of source.
voidsetShowPolicy(byte policy)
voidsetValue(int value, boolean pickplace)
Value is in source coordinates.
voidsetValue(int value)
Same as setValue(value, false).

Field Detail

BOTTOMARROW

public static final int BOTTOMARROW
Logical parts of scrollbar reported by idLocation.

BOTTOMTROUGH

public static final int BOTTOMTROUGH
Logical parts of scrollbar reported by idLocation.

HORIZONTAL

public static final int HORIZONTAL
Scrollbar orientation to pass in constructor.

NIB

public static final int NIB
Logical parts of scrollbar reported by idLocation.

NOWHERE

public static final int NOWHERE
Logical parts of scrollbar reported by idLocation.

SHOW_ALWAYS

public static final byte SHOW_ALWAYS
Policy for showing scrollbar.

SHOW_AS_NEEDED

public static final byte SHOW_AS_NEEDED
Policy for showing scrollbar.

SHOW_NEVER

public static final byte SHOW_NEVER
Policy for showing scrollbar.

SIZE

public static int SIZE
Width of scrollbar (height if horizontal).

TOPARROW

public static final int TOPARROW
Logical parts of scrollbar reported by idLocation.

TOPTROUGH

public static final int TOPTROUGH
Logical parts of scrollbar reported by idLocation.

VERTICAL

public static final int VERTICAL
Scrollbar orientation to pass in constructor.

Constructor Detail

VScrollbar

public VScrollbar(int orientation)

VScrollbar

public VScrollbar(String name, Map<String,Object> attr, INode parent, int orientation)

Method Detail

event

public void event(AWTEvent e)

eventNode

public boolean eventNode(AWTEvent e, Point rel)

formatNode

public boolean formatNode(int width, int height, Context cx)

getBlockIncrement

public int getBlockIncrement()

getLineIncrement

public int getLineIncrement()

getMax

public int getMax()

getMin

public int getMin()

getShowPolicy

public byte getShowPolicy()

getValue

public int getValue()

idLocation

public int idLocation(Point rel)
Figure out what scrollbar part lies under the passed point, such as TOPARROW.

paintNodeContent

public boolean paintNodeContent(Context cx, int start, int end)
Subclass for different scrollbar appearances.

setMinMax

public void setMinMax(int minimum, int maximum)
Set min and max values of source.

setShowPolicy

public void setShowPolicy(byte policy)

setValue

public void setValue(int value, boolean pickplace)
Value is in source coordinates. Cannot set past end of scrollbar minus source equivalent of height of nib.

Parameters: pickplace Smart scrolling, after Tk's text widget -pickplace option: If the location is already shown, do nothing; if it's a little way off the screen (top or bottom), scroll just enough to bring it into view; if it's far away, show it centered.

setValue

public void setValue(int value)
Same as setValue(value, false).