[jsword-svn] bibledesktop/java/main/org/crosswire/bibledesktop/book s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun May 8 18:28:31 MST 2005


Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book
In directory www.crosswire.org:/tmp/cvs-serv5786/java/main/org/crosswire/bibledesktop/book

Modified Files:
	DisplaySelectPane.java DictionaryPane.java 
	AdvancedSearchPane.java BooksListModel.java 
	BooksComboBoxModel.java PassageSelectionPane.java 
	BibleComboBoxModel.java BibleViewPane.java 
	DisplaySelectEvent.java 
Removed Files:
	CommentaryPane.java SidebarPane.java 
Log Message:
Moved unused code to limbo.
Upgraded support-tools: checkstyle, pmd and findbugs to most recent.
Addressed over 100 issues reported by findbugs and checkstyle.
Resulted in major refactoring of GBFFilter.
Net result is that code size is significantly smaller.

Index: AdvancedSearchPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/AdvancedSearchPane.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AdvancedSearchPane.java	2 May 2005 01:29:24 -0000	1.8
--- AdvancedSearchPane.java	9 May 2005 01:28:29 -0000	1.9
***************
*** 658,662 ****
       * The ActionFactory holding the actions used by this Component.
       */
!     private ActionFactory actions;
  
      /**
--- 658,662 ----
       * The ActionFactory holding the actions used by this Component.
       */
!     private transient ActionFactory actions;
  
      /**

Index: BooksListModel.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/BooksListModel.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** BooksListModel.java	19 Mar 2005 18:45:12 -0000	1.9
--- BooksListModel.java	9 May 2005 01:28:29 -0000	1.10
***************
*** 75,79 ****
       * @see javax.swing.ListModel#getSize()
       */
!     public int getSize()
      {
          return books.size();
--- 75,79 ----
       * @see javax.swing.ListModel#getSize()
       */
!     public synchronized int getSize()
      {
          return books.size();
***************
*** 110,114 ****
      public void setFilter(BookFilter filter)
      {
!         this.filter = filter;
          cacheData();
  
--- 110,117 ----
      public void setFilter(BookFilter filter)
      {
!         synchronized (this)
!         {
!             this.filter = filter;
!         }
          cacheData();
  
***************
*** 189,203 ****
       * The list of books in this tree
       */
!     private BookList bookList;
  
      /**
       * The filter used to choose Bibles
       */
!     private BookFilter filter;
  
      /**
       * The listener
       */
!     private CustomListDataListener listener = new CustomListDataListener();
  
      /**
--- 192,206 ----
       * The list of books in this tree
       */
!     private transient BookList bookList;
  
      /**
       * The filter used to choose Bibles
       */
!     private transient BookFilter filter;
  
      /**
       * The listener
       */
!     private transient CustomListDataListener listener = new CustomListDataListener();
  
      /**

Index: DisplaySelectPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** DisplaySelectPane.java	3 May 2005 02:21:23 -0000	1.32
--- DisplaySelectPane.java	9 May 2005 01:28:29 -0000	1.33
***************
*** 113,116 ****
--- 113,119 ----
          cboBible.addItemListener(new ItemListener()
          {
+             /* (non-Javadoc)
+              * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
+              */
              public void itemStateChanged(ItemEvent ev)
              {
***************
*** 123,137 ****
              }
          });
!         cboBible.addActionListener(new ActionListener()
!         {
!             public void actionPerformed(ActionEvent e)
!             {
!                 JComboBox cbo = (JComboBox) e.getSource();
!                 if (cbo.getSelectedIndex() == -1 && cbo.getItemCount() > 0)
!                 {
!                     cbo.setSelectedIndex(0);
!                 }
!             }
!         });
          JLabel lblBible = actions.createJLabel(BIBLE);
          lblBible.setLabelFor(cboBible);
--- 126,130 ----
              }
          });
!         cboBible.addActionListener(new SelectedActionListener());
          JLabel lblBible = actions.createJLabel(BIBLE);
          lblBible.setLabelFor(cboBible);
***************
*** 294,298 ****
                  tally.setOrdering(PassageTally.ORDER_TALLY);
                  int rankCount = getNumRankedVerses();
