palmed.ui
Class Component

java.lang.Object
  extended by palmed.ui.Component
All Implemented Interfaces:
IComponent

public final class Component
extends java.lang.Object
implements IComponent

This class implements a component within a container.

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

Constructor Summary
Component(IComponent component)
          Create a component.
 
Method Summary
 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 move(int x, int y)
          Move the component to the given position.
 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

Component

public Component(IComponent component)
Create a component.

Parameters:
component - the underlying user component
Method Detail

move

public void move(int x,
                 int y)
Move the component to the given position.

Parameters:
x - the position abscissa
y - the position ordinate

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

getLayout

public int getLayout()
Retrieve the layout.

Supported layouts are :

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

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

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.