dict.me
Class BaseForm

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Screen
          extended by javax.microedition.lcdui.Form
              extended by dict.me.BaseForm
All Implemented Interfaces:
IProgress, IResult, javax.microedition.lcdui.CommandListener
Direct Known Subclasses:
DictForm, SearchKeysForm

public abstract class BaseForm
extends javax.microedition.lcdui.Form
implements javax.microedition.lcdui.CommandListener, IResult

Base class for forms used in the package. Collects some common functionality.

Version:
$Revision: 21 $
Author:
Daniel Stoinski

Field Summary
private  javax.microedition.lcdui.Gauge m_gauge
          For progress presentation.
protected  DictMidlet m_parent
          The parent midlet.
 
Constructor Summary
BaseForm(DictMidlet aParent, java.lang.String aTitle)
          Initializes the form.
 
Method Summary
abstract  void addResult(java.lang.String aResult)
          Adding results must be implemented in derived classes.
protected  void emptyForm()
          Deletes of contents of the form but the gauge.
protected  DictIndex getIndex()
          Returns dictionary index handled in this application.
protected  void message(java.lang.Object msg)
          Prints the given message in an alert box.
 void progress(int aPercentage)
          Shows progress of the background thread in the gauge.
 void ready(java.lang.String aMessage)
          Called if the backgroudn thread finishes.
protected  void showForm(javax.microedition.lcdui.Form aForm)
          Shows the given form.
 
Methods inherited from class javax.microedition.lcdui.Form
append, append, append, delete, deleteAll, get, getHeight, getWidth, insert, set, setItemStateListener, size
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.microedition.lcdui.CommandListener
commandAction
 

Field Detail

m_parent

protected DictMidlet m_parent
The parent midlet.


m_gauge

private javax.microedition.lcdui.Gauge m_gauge
For progress presentation.

Constructor Detail

BaseForm

public BaseForm(DictMidlet aParent,
                java.lang.String aTitle)
Initializes the form.

Parameters:
aParent - the midlet to which the forms belongs.
aTitle - the title of the form.
Method Detail

emptyForm

protected void emptyForm()
Deletes of contents of the form but the gauge.


showForm

protected void showForm(javax.microedition.lcdui.Form aForm)
Shows the given form.

Parameters:
aForm - the form to show

message

protected void message(java.lang.Object msg)
Prints the given message in an alert box.

Parameters:
msg - the message to show.

getIndex

protected final DictIndex getIndex()
Returns dictionary index handled in this application.

Returns:
dictionary index, may be also null.

progress

public final void progress(int aPercentage)
Shows progress of the background thread in the gauge.

Specified by:
progress in interface IProgress
Parameters:
aPercentage - the progress in percents

addResult

public abstract void addResult(java.lang.String aResult)
Adding results must be implemented in derived classes.

Specified by:
addResult in interface IResult
Parameters:
aResult - the query result to show in the form

ready

public final void ready(java.lang.String aMessage)
Called if the backgroudn thread finishes.

Specified by:
ready in interface IProgress
Parameters:
aMessage - usually not null, if error. Show it then.