!                 if (rankCount > 0 && rankCount < total )
                  {
                      tally.trimRanges(rankCount, RestrictionType.NONE);
--- 287,291 ----
                  tally.setOrdering(PassageTally.ORDER_TALLY);
                  int rankCount = getNumRankedVerses();
!                 if (rankCount > 0 && rankCount < total)
                  {
                      tally.trimRanges(rankCount, RestrictionType.NONE);
***************
*** 720,723 ****
--- 713,734 ----
      }
  
+     /**
+      *
+      */
+     private static final class SelectedActionListener implements ActionListener
+     {
+         /* (non-Javadoc)
+          * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+          */
+         public void actionPerformed(ActionEvent e)
+         {
+             JComboBox cbo = (JComboBox) e.getSource();
+             if (cbo.getSelectedIndex() == -1 && cbo.getItemCount() > 0)
+             {
+                 cbo.setSelectedIndex(0);
+             }
+         }
+     }
+ 
      // For the Passage card
      private static final String VIEW_LABEL = "ViewLabel"; //$NON-NLS-1$
***************
*** 743,749 ****
      private QuickHelpDialog dlgHelp;
  
!     private ActionFactory actions;
  
!     private Book selected;
  
      /*
--- 754,760 ----
      private QuickHelpDialog dlgHelp;
  
!     private transient ActionFactory actions;
  
!     private transient Book selected;
  
      /*

Index: BooksComboBoxModel.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/BooksComboBoxModel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** BooksComboBoxModel.java	19 Mar 2005 01:57:09 -0000	1.7
--- BooksComboBoxModel.java	9 May 2005 01:28:29 -0000	1.8
***************
*** 140,144 ****
       * The currently selected version
       */
!     protected Book current;
  
      /**
--- 140,144 ----
       * The currently selected version
       */
!     protected transient Book current;
  
      /**

--- SidebarPane.java DELETED ---

Index: DisplaySelectEvent.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectEvent.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DisplaySelectEvent.java	6 Mar 2005 20:21:36 -0000	1.6
--- DisplaySelectEvent.java	9 May 2005 01:28:29 -0000	1.7
***************
*** 72,76 ****
       * The new Book
       */
!     private Book book;
  
      /**
--- 72,76 ----
       * The new Book
       */
!     private transient Book book;
  
      /**

Index: PassageSelectionPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/PassageSelectionPane.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** PassageSelectionPane.java	5 Apr 2005 00:33:30 -0000	1.17
--- PassageSelectionPane.java	9 May 2005 01:28:29 -0000	1.18
***************
*** 392,396 ****
       * To convert strings into Biblical keys
       */
!     protected KeyFactory keyf = PassageKeyFactory.instance();
  
      /**
--- 392,396 ----
       * To convert strings into Biblical keys
       */
!     protected transient KeyFactory keyf = PassageKeyFactory.instance();
  
      /**
***************
*** 412,422 ****
       * The ActionFactory holding the actions used by this Component.
       */
!     private ActionFactory actions;
  
      /*
       * GUI Components
       */
!     private Icon icoGood;
!     private Icon icoBad;
      private JTree treAll;
      private JList lstSel;
--- 412,422 ----
       * The ActionFactory holding the actions used by this Component.
       */
!     private transient ActionFactory actions;
  
      /*
       * GUI Components
       */
!     private transient Icon icoGood;
!     private transient Icon icoBad;
      private JTree treAll;
      private JList lstSel;

Index: BibleViewPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/BibleViewPane.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** BibleViewPane.java	5 Apr 2005 00:33:30 -0000	1.14
--- BibleViewPane.java	9 May 2005 01:28:29 -0000	1.15
***************
*** 188,203 ****
          assert saved != null;
  
!         Writer out = new FileWriter(saved);
!         if (key instanceof Passage)
          {
!             Passage ref = (Passage) key;
!             ref.writeDescription(out);
          }
!         else
          {
!             out.write(key.getName());
!             out.write("\n"); //$NON-NLS-1$
          }
-         out.close();
      }
  
--- 188,213 ----
          assert saved != null;
  
!         Writer out = null;
!         try
          {
!             out = new FileWriter(saved);
!             if (key instanceof Passage)
!             {
!                 Passage ref = (Passage) key;
!                 ref.writeDescription(out);
!             }
!             else
!             {
!                 out.write(key.getName());
!                 out.write("\n"); //$NON-NLS-1$
!             }
          }
!         finally
          {
!             if (out != null)
!             {
!                 out.close();
!             }
          }
      }
  
***************
*** 212,215 ****
--- 222,227 ----
      /**
       * Open a saved verse list form disk
+      * @throws IOException 
+      * @throws NoSuchVerseException
       */
      public void open() throws NoSuchVerseException, IOException
***************
*** 225,232 ****
              }
  
!             Reader in = new FileReader(saved);
!             Passage ref = PassageKeyFactory.readPassage(in);
!             setKey(ref);
!             in.close();
          }
      }
--- 237,254 ----
              }
  
!             Reader in = null;
!             try
!             {
!                 in = new FileReader(saved);
!                 Passage ref = PassageKeyFactory.readPassage(in);
!                 setKey(ref);
!             }
!             finally
!             {
!                 if (in != null)
!                 {
!                     in.close();
!                 }
!             }
          }
      }

--- CommentaryPane.java DELETED ---

Index: BibleComboBoxModel.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/BibleComboBoxModel.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** BibleComboBoxModel.java	6 Mar 2005 20:21:36 -0000	1.7
--- BibleComboBoxModel.java	9 May 2005 01:28:29 -0000	1.8
***************
*** 268,272 ****
       * Shared settings
       */
!     private BibleComboBoxModelSet set;
  
      /**
--- 268,272 ----
       * Shared settings
       */
!     private transient BibleComboBoxModelSet set;
  
      /**

Index: DictionaryPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DictionaryPane.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** DictionaryPane.java	6 Apr 2005 23:35:56 -0000	1.18
--- DictionaryPane.java	9 May 2005 01:28:29 -0000	1.19
***************
*** 360,368 ****
      private BookDataDisplay display = BookDataDisplayFactory.createBookDataDisplay();
  
!     private BookFilter filter = BookFilters.either(BookFilters.getDictionaries(), BookFilters.getCommentaries());
      private BooksComboBoxModel mdlDicts = new BooksComboBoxModel(filter);
!     private Book dict;
  
!     protected BibleComboBoxModelSet set = new BibleComboBoxModelSet();
      private JComboBox cboBooks = new JComboBox();
      private JComboBox cboChaps = new JComboBox();
--- 360,368 ----
      private BookDataDisplay display = BookDataDisplayFactory.createBookDataDisplay();
  
!     private transient BookFilter filter = BookFilters.either(BookFilters.getDictionaries(), BookFilters.getCommentaries());
      private BooksComboBoxModel mdlDicts = new BooksComboBoxModel(filter);
!     private transient Book dict;
  
!     protected transient BibleComboBoxModelSet set = new BibleComboBoxModelSet();
      private JComboBox cboBooks = new JComboBox();
      private JComboBox cboChaps = new JComboBox();



More information about the jsword-svn mailing list