[sword-svn] r114 - in trunk: app/src/org/crosswire/flashcards app/src/org/crosswire/modedit micro/src/org/crosswire/flashcards/mobile

Apache apache at www.crosswire.org
Mon Feb 19 18:47:22 MST 2007


Author: 
Date: 2007-02-19 18:47:22 -0700 (Mon, 19 Feb 2007)
New Revision: 114

Modified:
   trunk/app/src/org/crosswire/flashcards/ComplexLesson.java
   trunk/app/src/org/crosswire/modedit/HebrewMCIM.java
   trunk/micro/src/org/crosswire/flashcards/mobile/FlashCards.java
   trunk/micro/src/org/crosswire/flashcards/mobile/Quiz.java
Log:
Added Shevah to MC keyboard
Updated to include loading status.


Modified: trunk/app/src/org/crosswire/flashcards/ComplexLesson.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/ComplexLesson.java	2007-02-20 01:40:28 UTC (rev 113)
+++ trunk/app/src/org/crosswire/flashcards/ComplexLesson.java	2007-02-20 01:47:22 UTC (rev 114)
@@ -180,8 +180,8 @@
                          dir.mkdirs();
                     }
                     outStream = new FileOutputStream(file);
-                    final int width = 120;
-                    final int height = 20;
+                    final int width = 140;
+                    final int height = 40;
 
                     // Create a buffered image in which to draw
                     BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
@@ -193,8 +193,8 @@
                     g2d.setColor(Color.white);
                     g2d.fillRect(0, 0, width, height);
                     g2d.setColor(Color.black);
-                    g2d.setFont(new Font(g2d.getFont().getName(), Font.BOLD, 15));
-                    g2d.drawString(f.getFront(), 4, 14);
+                    g2d.setFont(new Font(g2d.getFont().getName(), Font.BOLD, (int)(height*.75)));
+                    g2d.drawString(f.getFront(), 4, (int)(height*.67));
 
                     // Graphics context no longer needed so dispose it
                     g2d.dispose();

Modified: trunk/app/src/org/crosswire/modedit/HebrewMCIM.java
===================================================================
--- trunk/app/src/org/crosswire/modedit/HebrewMCIM.java	2007-02-20 01:40:28 UTC (rev 113)
+++ trunk/app/src/org/crosswire/modedit/HebrewMCIM.java	2007-02-20 01:47:22 UTC (rev 114)
@@ -14,9 +14,9 @@
 public class HebrewMCIM
     extends SWInputMethod {
 
-  char subst[] = new char[255];
-  Hashtable subst2[] = new Hashtable[12];
-  Hashtable multiChars = new Hashtable();
+  private char subst[] = new char[255];
+  private Hashtable subst2[] = new Hashtable[12];
+  private Hashtable multiChars = new Hashtable();
 
   public HebrewMCIM(String name) {
     super(name);
@@ -147,6 +147,7 @@
 
     }
     subst[':'] = 2;
+    subst2[2].put(new Integer(':'), new Integer(1456));
     subst2[2].put(new Integer('A'), new Integer(1458));
     subst2[2].put(new Integer('E'), new Integer(1457));
     subst2[2].put(new Integer('F'), new Integer(1459));

Modified: trunk/micro/src/org/crosswire/flashcards/mobile/FlashCards.java
===================================================================
--- trunk/micro/src/org/crosswire/flashcards/mobile/FlashCards.java	2007-02-20 01:40:28 UTC (rev 113)
+++ trunk/micro/src/org/crosswire/flashcards/mobile/FlashCards.java	2007-02-20 01:47:22 UTC (rev 114)
@@ -22,10 +22,32 @@
   public LessonGroups lessonGroups = new LessonGroups();
   public Lessons lessons = new Lessons();
   public Quiz quiz = new Quiz();
+  public boolean loaded = false;
 
   public Vector lessonSets = new Vector();
   public FlashCards() {
     instance = this;
+  }
+
+  public void startApp() {
+    lessonGroups.show();
+    if (!loaded) {
+      loadLessons();
+    }
+  }
+
+  public void pauseApp() {
+  }
+
+  public void destroyApp(boolean unconditional) {
+  }
+
+  public static void quitApp() {
+    instance.destroyApp(true);
+    instance.notifyDestroyed();
+    instance = null;
+  }
+  public void loadLessons() {
     Properties l = new Properties();
     try {
       l.load("/lessons.properties");
@@ -35,8 +57,9 @@
       for (int i = 0; true; i++) {
         String ld = l.getProperty("LessonSet" + Integer.toString(i));
         if (ld != null) {
-          LessonSet ls = new MicroLessonSet("/"+ld);
           String desc = l.getProperty("LessonDescription" + Integer.toString(i));
+          lessonGroups.lessonGroupChoice.setLabel("Loading ["+desc+"]...");
+          LessonSet ls = new MicroLessonSet("/" + ld);
           ls.setDescription( (desc != null) ? desc : ld);
           lessonSets.addElement(ls);
         }
@@ -49,22 +72,8 @@
       ls.setDescription("All Lessons");
       lessonSets.addElement(ls);
     }
+    loaded = true;
+    lessonGroups.lessonGroupChoice.setLabel("Lesson Groups");
+    lessonGroups.loadLessonGroups();
   }
-
-  public void startApp() {
-    lessonGroups.show();
-  }
-
-  public void pauseApp() {
-  }
-
-  public void destroyApp(boolean unconditional) {
-  }
-
-  public static void quitApp() {
-    instance.destroyApp(true);
-    instance.notifyDestroyed();
-    instance = null;
-  }
-
 }

Modified: trunk/micro/src/org/crosswire/flashcards/mobile/Quiz.java
===================================================================
--- trunk/micro/src/org/crosswire/flashcards/mobile/Quiz.java	2007-02-20 01:40:28 UTC (rev 113)
+++ trunk/micro/src/org/crosswire/flashcards/mobile/Quiz.java	2007-02-20 01:47:22 UTC (rev 114)
@@ -81,7 +81,7 @@
         String ans = answersDisplay.getString(a);
         String right = currentWord.getBack();
 	if (right.length() > 23) {
-	  right = right.substring(0, 21) + "...";
+	  right = right.substring(0, 20) + "...";
 	}
         if (ans.equals(right)) {
           wordDisplay(wrongThisTime, "Correct");
@@ -116,14 +116,14 @@
       wordImage.setImage(null);
       wordImage.setLabel(currentWord.getFront());
     }
-    Vector answers = quizer.getRandomAnswers(5);
+    Vector answers = quizer.getRandomAnswers(4);
     while (answersDisplay.size() > 0) {
       answersDisplay.delete(0);
     }
     for (int i = 0; i < answers.size(); i++) {
       String a = (String) answers.elementAt(i);
       if (a.length() > 23) {
-        a = a.substring(0, 21) + "...";
+        a = a.substring(0, 20) + "...";
       }
       answersDisplay.append(a, null);
     }




More information about the sword-cvs mailing list