[jsword-svn] r1334 - in trunk: bibledesktop/src/main/java/org/crosswire/bibledesktop/book bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane biblemapper/src/main/java/org/crosswire/biblemapper/model biblemapper/src/main/java/org/crosswire/biblemapper/swing common/src/main/java/org/crosswire/common/config jsword/src/main/java/org/crosswire/jsword/book jsword/src/main/java/org/crosswire/jsword/book/basic jsword/src/main/java/org/crosswire/jsword/examples jsword/src/main/java/org/crosswire/jsword/index/lucene jsword/src/test/java/org/crosswire/jsword/book jsword/src/test/java/org/crosswire/jsword/book/test jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb jsword-limbo/src/main/java/org/crosswire/bibledesktop/passage jsword-limbo/src/main/java/org/crosswire/jsword/book jsword-limbo/src/main/java/org/crosswire/jsword/book/basic jsword-limbo/src/main/java/org/crosswire/jsword/book/remote jsword-limbo/src/main/java/org/crosswire/jsword/book/search/ser jsword-limbo/src/main/java/org/crosswire/jsword/view/web

dmsmith at www.crosswire.org dmsmith at www.crosswire.org
Sat May 19 07:09:11 MST 2007


Author: dmsmith
Date: 2007-05-19 07:09:10 -0700 (Sat, 19 May 2007)
New Revision: 1334

Modified:
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java
   trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/model/LinkArray.java
   trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/CliMapper.java
   trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java
   trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBBookDataDisplay.java
   trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java
   trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/passage/PassageListCellRenderer.java
   trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/StudyTool.java
   trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/Verifier.java
   trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoter.java
   trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/ser/SerIndex.java
   trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Book.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/BookData.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java
   trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
   trunk/jsword/src/test/java/org/crosswire/jsword/book/BooksTest.java
   trunk/jsword/src/test/java/org/crosswire/jsword/book/ReadEverything.java
   trunk/jsword/src/test/java/org/crosswire/jsword/book/test/Speed.java
Log:
Initial code for parallel Bibles.

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/book/BooksComboBoxModel.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -67,7 +67,7 @@
             // the others if this is a broad list of books
             tryInitialSelection(Defaults.getCommentary());
             tryInitialSelection(Defaults.getDictionary());
-            tryInitialSelection(Defaults.getBible());
+            tryInitialSelection(Defaults.getCurrentBible());
         }
     }
 

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/desktop/ViewSourcePane.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -88,7 +88,7 @@
                 buf.append(book.getRawText((Key) iter.next()));
             }
 
-            BookData bdata = book.getBookData(key);
+            BookData bdata = new BookData(book, key);
 
             BookMetaData bmd = book.getBookMetaData();
 

