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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Thu Jan 5 16:17:33 MST 2006


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

Modified Files:
	DictionaryPane.java 
Log Message:
Added the ability to hide the border of a split pane's divider.

Index: DictionaryPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DictionaryPane.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** DictionaryPane.java	3 Jan 2006 13:25:46 -0000	1.27
--- DictionaryPane.java	5 Jan 2006 23:17:31 -0000	1.28
***************
*** 23,27 ****
  
  import java.awt.Component;
- import java.awt.Dimension;
  import java.awt.FlowLayout;
  import java.awt.event.ActionEvent;
--- 23,26 ----
***************
*** 61,64 ****
--- 60,64 ----
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
+  * @author DM Smith [dmsmith555 at yahoo dot com]
   */
  public class DictionaryPane extends JSplitPane implements BookDataDisplay
***************
*** 80,83 ****
--- 80,94 ----
      private void init()
      {
+         display = BookDataDisplayFactory.createBookDataDisplay();
+ 
+         BookFilter filter =
+             BookFilters.either(
+                                BookFilters.either(BookFilters.getDictionaries(),
+                                                   BookFilters.getCommentaries()),
+                                BookFilters.getDailyDevotionals()
+                                );
+         BooksComboBoxModel mdlDicts = new BooksComboBoxModel(filter);
+ 
+         lstDicts = new JList();
          lstDicts.setVisibleRowCount(6);
          lstDicts.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
***************
*** 97,102 ****
--- 108,119 ----
              }
          });
+ 
+         JScrollPane scrDicts = new JScrollPane();
          scrDicts.setViewportView(lstDicts);
  
+         set = new BibleComboBoxModelSet();
+         JComboBox cboBooks = new JComboBox();
+         JComboBox cboChaps = new JComboBox();
+         JComboBox cboVerse = new JComboBox();
          set.setBookComboBox(cboBooks);
          set.setChapterComboBox(cboChaps);
***************
*** 114,117 ****
--- 131,135 ----
          cboVerse.setToolTipText(Msg.SELECT_VERSE.toString());
  
+         pnlSelect = new JPanel();
          pnlSelect.setLayout(new FlowLayout());
          pnlSelect.add(cboBooks, null);
***************
*** 119,122 ****
--- 137,141 ----
          pnlSelect.add(cboVerse, null);
  
+         lstEntries = new JList();
          lstEntries.addListSelectionListener(new ListSelectionListener()
          {
***************
*** 126,133 ****
--- 145,155 ----
              }
          });
+         scrEntries = new JScrollPane();
          scrEntries.setViewportView(lstEntries);
  
+         JScrollPane scrDisplay = new JScrollPane();
          scrDisplay.setViewportView(display.getComponent());
  
+         sptMain = new FixedSplitPane(false);
          sptMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
          // Make the top 20% of the total
***************
*** 135,147 ****
          sptMain.setTopComponent(new JPanel());
          sptMain.setBottomComponent(scrDisplay);
-         sptMain.setBorder(null);
  
!         Object sptMainUI = sptMain.getUI();
!         if (sptMainUI instanceof javax.swing.plaf.basic.BasicSplitPaneUI)
!         {
!             ((javax.swing.plaf.basic.BasicSplitPaneUI) sptMainUI).getDivider().setBorder(null);
!         }
! 
!         this.setMinimumSize(new Dimension(0, 0));
          this.setOrientation(JSplitPane.VERTICAL_SPLIT);
          this.setTopComponent(scrDicts);
--- 157,163 ----
          sptMain.setTopComponent(new JPanel());
          sptMain.setBottomComponent(scrDisplay);
  
! //        this.setResizeWeight(0.1D);
! //        this.setMinimumSize(new Dimension(0, 0));
          this.setOrientation(JSplitPane.VERTICAL_SPLIT);
          this.setTopComponent(scrDicts);
***************
*** 303,306 ****
--- 319,324 ----
              Book book = (Book) selected;
              BookCategory category = book.getBookCategory();
+             //divider snaps back to its starting point when a new component is set
+             int dividerLocation = sptMain.getDividerLocation();
              if (category.equals(BookCategory.DICTIONARY)
                  || category.equals(BookCategory.GLOSSARY)
***************
*** 320,324 ****
                      lstEntries.setSelectedValue(prefkey, true);
                  }
- 
                  sptMain.setTopComponent(scrEntries);
              }
--- 338,341 ----
***************
*** 328,331 ****
--- 345,349 ----
                  sptMain.setTopComponent(pnlSelect);
              }
+             sptMain.setDividerLocation(dividerLocation);
          }
      }
***************
*** 376,401 ****
       * The display of OSIS data
       */
!     private BookDataDisplay display = BookDataDisplayFactory.createBookDataDisplay();
! 
!     private transient BookFilter filter =
!         BookFilters.either(
!                            BookFilters.either(BookFilters.getDictionaries(),
!                                               BookFilters.getCommentaries()),
!                            BookFilters.getDailyDevotionals()
!                            );
!     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();
!     private JComboBox cboVerse = new JComboBox();
!     private JPanel pnlSelect = new JPanel();
!     private JScrollPane scrDicts = new JScrollPane();
!     private JList lstDicts = new JList();
!     private JSplitPane sptMain = new FixedSplitPane();
!     private JScrollPane scrEntries = new JScrollPane();
!     private JScrollPane scrDisplay = new JScrollPane();
!     private JList lstEntries = new JList();
  
      /**
--- 394,405 ----
       * The display of OSIS data
       */
!     private BookDataDisplay display;
      private transient Book dict;
!     protected transient BibleComboBoxModelSet set;
!     private JPanel pnlSelect;
!     private JList lstDicts;
!     private JSplitPane sptMain;
!     private JScrollPane scrEntries;
!     private JList lstEntries;
  
      /**



More information about the jsword-svn mailing list