dict.me
Class DictForm

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
                  extended by dict.me.DictForm
All Implemented Interfaces:
IProgress, IResult, javax.microedition.lcdui.CommandListener

public class DictForm
extends BaseForm

The main dictionary form.

Version:
$Revision: 21 $
Author:
Daniel Stoinski

Field Summary
private  javax.microedition.lcdui.TextField m_input
          Input box for the keyword to search for.
private  DictIndexLoadThread m_loadthr
          Thread for background loading.
private  SearchKeysForm m_skform
          For for searching keywords.
private  DictIndexSearchThread m_thr
          Thread for searching for keyword explanations.
private static int MAXINPLEN
          Maximum length of the keyword to search in characters.
 
Fields inherited from class dict.me.BaseForm
m_parent
 
Constructor Summary
DictForm(DictMidlet aParent)
          Initializes the form.
 
Method Summary
 void addResult(java.lang.String aResult)
          Shows the given result in the form.
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable s)
          Command actions.
private  void doSearch()
          Starts searching for the keyword explanations.
 void doSearch(java.lang.String aKeyword)
          Starts searching for the given keyword.
protected  void emptyForm()
          Initializes the layout of an empty form.
 java.lang.String getInput()
          Returns the keyword entered by the user.
 
Methods inherited from class dict.me.BaseForm
getIndex, message, progress, ready, showForm
 
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
 

Field Detail

MAXINPLEN

private static final int MAXINPLEN
Maximum length of the keyword to search in characters.

See Also:
Constant Field Values

m_loadthr

private DictIndexLoadThread m_loadthr
Thread for background loading.


m_thr

private DictIndexSearchThread m_thr
Thread for searching for keyword explanations.


m_input

private javax.microedition.lcdui.TextField m_input
Input box for the keyword to search for.


m_skform

private SearchKeysForm m_skform
For for searching keywords.

Constructor Detail

DictForm

public DictForm(DictMidlet aParent)
Initializes the form.

Parameters:
aParent - the parent midlet.
Method Detail

emptyForm

protected void emptyForm()
Initializes the layout of an empty form.

Overrides:
emptyForm in class BaseForm

addResult

public final void addResult(java.lang.String aResult)
Shows the given result in the form.

Specified by:
addResult in interface IResult
Specified by:
addResult in class BaseForm
Parameters:
aResult - the result string to add.

getInput

public final java.lang.String getInput()
Returns the keyword entered by the user.

Returns:
the keyword entered by the user

doSearch

public final void doSearch(java.lang.String aKeyword)
Starts searching for the given keyword. Puts the keyword into the input box and stars searching for it.

Parameters:
aKeyword - the keyword to search

doSearch

private void doSearch()
Starts searching for the keyword explanations.


commandAction

public final void commandAction(javax.microedition.lcdui.Command c,
                                javax.microedition.lcdui.Displayable s)
Command actions.

Parameters:
c - c.getCommandType() contains the action caused by the user.
s - ignored.