[jsword-svn] bibledesktop/java/limbo/org/crosswire/bibledesktop/reference s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Fri Mar 18 18:57:11 MST 2005


Update of /cvs/jsword/bibledesktop/java/limbo/org/crosswire/bibledesktop/reference
In directory www.crosswire.org:/tmp/cvs-serv10766/java/limbo/org/crosswire/bibledesktop/reference

Modified Files:
	ReferencedPane.java ReferenceRootTreeNode.java 
	ReferenceBookTreeNode.java ReferenceKeyTreeNode.java 
Log Message:
Made Book the primary interface to a module and put BookMetaData within it. All of BookMetaData is accessible through the Book interface.

Index: ReferencedPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/limbo/org/crosswire/bibledesktop/reference/ReferencedPane.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ReferencedPane.java	6 Mar 2005 04:55:44 -0000	1.7
--- ReferencedPane.java	19 Mar 2005 01:57:08 -0000	1.8
***************
*** 31,35 ****
  import org.crosswire.jsword.book.BookFilter;
  import org.crosswire.jsword.book.BookFilters;
- import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.passage.Key;
  import org.crosswire.jsword.passage.NoSuchKeyException;
--- 31,34 ----
***************
*** 242,251 ****
          for (Iterator it = Books.getBooks(filter).iterator(); it.hasNext();)
          {
!             BookMetaData dmd = (BookMetaData) it.next();
!             Book tempdict = dmd.getBook();
              try
              {
!                 Key key = tempdict.getKey(data);
!                 lstdicts.setSelectedValue(tempdict, true);
                  lstentries.setSelectedValue(key, true);
                  return;
--- 241,249 ----
          for (Iterator it = Books.getBooks(filter).iterator(); it.hasNext();)
          {
!             Book book = (Book) it.next();
              try
              {
!                 Key key = book.getKey(data);
!                 lstdicts.setSelectedValue(book, true);
                  lstentries.setSelectedValue(key, true);
                  return;
***************
*** 264,269 ****
      {
          Object selected = tblBooks.getSelectedValue();
!         BookMetaData bmd = (BookMetaData) selected;
!         book = bmd.getBook();
          Key set = book.getGlobalKeyList();
  
--- 262,266 ----
      {
          Object selected = tblBooks.getSelectedValue();
!         book = (Book) selected;
          Key set = book.getGlobalKeyList();
  

Index: ReferenceRootTreeNode.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/limbo/org/crosswire/bibledesktop/reference/ReferenceRootTreeNode.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ReferenceRootTreeNode.java	25 Jun 2004 14:21:34 -0000	1.1
--- ReferenceRootTreeNode.java	19 Mar 2005 01:57:08 -0000	1.2
***************
*** 11,15 ****
  import org.crosswire.jsword.book.Book;
  import org.crosswire.jsword.book.BookFilter;
- import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.book.Books;
  import org.crosswire.jsword.book.BooksEvent;
--- 11,14 ----
***************
*** 51,55 ****
  
          this.filter = null;
!         books = Books.installed().getBookMetaDatas();
      }
  
--- 50,54 ----
  
          this.filter = null;
!         books = Books.installed().getBooks();
      }
  
***************
*** 63,67 ****
  
          this.filter = filter;
!         books = Books.installed().getBookMetaDatas(filter);
      }
  
--- 62,66 ----
  
          this.filter = filter;
!         books = Books.installed().getBooks(filter);
      }
  
***************
*** 80,84 ****
      {
          this.filter = filter;
!         books = Books.installed().getBookMetaDatas(filter);
  
          model.fireTreeStructureChanged(filter, new Object[] { this }, new int[0], null);
--- 79,83 ----
      {
          this.filter = filter;
!         books = Books.installed().getBooks(filter);
  
          model.fireTreeStructureChanged(filter, new Object[] { this }, new int[0], null);
***************
*** 130,135 ****
      public TreeNode getChildAt(int childIndex)
      {
!         BookMetaData bmd = (BookMetaData) books.get(childIndex);
!         return new ReferenceBookTreeNode(model, this, bmd);
      }
  
--- 129,134 ----
      public TreeNode getChildAt(int childIndex)
      {
!         Book book = (Book) books.get(childIndex);
!         return new ReferenceBookTreeNode(model, this, book);
      }
  
***************
*** 140,145 ****
      {
          ReferenceBookTreeNode refnode = (ReferenceBookTreeNode) node;
!         BookMetaData bmd = refnode.getBookMetaData();
!         Book book = bmd.getBook();
          return books.indexOf(book);
      }
--- 139,143 ----
      {
          ReferenceBookTreeNode refnode = (ReferenceBookTreeNode) node;
!         Book book = refnode.getBook();
          return books.indexOf(book);
      }
***************
*** 175,183 ****
          public void bookAdded(BooksEvent ev)
          {
!             BookMetaData bmd = ev.getBookMetaData();
  
!             if (filter.test(bmd))
              {
!                 boolean changed = books.add(bmd);
                  if (!changed)
                  {
--- 173,181 ----
          public void bookAdded(BooksEvent ev)
          {
!             Book book = ev.getBook();
  
!             if (filter.test(book))
              {
!                 boolean changed = books.add(book);
                  if (!changed)
                  {
***************
*** 192,200 ****
          public void bookRemoved(BooksEvent ev)
          {
!             BookMetaData bmd = ev.getBookMetaData();
  
!             if (filter.test(bmd))
              {
!                 boolean changed = books.remove(bmd);
                  if (!changed)
                  {
--- 190,198 ----
          public void bookRemoved(BooksEvent ev)
          {
!             Book book = ev.getBook();
  
!             if (filter.test(book))
              {
!                 boolean changed = books.remove(book);
                  if (!changed)
                  {

Index: ReferenceBookTreeNode.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/limbo/org/crosswire/bibledesktop/reference/ReferenceBookTreeNode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ReferenceBookTreeNode.java	27 Jul 2004 21:41:32 -0000	1.2
--- ReferenceBookTreeNode.java	19 Mar 2005 01:57:08 -0000	1.3
***************
*** 6,10 ****
  
  import org.crosswire.common.util.IteratorEnumeration;
! import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.passage.Key;
  
--- 6,10 ----
  
  import org.crosswire.common.util.IteratorEnumeration;
! import org.crosswire.jsword.book.Book;
  import org.crosswire.jsword.passage.Key;
  
***************
*** 38,47 ****
       * Simple ctor
       */
!     public ReferenceBookTreeNode(ReferenceTreeModel model, TreeNode parent, BookMetaData bmd)
      {
          this.model = model;
          this.parent = parent;
!         this.bmd = bmd;
!         this.keys = bmd.getBook().getGlobalKeyList();
      }
  
--- 38,47 ----
       * Simple ctor
       */
!     public ReferenceBookTreeNode(ReferenceTreeModel model, TreeNode parent, Book book)
      {
          this.model = model;
          this.parent = parent;
!         this.book = book;
!         this.keys = book.getGlobalKeyList();
      }
  
***************
*** 49,57 ****
       * Simple ctor
       */
!     public ReferenceBookTreeNode(ReferenceTreeModel model, TreeNode parent, BookMetaData bmd, Key keys)
      {
          this.model = model;
          this.parent = parent;
!         this.bmd = bmd;
          this.keys = keys;
      }
--- 49,57 ----
       * Simple ctor
       */
!     public ReferenceBookTreeNode(ReferenceTreeModel model, TreeNode parent, Book book, Key keys)
      {
          this.model = model;
          this.parent = parent;
!         this.book = book;
          this.keys = keys;
      }
***************
*** 62,66 ****
      public String toString()
      {
!         return bmd.getName();
      }
  
--- 62,66 ----
      public String toString()
      {
!         return book.getBookMetaData().getName();
      }
  
***************
*** 111,115 ****
      {
          Key key = keys.get(childIndex);
!         return new ReferenceKeyTreeNode(model, bmd, this, key);
      }
  
--- 111,115 ----
      {
          Key key = keys.get(childIndex);
!         return new ReferenceKeyTreeNode(model, book, this, key);
      }
  
***************
*** 125,133 ****
  
      /**
!      * The BookMetaData object that we are wrapping
       */
!     public BookMetaData getBookMetaData()
      {
!         return bmd;
      }
  
--- 125,133 ----
  
      /**
!      * The Book object that we are wrapping
       */
!     public Book getBook()
      {
!         return book;
      }
  
***************
*** 167,170 ****
       * The book that we are representing
       */
!     private BookMetaData bmd;
  }
\ No newline at end of file
--- 167,170 ----
       * The book that we are representing
       */
!     private Book book;
  }
\ No newline at end of file

Index: ReferenceKeyTreeNode.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/limbo/org/crosswire/bibledesktop/reference/ReferenceKeyTreeNode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ReferenceKeyTreeNode.java	27 Jul 2004 21:41:32 -0000	1.2
--- ReferenceKeyTreeNode.java	19 Mar 2005 01:57:08 -0000	1.3
***************
*** 5,9 ****
  import javax.swing.tree.TreeNode;
  
! import org.crosswire.jsword.book.BookMetaData;
  import org.crosswire.jsword.passage.Key;
  
--- 5,9 ----
  import javax.swing.tree.TreeNode;
  
! import org.crosswire.jsword.book.Book;
  import org.crosswire.jsword.passage.Key;
  
***************
*** 37,49 ****
       * Simple ctor
       */
!     public ReferenceKeyTreeNode(ReferenceTreeModel model, BookMetaData bmd, TreeNode parent, Key key)
      {
          this.model = model;
!         this.bmd = bmd;
          this.parent = parent;
          this.key = key;
  
          // NOWARN: this just shuts eclipse up - remove it later.
!         this.bmd.hashCode();
          this.model.hashCode();
      }
--- 37,49 ----
       * Simple ctor
       */
!     public ReferenceKeyTreeNode(ReferenceTreeModel model, Book book, TreeNode parent, Key key)
      {
          this.model = model;
!         this.book = book;
          this.parent = parent;
          this.key = key;
  
          // NOWARN: this just shuts eclipse up - remove it later.
!         this.book.hashCode();
          this.model.hashCode();
      }
***************
*** 122,126 ****
  
      private ReferenceTreeModel model;
!     private BookMetaData bmd;
      private TreeNode parent;
      private Key key;
--- 122,126 ----
  
      private ReferenceTreeModel model;
!     private Book book;
      private TreeNode parent;
      private Key key;



More information about the jsword-svn mailing list