palmed.edit
Class TextArea

java.lang.Object
  extended by palmed.edit.TextArea
All Implemented Interfaces:
ISelectionView, IComponent

public final class TextArea
extends java.lang.Object
implements IComponent, ISelectionView

This class implements a text area component.

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

Constructor Summary
TextArea(Viewport viewport)
          Create a text area component.
 
Method Summary
 boolean click(int x, int y)
          Handle a click event.
 void drag(int x, int y)
          Handle a drag event.
 int getColumns()
          Retrieve the number of columns.
 int getHeight()
          Retrieve the current height.
 int getLayout()
          Retrieve the layout.
 int getLines()
          Retrieve the number of lines.
 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 setFont(java.lang.String name)
          Change the font.
 void unclick(int x, int y)
          Handle an unclick event.
 void update(Coordinate position)
          Notify the insertion position has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextArea

public TextArea(Viewport viewport)
Create a text area component.

Parameters:
viewport - the viewport
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

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

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

update

public void update(Coordinate position)
Notify the insertion position has changed.

Specified by:
update in interface ISelectionView
Parameters:
position - the new position

getLines

public int getLines()
Retrieve the number of lines.

Returns:
the number of lines

getColumns

public int getColumns()
Retrieve the number of columns.

Returns:
the number of columns

setFont

public void setFont(java.lang.String name)
Change the font.

Parameters:
name - the font resource name


Copyright © 2004-2006 PalmEd. All Rights Reserved.