Class marimba.gui.ScrollbarWidget
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class marimba.gui.ScrollbarWidget

java.lang.Object
   |
   +----marimba.gui.Widget
           |
           +----marimba.gui.ValueWidget
                   |
                   +----marimba.gui.ScrollbarWidget

public class ScrollbarWidget
extends ValueWidget
implements TimerClient
A horizontal/vertical scrollbar. It can be horizontal or vertical, supports a proportional scroll box which means that the box represents the current page size and offers many other useful properties. The scrollbar repaints have been optimized in the sense that it only repaints when absolutely necessary.
Version:
1.55, 01/08/97
Author:
Klaas Waslander

Variable Index

 o autoSetValue
A scrollbar can automatically set the value based on the action.
 o constrained
Constrain to maxValue - pageSize.
 o lineSize
This controls how much you scroll when pressing a scroll arrow.
 o orientation
A scrollbar can be horizontal and vertical.
 o orientationOptions
The possible options for the orientation.
 o pageSize
Determines the visible portion of the scrollbar.
 o proportional
A scrollbar can be proportional, which means that the size of the scroll box represents the pagesize.
 o scrollMore
The maximum value of the scrollbar when pressing the down/right arrow can be made larger using this variable.
 o speed
The repeat rate in times/second for the scroll arrows.
 o trackAll
If true, action() is called after every change of the value.

Constructor Index

 o ScrollbarWidget()
Constructor.
 o ScrollbarWidget(int)
Constructor with orientation.

Method Index

 o action(int)
The user has changed the value of the scrollbar.
 o action(int, boolean)
Posts the event and calls action() if the boolean is true.
 o findTarget(int, int)
Find the scrollbar target under the given coordinates.
 o getAutoSetValue()
Check if this scrollbar has to set the value based on the action automatically.
 o getBoxSize()
Get the size of the scroll box in pixels, based on the pageSize or just square if the scrollbar is not proportional.
 o getLineSize()
Check the line size: how much the scroll box skips when pressing one of the scroll arrows.
 o getMaxScrollValue()
Get the maximum scroll value, which is the maximum value when dragging the scroll box.
 o getOrientation()
Get the orientation of the scrollbar.
 o getOrientationOptions()
Get the possible options for the orientation.
 o getPageSize()
Get the current size of the page, which controls the size of the scroll box.
 o getProperties(PropertyList)
Get the properties.
 o getScrollMore()
Get the adjustment of the maxValue for the unconstrained mode of this scrollbar.
 o getShaftSize()
Get the size of the scroll bar shaft in pixels.
 o getSpeed()
Check the repeat rate in times/second for the scroll arrows.
 o handleEvent(Event)
Event handler for mouse events.
 o isConstrained()
Check if this scrollbar is constrained.
 o isFilled()
Check if the scrollbar is filled.
 o isProportional()
Check whether this scroll bar is proportional.
 o paint(Graphics)
Paint the scrollbar.
 o paintScrollBox(Graphics, int, int, int, int)
Paint the scroll box at the given position and fill the scroll shaft above and below the box with the hilite color if the scroll bar is filled.
 o paramString(StringBuffer)
Debugging.
 o pixelsToValue(int)
Returns the scrollbar value given the specified pixelValue.
 o repaintFor(int, int, int)
Assumes the given values are valid.
 o setAutoSetValue(boolean)
Turn on or off automatically setting the value based on the action.
 o setConstrained(boolean)
Turn on or off automatically constraining the value based on the page size.
 o setFilled(boolean)
Let the scrollbar fill itself.
 o setInputValue(int)
Sets the value of the scrollbar only if autoSetValue is true.
 o setLineSize(int)
Set the line size.
 o setOrientation(int)
Set the orientation to horizontal or vertical.
 o setPageSize(int)
Set the current size of the page.
 o setParam(int, int, int)
Set the value, minValue and maxValue all at once.
 o setParam(int, int, int, int, int)
Set all parameters of the scroll bar at once.
 o setProperties(PropertyList)
Set the properties.
 o setProportional(boolean)
Let the scroll box always be square or let it represent the current page size.
 o setScrollMore(int)
Set the adjusting value of the scrollbar for unconstrained mode.
 o setSpeed(int)
Set the repeat rate in times/second for the scroll arrows.
 o setTrackAll(boolean)
Let the scrollbar call action() after every change of the value or only once.
 o startPageScrolling(int, int)