Modified: trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java
===================================================================
--- trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/bibledesktop/src/main/java/org/crosswire/bibledesktop/display/textpane/TextPaneBookDataDisplay.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -119,13 +119,7 @@
 
         try
         {
-            BookData bdata = book.getBookData(key);
-            if (bdata == null)
-            {
-                txtView.setText(""); //$NON-NLS-1$
-                return;
-            }
-
+            BookData bdata = new BookData(book, key);
             SAXEventProvider osissep = bdata.getSAXEventProvider();
             TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) converter.convert(osissep);
 

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/model/LinkArray.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/model/LinkArray.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/model/LinkArray.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -229,7 +229,7 @@
             for (int v=1; v<=BibleInfo.versesInChapter(b, c); v++)
             {
                 Verse find = new Verse(b, c, v);
-                BookData bdata = book.getBookData(find);
+                BookData bdata = new BookData(book, find);
                 String text = OSISUtil.getPlainText(bdata.getOsis());
                 PassageTally temp = (PassageTally) book.find(text);
                 temp.setOrdering(PassageTally.ORDER_TALLY);

Modified: trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/CliMapper.java
===================================================================
--- trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/CliMapper.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/biblemapper/src/main/java/org/crosswire/biblemapper/swing/CliMapper.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -102,7 +102,7 @@
                     for (int v=1; v<=BibleInfo.versesInChapter(b, c); v++)
                     {
                         Verse find = new Verse(b, c, v);
-                        BookData bdata = book.getBookData(find);
+                        BookData bdata = new BookData(book, find);
                         String text = OSISUtil.getPlainText(bdata.getOsis());
                         String quote = IndexSearcher.getPreferredSyntax(PhraseParamWord.class);
                         text = quote + text + quote;

Modified: trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java
===================================================================
--- trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/common/src/main/java/org/crosswire/common/config/AbstractReflectedChoice.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -99,11 +99,11 @@
         {
             try
             {
-                getter = clazz.getMethod("get" + propertyname, new Class[0]); //$NON-NLS-1$
+                getter = clazz.getMethod("is" + propertyname, new Class[0]); //$NON-NLS-1$
             }
             catch (NoSuchMethodException e)
             {
-                getter = clazz.getMethod("is" + propertyname, new Class[0]); //$NON-NLS-1$
+                getter = clazz.getMethod("get" + propertyname, new Class[0]); //$NON-NLS-1$
             }
         }
         catch (NoSuchMethodException ex)

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Book.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Book.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Book.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -63,15 +63,6 @@
     Iterator getOsisIterator(Key key, boolean allowEmpty) throws BookException;
 
     /**
-     * Return the BookData for the key.
-     * 
-     * @param key The item to locate
-     * @return The found Book data
-     * @throws BookException If anything goes wrong with this method
-     */
-    BookData getBookData(Key key);
-
-    /**
      * Returns the raw text that getData(Key key) builds into OSIS.
      * 
      * @param key The item to locate

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookData.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookData.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -31,7 +31,13 @@
 import org.jdom.Element;
 
 /**
- * Basic section of BookData.
+ * BookData is the assembler of the osis that is returned by the filters.
+ * As such it puts that into an OSIS document. When several books are
+ * supplied, it gets the data from each and puts it into a parallel or
+ * interlinear view.
+ * Note: it is critical that all the books are able to understand the same key.
+ * That does not mean that each has to have content for each key. Missing keys
+ * are represented by empty cells.
  * 
  * @see gnu.lgpl.License for license details.
  *      The copyright to this program is held by it's authors.
@@ -44,28 +50,52 @@
      */
     public BookData(Book book, Key key)
     {
-        this.book = book;
+        assert book != null;
+        assert key != null;
+
         this.key = key;
+
+        Book defaultBible = Defaults.getBible();
+        if (defaultBible != null &&
+            BookCategory.BIBLE.equals(book.getBookCategory()) &&
+            !defaultBible.equals(book)
+           )
+        {
+            books = new Book[2];
+            books[0] = defaultBible;
+            books[1] = book;
+        }
+        else
+        {
+            books = new Book[1];
+            books[0] = book;
+        }
     }
 
     /**
+     * Create BookData for multiple books.
+     */
+    public BookData(Book[] books, Key key)
+    {
+        assert books != null && books.length > 0;
+        assert key != null;
+
+        this.books = (Book[]) books.clone();
+        this.key = key;
+    }
+
+    /**
      * Accessor for the root OSIS element
      */
     public Element getOsis() throws BookException
     {
         if (osis == null)
         {
-            osis = OSISUtil.createOsisFramework(book.getBookMetaData());
+            // TODO(DMS): Determine the proper representation of the OSISWork name for multiple books.
+            osis = OSISUtil.createOsisFramework(books[0].getBookMetaData());
             Element text = osis.getChild(OSISUtil.OSIS_ELEMENT_OSISTEXT);
-            Element div = OSISUtil.factory().createDiv();
+            Element div = getOsisContent();
             text.addContent(div);
-
-            Iterator iter = book.getOsisIterator(key, false);
-            while (iter.hasNext())
-            {
-                Content content = (Content) iter.next();
-                div.addContent(content);
-            }
         }
 
         return osis;
@@ -97,13 +127,11 @@
      */
     public Book getBook()
     {
-        return book;
+        return books[0];
     }
 
     /**
-     * What key was used to create this data.
-     * It should be true that bookdata.getBook().getBookData(bookdata.getKey())
-     * equals (but not necessarily ==) the original bookdata.
+     * The key used to obtain data from one or more books.
      * @return Returns the key.
      */
     public Key getKey()
@@ -111,17 +139,79 @@
         return key;
     }
 
-    /**
-     * Who created this data
-     */
-    private Book book;
+    private Element getOsisContent() throws BookException
+    {
+        Element div = OSISUtil.factory().createDiv();
 
+        if (books.length == 1)
+        {
+            Iterator iter = books[0].getOsisIterator(key, false);
+            while (iter.hasNext())
+            {
+                Content content = (Content) iter.next();
+                div.addContent(content);
+            }
+        }
+        else
+        {
+            Iterator[] iters = new Iterator[books.length];
+            for (int i = 0; i < books.length; i++)
+            {
+                iters[i] = books[i].getOsisIterator(key, true);
+            }
+
+            Content content = null;
+            Element table = OSISUtil.factory().createTable();
+            Element row = null;
+            Element cell = null;
+            int cellCount = 0;
+            int rowCount = 0;
+            while (true)
+            {
+                cellCount = 0;
+
+                row = OSISUtil.factory().createRow();
+
+                for (int i = 0; i < iters.length; i++)
+                {
+                    cell = OSISUtil.factory().createCell();
+                    row.addContent(cell);
+                    if (iters[i].hasNext())
+                    {
+                        content = (Content) iters[i].next();
+                        cell.addContent(content);
+                        cellCount++;
+                    }
+                }
+
+                if (cellCount == 0)
+                {
+                    break;
+                }
+
+                table.addContent(row);
+                rowCount++;
+            }
+            if (rowCount > 0)
+            {
+                div.addContent(table);
+            }
+        }
+
+        return div;
+    }
+
     /**
      * What key was used to create this data
      */
     private Key key;
 
     /**
+     * The books to which the key should be applied.
+     */
+    private Book[] books;
+
+    /**
      * The complete osis container for the element
      */
     private Element osis;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -50,7 +50,7 @@
      */
     public static boolean isCurrentBible()
     {
-        return currentBible;
+        return trackBible;
     }
 
     /**
@@ -60,7 +60,7 @@
      */
     public static void setCurrentBible(boolean current)
     {
-        currentBible = current;
+        trackBible = current;
     }
 
     /**
@@ -73,10 +73,19 @@
         BookCategory type = book.getBookCategory();
         if (type.equals(BookCategory.BIBLE) && isCurrentBible())
         {
-            setBible(book);
+            currentBible = book;
         }
     }
 
+    public static Book getCurrentBible()
+    {
+        if (currentBible == null)
+        {
+            return bibleDeft.getDefault();
+        }
+        return currentBible;
+    }
+
     /* (non-Javadoc)
      * @see org.crosswire.jsword.book.DefaultBook#setDefault(org.crosswire.jsword.book.Book)
      */
@@ -566,9 +575,14 @@
     /**
      * Indicates whether the last book of each type is used next time.
      */
-    private static boolean currentBible = true;
+    private static boolean trackBible = true;
 
     /**
+     * The current bible being tracked.
+     */
+    private static Book currentBible = null;
+
+    /**
      * The default Bible
      */
     private static DefaultBook bibleDeft = new DefaultBook(Books.installed(), BookFilters.getOnlyBibles());

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractBook.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -28,7 +28,6 @@
 import org.crosswire.common.activate.Lock;
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookCategory;
-import org.crosswire.jsword.book.BookData;
 import org.crosswire.jsword.book.BookDriver;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.book.BookMetaData;
@@ -83,16 +82,6 @@
     }
 
     /* (non-Javadoc)
-     * @see org.crosswire.jsword.book.Book#getData(org.crosswire.jsword.passage.Key)
-     */
-    public BookData getBookData(Key key)
-    {
-        assert key != null;
-
-        return new BookData(this, key);
-    }
-
-    /* (non-Javadoc)
      * @see org.crosswire.common.activate.Activatable#deactivate(org.crosswire.common.activate.Lock)
      */
     public void deactivate(Lock lock)

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -108,16 +108,6 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.crosswire.jsword.book.Book#getData(org.crosswire.jsword.passage.Key)
-     */
-    public BookData getBookData(Key key)
-    {
-        assert key != null;
-
-        return new BookData(this, key);
-    }
-
     /**
      * Add the OSIS elements to the div element. Note, this assumes that
      * the data is fully marked up.

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -81,7 +81,7 @@
         Book bible = books.getBook(BIBLE_NAME);
 
         Key key = bible.getKey("Gen 1 1"); //$NON-NLS-1$
-        BookData data = bible.getBookData(key);
+        BookData data = new BookData(bible, key);
         String text = OSISUtil.getCanonicalText(data.getOsis());
 
         System.out.println("The plain text of Gen 1:1 is " + text); //$NON-NLS-1$
@@ -99,7 +99,7 @@
         Book bible = Books.installed().getBook(BIBLE_NAME);
 
         Key key = bible.getKey("Gen 1 1"); //$NON-NLS-1$
-        BookData data = bible.getBookData(key);
+        BookData data = new BookData(bible, key);
         SAXEventProvider osissep = data.getSAXEventProvider();
 
         Converter styler = ConverterFactory.getConverter();
@@ -139,7 +139,7 @@
 
         System.out.println("The first Key in the default dictionary is " + first); //$NON-NLS-1$
 
-        BookData data = dict.getBookData(keys);
+        BookData data = new BookData(dict, keys);
         System.out.println("And the text against that key is " + OSISUtil.getPlainText(data.getOsis())); //$NON-NLS-1$
     }
 
@@ -225,7 +225,7 @@
         while (rangeIter.hasNext())
         {
             Key range = (Key) rangeIter.next();
-            BookData data = bible.getBookData(range);
+            BookData data = new BookData(bible, range);
             SAXEventProvider osissep = data.getSAXEventProvider();
             SAXEventProvider htmlsep = new TransformingSAXEventProvider(NetUtil.toURI(xslurl), osissep);
             String text = XMLUtil.writeToString(htmlsep);
@@ -248,7 +248,7 @@
         while (iter.hasNext())
         {
             Verse verse = (Verse) iter.next();
-            BookData data = bible.getBookData(verse);
+            BookData data = new BookData(bible, verse);
             System.out.println('|' + BibleInfo.getBookName(verse.getBook()) + '|' + verse.getChapter() + '|' + verse.getVerse() + '|' + OSISUtil.getCanonicalText(data.getOsis()));
         }
     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -78,7 +78,7 @@
         while (iter.hasNext())
         {
             Key key = (Key) iter.next();
-            BookData bdata = book.getBookData(key);
+            BookData bdata = new BookData(book, key);
             SAXEventProvider osissep = bdata.getSAXEventProvider();
             try
             {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -364,7 +364,7 @@
             }
             else
             {
-                data = book.getBookData(subkey);
+                data = new BookData(book, subkey);
                 osis = null;
 
                 try

Modified: trunk/jsword/src/test/java/org/crosswire/jsword/book/BooksTest.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/jsword/book/BooksTest.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/test/java/org/crosswire/jsword/book/BooksTest.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -132,7 +132,7 @@
         {
             Book bible = bibles[i];
             Key key = bible.getKey("Gen 1:1"); //$NON-NLS-1$
-            BookData data = bible.getBookData(key);
+            BookData data = new BookData(bible, key);
             assertNotNull(data);
         }
     }
@@ -142,8 +142,8 @@
         for (int i = 0; i < bibles.length; i++)
         {
             Book bible = bibles[i];
-            BookData data = bible.getBookData(gen11[i]);
-            assertNotNull(data);
+            BookData data = new BookData(bible, gen11[i]);
+            assertNotNull(data.getOsis());
         }
     }
 

Modified: trunk/jsword/src/test/java/org/crosswire/jsword/book/ReadEverything.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/jsword/book/ReadEverything.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/test/java/org/crosswire/jsword/book/ReadEverything.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -134,7 +134,7 @@
         {
             //log.debug("reading: "+bmd.getInitials()+"/"+key.getText());
 
-            BookData data = book.getBookData(key);
+            BookData data = new BookData(book, key);
             if (data.getOsis() == null)
             {
                 log.warn("No output from: "+book.getInitials()+", "+key.getName()); //$NON-NLS-1$ //$NON-NLS-2$

Modified: trunk/jsword/src/test/java/org/crosswire/jsword/book/test/Speed.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/jsword/book/test/Speed.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword/src/test/java/org/crosswire/jsword/book/test/Speed.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -23,6 +23,7 @@
 
 import org.crosswire.common.util.Reporter;
 import org.crosswire.jsword.book.Book;
+import org.crosswire.jsword.book.BookData;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.passage.Key;
 import org.crosswire.jsword.passage.KeyUtil;
@@ -116,7 +117,7 @@
      */
     private void dummyDisplay(Passage ref) throws BookException
     {
-        book.getBookData(ref).getOsis();
+        new BookData(book, ref).getOsis();
     }
 
     /**

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBBookDataDisplay.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBBookDataDisplay.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBBookDataDisplay.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -86,12 +86,7 @@
 //            boolean direction = bmd.isLeftToRight();
 //            txtView.applyComponentOrientation(direction ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT);
 
-            BookData bdata = book.getBookData(key);
-            if (bdata == null)
-            {
-//                txtView.setURI();
-                return;
-            }
+//            BookData bdata = new BookData(book, key);
 
 //            txtView.setURI(JDTBURLConnection.createURL(book, key));
         }

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/display/jdtb/JDTBURLConnection.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -82,7 +82,7 @@
     {
         try
         {
-            BookData data = book.getBookData(key);
+            BookData data = new BookData(book, key);
             BookMetaData bmd = book.getBookMetaData();
             boolean direction = bmd.isLeftToRight();
 

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/passage/PassageListCellRenderer.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/passage/PassageListCellRenderer.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/bibledesktop/passage/PassageListCellRenderer.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -89,7 +89,7 @@
 
                 if (text == null)
                 {
-                    BookData bdata = bible.getBookData(range);
+                    BookData bdata = new BookData(bible, range);
                     String simple = OSISUtil.getCanonicalText(bdata.getOsis());
                     text = "<html><b>" + range.getName() + "</b> " + simple; //$NON-NLS-1$ //$NON-NLS-2$
                     hash.put(range, text);

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/StudyTool.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/StudyTool.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/StudyTool.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -50,7 +50,7 @@
     public Collection getTranslations(Book bible, String word) throws BookException
     {
         Key key = bible.find(new DefaultSearchRequest(word, null));
-        BookData data = bible.getBookData(key);
+        BookData data = new BookData(bible, key);
 
         Map reply = new HashMap();
 
@@ -106,7 +106,7 @@
     public Collection getTranslations(Book bible, Strongs number) throws BookException
     {
         Key key = bible.find(new DefaultSearchRequest(number.getOLBName(), null));
-        BookData data = bible.getBookData(key);
+        BookData data = new BookData(bible, key);
 
         Map reply = new HashMap();
 

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/Verifier.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/Verifier.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/basic/Verifier.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -123,8 +123,8 @@
                 try
                 {
                     // Read the document from the first bible
-                    BookData text1 = book1.getBookData(subkey);
-                    BookData text2 = book2.getBookData(subkey);
+                    BookData text1 = new BookData(book1, subkey);
+                    BookData text2 = new BookData(book2, subkey);
 
                     // Check - this needs some work
                     if (!text1.equals(text2))

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoter.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoter.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/remote/LocalRemoter.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -77,7 +77,7 @@
                 Book book = lookupBook(uid);
                 String refstr = method.getParameter(ParamName.PARAM_PASSAGE);
                 Key ref = book.getKey(refstr);
-                BookData data = book.getBookData(ref);
+                BookData data = new BookData(book, ref);
 
                 SAXEventProvider provider = data.getSAXEventProvider();
                 SAXHandler handler = new SAXHandler();

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/ser/SerIndex.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/ser/SerIndex.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/book/search/ser/SerIndex.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -274,7 +274,7 @@
             }
             else
             {
-                BookData data = book.getBookData(sublist);
+                BookData data = new BookData(book, sublist);
                 String text = OSISUtil.getPlainText(data.getOsis());
 
                 String[] words = SentenceUtil.getWords(text);

Modified: trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java
===================================================================
--- trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java	2007-05-18 19:43:29 UTC (rev 1333)
+++ trunk/jsword-limbo/src/main/java/org/crosswire/jsword/view/web/DemoServlet.java	2007-05-19 14:09:10 UTC (rev 1334)
@@ -103,7 +103,7 @@
                     request.setAttribute("next-overview", waiting.getOverview()); //$NON-NLS-1$
                 }
 
-                BookData data = book.getBookData(ref);
+                BookData data = new BookData(book, ref);
                 SAXEventProvider osissep = data.getSAXEventProvider();
                 SAXEventProvider htmlsep = style.convert(osissep);
                 String text = XMLUtil.writeToString(htmlsep);




More information about the jsword-svn mailing list