palmed.ui
Class Toolbar

java.lang.Object
  extended by palmed.ui.Toolbar
All Implemented Interfaces:
IComponent, IToolbar

public final class Toolbar
extends java.lang.Object
implements IToolbar, IComponent

This class implements a custom toolbar.

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

Constructor Summary
Toolbar(ICommandListener listener, ILayoutManager manager)
          Create a toolbar.
 
Method Summary
 void add(ICommand command, java.lang.String image)
          Add a button to the toolbar.
 boolean click(int x, int y)
          Handle a click event.
 void drag(int x, int y)
          Handle a drag event.
 int getHeight()
          Retrieve the current height.
 int getLayout()
          Retrieve the layout.
 int getWidth()
          Retrieve the current width.
 void paint(javax.microedition.lcdui.Graphics g)
          Paint the component.
 void resize(int width, int height)
          Request a component resize.
 void unclick(int x, int y)
          Handle an unclick event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Toolbar

public Toolbar(ICommandListener listener,
               ILayoutManager manager)
Create a toolbar.

Parameters:
listener - the command listener
manager - the layout manager
Method Detail

paint

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

Specified by:
paint in interface IComponent
Parameters:
g - the graphics

resize

public void resize(int width,
                   int height)
Request a component resize.

Specified by:
resize in interface IComponent
Parameters:
width - the new width
height - the new height

click

public boolean click(int x,
                     int y)
Handle a click event.

Specified by:
click in interface IComponent
Parameters:
x - the pointer abscissa
y - the pointer ordinate
Returns:
whether the component claims focus or not

drag

public void drag(int x,
                 int y)
Handle a drag event.

The component must have claimed focus upon click in order to receive this event.

Specified by:
drag in interface IComponent
Parameters:
x - the pointer abscissa
y - the pointer ordinate

unclick

public void unclick(int x,
                    int y)
Handle an unclick event.

The component must have claimed focus upon click ini order to receive this event.

Specified by:
unclick in interface IComponent
Parameters:
x - the pointer abscissa
y - the pointer ordinate

add

public void add(ICommand command,
                java.lang.String image)
Add a button to the toolbar.

Specified by:
add in interface IToolbar
Parameters:
command - the command to send to the command listener
image - the button image

getLayout

public int getLayout()
Retrieve the layout.

Supported layouts are :

Specified by:
getLayout in interface IComponent
Returns:
a combination of layout flags

getWidth

public int getWidth()
Retrieve the current width.

Specified by:
getWidth in interface IComponent
Returns:
the width in pixels

getHeight

public int getHeight()
Retrieve the current height.

Specified by:
getHeight in interface IComponent
Returns:
the height in pixels


Copyright © 2004-2006 PalmEd. All Rights Reserved.