Start auto-scrolling pages.
 o tick(long, Object)
Auto repeat
 o tracksAll()
Check if all changes of the value are being tracked.
 o validate()
Validates the scroll bar.
 o valueToPixels(int)
Translates the given value to the number of pixels between the scroll box and the left/bottom.

Variables

 o orientationOptions
  public static Options orientationOptions
The possible options for the orientation.
See Also:
getOrientationOptions, orientation
 o orientation
  public int orientation
A scrollbar can be horizontal and vertical.
See Also:
getOrientation, setOrientation, orientationOptions
 o proportional
  public boolean proportional
A scrollbar can be proportional, which means that the size of the scroll box represents the pagesize. If it is not proportional, the scroll box is always square.
See Also:
isProportional, setProportional
 o lineSize
  public int lineSize
This controls how much you scroll when pressing a scroll arrow.
See Also:
setLineSize, getLineSize
 o pageSize
  public int pageSize
Determines the visible portion of the scrollbar. This controls the size of the scroll box.
See Also:
getPageSize, setPageSize
 o speed
  public int speed
The repeat rate in times/second for the scroll arrows. This controls how fast the scroll box moves.
See Also:
getSpeed, setSpeed
 o autoSetValue
  public boolean autoSetValue
A scrollbar can automatically set the value based on the action.
See Also:
getAutoSetValue, setAutoSetValue
 o constrained
  public boolean constrained
Constrain to maxValue - pageSize. This means that it is not possible to scroll further using the down arrow when the end has been reached.
See Also:
isConstrained, setConstrained
 o scrollMore
  public int scrollMore
The maximum value of the scrollbar when pressing the down/right arrow can be made larger using this variable. It must be used when you want to enable the scrollbar to scroll further (or less) then one page when the scrollbar is unconstrained.
See Also:
getScrollMore, setScrollMore
 o trackAll
  public boolean trackAll
If true, action() is called after every change of the value. Otherwise action() is only called when the (mouse)button is released.
See Also:
tracksAll, setTrackAll

Constructors

 o ScrollbarWidget
  public ScrollbarWidget()
Constructor.
 o ScrollbarWidget
  public ScrollbarWidget(int orientation)
Constructor with orientation.

Methods

 o getProperties
  public void getProperties(PropertyList list)
Get the properties.
Overrides:
getProperties in class ValueWidget
 o setProperties
  public void setProperties(PropertyList list)
Set the properties.
Overrides:
setProperties in class ValueWidget
 o isFilled
  public boolean isFilled()
Check if the scrollbar is filled. If the scrollbar is filled it is not transparent.
See Also:
transparent, setFilled
 o setFilled
  public void setFilled(boolean filled)
Let the scrollbar fill itself. If the scrollbar is filled it is not transparent.
See Also:
transparent, isFilled
 o getOrientationOptions
  public Options getOrientationOptions()
Get the possible options for the orientation.
See Also:
orientationOptions
 o getOrientation
  public int getOrientation()
Get the orientation of the scrollbar.
See Also:
orientation
 o setOrientation
  public void setOrientation(int orientation)
Set the orientation to horizontal or vertical.
See Also:
orientation
 o isProportional
  public boolean isProportional()
Check whether this scroll bar is proportional.
See Also:
proportional
 o setProportional
  public void setProportional(boolean proportional)
Let the scroll box always be square or let it represent the current page size.
See Also:
proportional
 o validate
  public void validate()
Validates the scroll bar. Calculates sizes of some drawing parameters.
Overrides:
validate in class Widget
 o getAutoSetValue
  public boolean getAutoSetValue()
Check if this scrollbar has to set the value based on the action automatically.
See Also:
autoSetValue
 o setAutoSetValue
  public void setAutoSetValue(boolean autoSetValue)
Turn on or off automatically setting the value based on the action.
See Also:
autoSetValue
 o isConstrained
  public boolean isConstrained()
Check if this scrollbar is constrained.
See Also:
constrained
 o setConstrained
  public void setConstrained(boolean constrained)
Turn on or off automatically constraining the value based on the page size.
See Also:
constrained
 o getScrollMore
  public int getScrollMore()
Get the adjustment of the maxValue for the unconstrained mode of this scrollbar.
See Also:
scrollMore
 o setScrollMore
  public void setScrollMore(int scrollMore)
