Added "Searching" screen.
--- a/src/jdict/AskWord.java Sun Jul 29 21:26:49 2007 +0200
+++ b/src/jdict/AskWord.java Sun Jul 29 21:41:43 2007 +0200
@@ -124,17 +124,14 @@
{
DictIndex index = new DictIndex(vortaro);
- Vector results;
String toSearch = word.getString();
toSearch = transliterate(toSearch);
showSearch.setText(toSearch);
- System.out.println("Serĉante: " + toSearch);
+ SearchThread t = new SearchThread(toSearch, vortaro, myform);
- /* Search the word */
- results = index.BinarySearchDefinition(toSearch);
-
- ResultList resultslist = new ResultList(results, vortaro, myform);
+ SearchScreen s = new SearchScreen(toSearch);
+ t.start();
}
else if (c == cmd_eliri)
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdict/SearchScreen.java Sun Jul 29 21:41:43 2007 +0200
@@ -0,0 +1,23 @@
+package jdict;
+
+import javax.microedition.lcdui.*;
+
+public class SearchScreen
+{
+ public String _vorto;
+ public SearchScreen(String vorto)
+ {
+ _vorto = vorto;
+ show();
+ }
+
+ public void show()
+ {
+ Form myform = new Form(T.t("Serĉante..."));
+
+ StringItem item = new StringItem(T.t("Vorto:"), _vorto);
+ myform.append(item);
+
+ Main.display.setCurrent(myform);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdict/SearchThread.java Sun Jul 29 21:41:43 2007 +0200
@@ -0,0 +1,31 @@
+package jdict;
+
+import javax.microedition.lcdui.*;
+import java.util.Vector;
+
+public class SearchThread extends Thread
+{
+ private Displayable _last;
+ private String _vortaro;
+ private String _word;
+
+ public SearchThread(String word, String vortaro, Displayable last)
+ {
+ _word = word;
+ _vortaro = vortaro;
+ _last = last;
+ }
+
+ public void run()
+ {
+ DictIndex index = new DictIndex(_vortaro);
+
+ System.out.println("Serĉante: " + _word);
+
+ Vector results;
+ /* Search the word */
+ results = index.BinarySearchDefinition(_word);
+
+ ResultList resultslist = new ResultList(results, _vortaro, _last);
+ }
+}
--- a/src/jdict/T.java Sun Jul 29 21:26:49 2007 +0200
+++ b/src/jdict/T.java Sun Jul 29 21:41:43 2007 +0200
@@ -35,6 +35,7 @@
eo.put("Agordoj", "Agordoj");
eo.put("Informo", "Informo");
eo.put("Konservi", "Konservi");
+ eo.put("Serĉante...", "Serĉante...");
/* Eo iksa */
Hashtable eox = new Hashtable();
languages.put("eox", eox);
@@ -57,6 +58,7 @@
eox.put("Agordoj", "Agordoj");
eox.put("Informo", "Informo");
eox.put("Konservi", "Konservi");
+ eox.put("Serĉante...", "Sercxante...");
/* Ca */
Hashtable ca = new Hashtable();
languages.put("ca", ca);
@@ -79,6 +81,7 @@
ca.put("Agordoj", "Configuració");
ca.put("Informo", "Informació");
ca.put("Konservi", "Guardar");
+ ca.put("Serĉante...", "Cercant...");
/* Ru */
Hashtable ru = new Hashtable();
languages.put("ru", ru);
@@ -101,6 +104,7 @@
ru.put("Agordoj", "Настойки");
ru.put("Informo", "Информация");
ru.put("Konservi", "Сохранить");
+ ru.put("Serĉante...", "Ищу...");
/* default */
set_language("eo");