palmed.edit.scrollbar
Class Scrollbar

java.lang.Object
  extended by palmed.edit.scrollbar.Scrollbar
All Implemented Interfaces:
IScrollbar

public final class Scrollbar
extends java.lang.Object
implements IScrollbar

This class captures common behaviours of scrollbars.

Version:
$Revision$ $Date$
Author:
Mathieu Champlon

Constructor Summary
Scrollbar(IScrollable viewport, IDrawer drawer)
          Create a scrollbar.
 
Method Summary
 void click(int offset)
          Handle a click event.
 void drag(int offset)
          Handle a drag event.
 int getSize()
          Retrieve the size.
 int getWidth()
          Retrieve the width.
 void paint(javax.microedition.lcdui.Graphics g)
          Paint the scrollbar.
 void resize(int size)
          Resize the scrollbar.
 void scroll(int value)
          Scroll the cursor to the given value.
 void unclick()
          Handle an unclick event.
 void update(int visible, int max)
          Change the length of the cursor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scrollbar

public Scrollbar(IScrollable viewport,
                 IDrawer drawer)
Create a scrollbar.

Parameters:
viewport - the viewport to register
drawer - the scrollbar drawer
Method Detail

paint

public void paint(javax.microedition.lcdui.Graphics g)
Paint the scrollbar.

Parameters:
g - the graphics

scroll

public void scroll(int value)
Scroll the cursor to the given value.

Parameters:
value - the new value

update

public void update(int visible,
                   int max)
Change the length of the cursor.

Specified by:
update in interface IScrollbar
Parameters:
visible - the number of visible elements
max - the total number of elements

resize

public void resize(int size)
Resize the scrollbar.

Parameters:
size - the new size in pixels

click

public void click(int offset)
Handle a click event.

Parameters:
offset - the click offset

unclick

public void unclick()
Handle an unclick event.


drag

public void drag(int offset)
Handle a drag event.

Parameters:
offset - the offset to drag to

getWidth

public int getWidth()
Retrieve the width.

Returns:
the width in pixels

getSize

public int getSize()
Retrieve the size.

Returns:
the size in pixels


Copyright © 2004-2006 PalmEd. All Rights Reserved.