Set the adjusting value of the scrollbar for unconstrained mode. Set it to zero for the default behaviour of being able to scroll one page further when unconstrained.
See Also:
scrollMore
 o tracksAll
  public boolean tracksAll()
Check if all changes of the value are being tracked.
See Also:
trackAll
 o setTrackAll
  public void setTrackAll(boolean trackAll)
Let the scrollbar call action() after every change of the value or only once.
See Also:
trackAll
 o getLineSize
  public int getLineSize()
Check the line size: how much the scroll box skips when pressing one of the scroll arrows.
See Also:
lineSize
 o setLineSize
  public synchronized void setLineSize(int lineSize)
Set the line size. This controls how much the scroll box skips when pressing one of the scroll arrows.
See Also:
lineSize
 o getPageSize
  public int getPageSize()
Get the current size of the page, which controls the size of the scroll box.
See Also:
pageSize
 o setPageSize
  public synchronized void setPageSize(int pageSize)
Set the current size of the page. This controls the size of the scrolling bar.
See Also:
pageSize
 o setParam
  public synchronized void setParam(int value,
                                    int minValue,
                                    int maxValue,
                                    int lineSize,
                                    int pageSize)
Set all parameters of the scroll bar at once.
 o getSpeed
  public int getSpeed()
Check the repeat rate in times/second for the scroll arrows.
See Also:
speed
 o setSpeed
  public void setSpeed(int speed)
Set the repeat rate in times/second for the scroll arrows.
See Also:
speed
 o getShaftSize
  public int getShaftSize()
Get the size of the scroll bar shaft in pixels.
 o getBoxSize
  public int getBoxSize()
Get the size of the scroll box in pixels, based on the pageSize or just square if the scrollbar is not proportional.
 o getMaxScrollValue
  public int getMaxScrollValue()
Get the maximum scroll value, which is the maximum value when dragging the scroll box. This always equals maxValue - pageSize.
 o setParam
  public synchronized void setParam(int value,
                                    int minValue,
                                    int maxValue)
Set the value, minValue and maxValue all at once. The value can get larger than the maxValue if the scrollbar is unconstrained: the value will go up to 'scrollMax'.
Overrides:
setParam in class ValueWidget
 o valueToPixels
  public int valueToPixels(int value)
Translates the given value to the number of pixels between the scroll box and the left/bottom.
 o pixelsToValue
  public int pixelsToValue(int pixels)
Returns the scrollbar value given the specified pixelValue.
 o repaintFor
  protected boolean repaintFor(int newValue,
                               int newMin,
                               int newMax)
Assumes the given values are valid. Checks whether these values would result in a new look that requires a repaint.
Overrides:
repaintFor in class ValueWidget
 o paint
  public void paint(Graphics g)
Paint the scrollbar.
Overrides:
paint in class Widget
See Also:
paintScrollBox
 o paintScrollBox
  protected void paintScrollBox(Graphics g,
                                int x,
                                int y,
                                int boxWidth,
                                int boxHeight)
Paint the scroll box at the given position and fill the scroll shaft above and below the box with the hilite color if the scroll bar is filled. If the scrollbar is currently paging down or up, the scroll shaft is filled with an appropriate color.
See Also:
paint
 o tick
  public long tick(long tm,
                   Object arg)
Auto repeat
Overrides:
tick in class Widget
 o setInputValue
  protected synchronized void setInputValue(int value)
Sets the value of the scrollbar only if autoSetValue is true. The inputValue is remembered, even if autoSetValue is false. When the scrollbar is unconstrained this method will set the input value up to scrollMax.
 o startPageScrolling
  protected void startPageScrolling(int type,
                                    int mousePos)
Start auto-scrolling pages.
 o findTarget
  protected int findTarget(int x,
                           int y)
Find the scrollbar target under the given coordinates. This can be UP, DOWN, PAGE_UP, PAGE_DOWN or -1 if no target is found.
 o handleEvent
  public boolean handleEvent(Event evt)
Event handler for mouse events.
Overrides:
handleEvent in class Widget
 o action
  public void action(int id)
The user has changed the value of the scrollbar.
 o action
  protected void action(int id,
                        boolean action)
Posts the event and calls action() if the boolean is true.
 o paramString
  public void paramString(StringBuffer buf)
Debugging.
Overrides:
paramString in class ValueWidget

All Packages  Class Hierarchy  This Package  Previous  Next  Index