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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Thu Sep 30 15:33:34 MST 2004


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

Modified Files:
	Msg.properties DisplaySelectPane.java Msg.java 
	DisplaySelectPane.properties 
Log Message:
select update

Index: DisplaySelectPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DisplaySelectPane.java	8 Sep 2004 19:57:58 -0000	1.12
--- DisplaySelectPane.java	30 Sep 2004 22:33:32 -0000	1.13
***************
*** 2,10 ****
  
  import java.awt.BorderLayout;
! import java.awt.CardLayout;
! import java.awt.Component;
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import java.awt.Insets;
  import java.awt.Toolkit;
  import java.awt.event.ItemEvent;
--- 2,11 ----
  
  import java.awt.BorderLayout;
! import java.awt.Color;
! import java.awt.Font;
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import java.awt.Insets;
+ import java.awt.SystemColor;
  import java.awt.Toolkit;
  import java.awt.event.ItemEvent;
***************
*** 15,20 ****
  import java.util.List;
  
! import javax.swing.Action;
! import javax.swing.ButtonGroup;
  import javax.swing.JButton;
  import javax.swing.JCheckBox;
--- 16,21 ----
  import java.util.List;
  
! import javax.swing.BorderFactory;
! import javax.swing.ImageIcon;
  import javax.swing.JButton;
  import javax.swing.JCheckBox;
***************
*** 23,27 ****
  import javax.swing.JOptionPane;
  import javax.swing.JPanel;
- import javax.swing.JRadioButton;
  import javax.swing.JTextField;
  
--- 24,27 ----
***************
*** 29,32 ****
--- 29,33 ----
  import org.crosswire.bibledesktop.passage.KeyChangeListener;
  import org.crosswire.common.swing.ActionFactory;
+ import org.crosswire.common.swing.GuiUtil;
  import org.crosswire.common.util.Reporter;
  import org.crosswire.jsword.book.Book;
***************
*** 70,74 ****
      public DisplaySelectPane()
      {
!         init();
      }
  
--- 71,75 ----
      public DisplaySelectPane()
      {
!         initialize();
      }
  
***************
*** 76,80 ****
       * Initialize the GUI
       */
!     private void init()
      {
          title = Msg.UNTITLED.toString(new Integer(base++));
--- 77,81 ----
       * Initialize the GUI
       */
!     private void initialize()
      {
          title = Msg.UNTITLED.toString(new Integer(base++));
***************
*** 82,150 ****
          actions = new ActionFactory(DisplaySelectPane.class, this);
  
-         // Create a way for selecting how passages are found
-         JPanel pnlSelect = new JPanel(new GridBagLayout());
- 
-         // Layout the card picker and the Bible picker side by side
-         pnlSelect.add(createRadioPanel(), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
-                         new Insets(0, 2, 0, 2), 0, 0));
-         pnlSelect.add(createBiblePicker(), new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,
-                         2, 0, 2), 0, 0));
- 
-         // Create a deck of "cards" for the different ways of finding passages
-         layCards = new CardLayout();
-         pnlCards = new JPanel(layCards);
- 
-         pnlCards.add(createPassagePanel(), PASSAGE);
-         pnlCards.add(createSearchPanel(), SEARCH);
-         pnlCards.add(createMatchPanel(), MATCH);
- 
-         this.setLayout(new BorderLayout());
-         this.add(pnlSelect, BorderLayout.PAGE_START);
-         this.add(pnlCards, BorderLayout.CENTER);
- 
-     }
- 
-     /**
-      *
-      */
-     private Component createRadioPanel()
-     {
-         // These buttons control which "card" in the deck is shown
-         rdoPassg = new JRadioButton(actions.getAction(PASSAGE_OPTIONS));
-         rdoMatch = new JRadioButton(actions.getAction(MATCH_OPTIONS));
-         rdoSearch = new JRadioButton(actions.getAction(SEARCH_OPTIONS));
- 
-         ButtonGroup grpType = new ButtonGroup();
-         grpType.add(rdoPassg);
-         grpType.add(rdoSearch);
-         grpType.add(rdoMatch);
- 
-         JPanel pnlRadios = new JPanel();
-         pnlRadios.add(rdoPassg, null);
-         pnlRadios.add(rdoSearch, null);
-         pnlRadios.add(rdoMatch, null);
-         rdoPassg.setSelected(true);
- 
-         return pnlRadios;
-     }
- 
-     /**
-      *
-      */
-     private Component createBiblePicker()
-     {
-         // Create the Bible picker
          // search() and version() rely on this returning only Bibles
!         mdlVersn = new BooksComboBoxModel(BookFilters.getBibles());
!         JComboBox cboVersn = new JComboBox(mdlVersn);
!         Object selected = mdlVersn.getSelectedItem();
          if (selected != null)
          {
!             cboVersn.setToolTipText(selected.toString());
          }
!         cboVersn.setRenderer(new BookListCellRenderer());
!         // Allow for layout to size the combo box
!         cboVersn.setPrototypeDisplayValue(" "); //$NON-NLS-1$
!         cboVersn.addItemListener(new ItemListener()
          {
              public void itemStateChanged(ItemEvent ev)
--- 83,96 ----
          actions = new ActionFactory(DisplaySelectPane.class, this);
  
          // search() and version() rely on this returning only Bibles
!         mdlBible = new BooksComboBoxModel(BookFilters.getBibles());
!         JComboBox cboBible = new JComboBox(mdlBible);
!         Object selected = mdlBible.getSelectedItem();
          if (selected != null)
          {
!             cboBible.setToolTipText(selected.toString());
          }
!         cboBible.setRenderer(new BookListCellRenderer());
!         cboBible.addItemListener(new ItemListener()
          {
              public void itemStateChanged(ItemEvent ev)
***************
*** 158,174 ****
              }
          });
!         return cboVersn;
!     }
  
!     /**
!      *
!      */
!     private Component createPassagePanel()
!     {
!         JLabel label = actions.createJLabel(VIEW_LABEL);
  
!         txtPassg = new JTextField();
!         txtPassg.setAction(actions.getAction(PASSAGE_FIELD));
!         txtPassg.addKeyListener(new KeyAdapter()
          {
              public void keyTyped(KeyEvent ev)
--- 104,125 ----
              }
          });
!         JLabel lblBible = new JLabel();
!         lblBible.setText(Msg.SELECT_BIBLE.toString());
!         lblBible.setLabelFor(cboBible);
  
!         JButton btnMenu = new JButton();
!         btnMenu.setIcon(ICON_MENU);
!         btnMenu.setBorderPainted(false);
  
!         JPanel pnlBible = new JPanel();
!         pnlBible.setLayout(new BorderLayout());
!         pnlBible.add(lblBible, BorderLayout.WEST);
!         pnlBible.add(cboBible, BorderLayout.CENTER);
!         pnlBible.add(btnMenu, BorderLayout.EAST);
! 
!         JLabel lblKey = actions.createJLabel(VIEW_LABEL);
!         txtKey = new JTextField();
!         txtKey.setAction(actions.getAction(PASSAGE_FIELD));
!         txtKey.addKeyListener(new KeyAdapter()
          {
              public void keyTyped(KeyEvent ev)
***************
*** 180,261 ****
              }
          });
  
-         JButton btnDialg = new JButton(actions.getAction(MORE));
- 
-         JButton goButton = new JButton(actions.getAction(GO_PASSAGE));
- 
-         JPanel panel = new JPanel(new GridBagLayout());
- 
-         panel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
-         panel.add(txtPassg, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0));
-         panel.add(goButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
-         panel.add(btnDialg, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
- 
-         return panel;
-     }
- 
-     /**
-      *
-      */
-     private Component createSearchPanel()
-     {
          txtSearch = new JTextField();
          txtSearch.setAction(actions.getAction(SEARCH_FIELD));
  
!         JLabel label = actions.createJLabel(SEARCH_LABEL);
!         label.setLabelFor(txtSearch);
! 
!         chkSRestrict = new JCheckBox(actions.getAction(RESTRICT_SEARCH));
!         chkSRestrict.setSelected(false);
! 
!         txtSRestrict = new JTextField();
!         Action action = actions.getAction(SEARCH_RESTRICTION);
!         txtSRestrict.setAction(action);
!         txtSRestrict.setText(action.getValue(Action.NAME).toString());
! 
!         JButton goButton = new JButton(actions.getAction(GO_SEARCH));
! 
!         JPanel panel = new JPanel(new GridBagLayout());
! 
!         panel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(txtSearch, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(goButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(chkSRestrict, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
!         panel.add(txtSRestrict, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2),
!                         0, 0));
! 
!         return panel;
!     }
! 
!     /**
!      *
!      */
!     private Component createMatchPanel()
!     {
!         txtMatch = new JTextField();
!         txtMatch.setAction(actions.getAction(MATCH_FIELD));
! 
!         JLabel label = actions.createJLabel(MATCH_LABEL);
!         label.setLabelFor(txtMatch);
! 
!         txtMRestrict = new JTextField();
!         Action action = actions.getAction(MATCH_RESTRICTION);
!         txtMRestrict.setAction(action);
!         txtMRestrict.setText(action.getValue(Action.NAME).toString());
  
!         chkMRestrict = new JCheckBox(actions.getAction(RESTRICT_MATCH));
!         chkMRestrict.setSelected(false);
  
!         JButton goButton = new JButton(actions.getAction(GO_MATCH));
  
!         JPanel panel = new JPanel(new GridBagLayout());
  
!         panel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(txtMatch, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(goButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
!         panel.add(chkMRestrict, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
!         panel.add(txtMRestrict, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
  
!         return panel;
      }
  
--- 131,176 ----
              }
          });
+         JButton btnKey = new JButton(actions.getAction(MORE));
+         btnKey.setIcon(ICON_SELECT);
+         btnKey.setBorderPainted(false);
+         JButton btnKeyGo = new JButton(actions.getAction(GO_PASSAGE));
  
          txtSearch = new JTextField();
          txtSearch.setAction(actions.getAction(SEARCH_FIELD));
+         JLabel lblSearch = actions.createJLabel(SEARCH_LABEL);
+         lblSearch.setLabelFor(txtSearch);
+         JButton btnSearch = new JButton(actions.getAction(GO_SEARCH));
  
!         JButton btnHelp = new JButton();
!         btnHelp.setBorderPainted(true);
!         btnHelp.setBorder(BorderFactory.createLineBorder(SystemColor.control, 5));
!         btnHelp.setBackground(Color.yellow);
!         btnHelp.setFont(btnHelp.getFont().deriveFont(Font.BOLD));
!         btnHelp.setIcon(ICON_HELP);
  
!         JButton btnAdvanced = new JButton();
!         btnAdvanced.setText(Msg.SELECT_ADVANCED.toString());
!         btnAdvanced.setMnemonic(KeyEvent.VK_V);
!         btnAdvanced.setBorderPainted(true);
!         btnAdvanced.setIcon(ICON_SEARCH);
!         btnAdvanced.setBorderPainted(false);
  
!         chkMatch = new JCheckBox();
!         chkMatch.setText(Msg.SELECT_MATCH.toString());
  
!         this.setLayout(new GridBagLayout());
!         this.add(pnlBible, new GridBagConstraints(0, 0, 6, 1, 1.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  
!         this.add(lblKey, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
!         this.add(txtKey, new GridBagConstraints(2, 1, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 0, 0), 0, 0));
!         this.add(btnKey, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
!         this.add(btnKeyGo, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  
!         this.add(btnHelp, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
!         this.add(lblSearch, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
!         this.add(txtSearch, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
!         this.add(chkMatch, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
!         this.add(btnAdvanced, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
!         this.add(btnSearch, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
      }
  
***************
*** 265,272 ****
      public Book getBook()
      {
!         BookMetaData bmd = mdlVersn.getSelectedBookMetaData();
          return bmd != null ? bmd.getBook() : null;
      }
  
      public void clear()
      {
--- 180,190 ----
      public Book getBook()
      {
!         BookMetaData bmd = mdlBible.getSelectedBookMetaData();
          return bmd != null ? bmd.getBook() : null;
      }
  
+     /**
+      * 
+      */
      public void clear()
      {
***************
*** 276,291 ****
          }
  
!         txtPassg.setText(""); //$NON-NLS-1$
!         flipOption(PASSAGE);
! 
!         Action action = actions.getAction(SEARCH_RESTRICTION);
          txtSearch.setText(""); //$NON-NLS-1$
-         txtSRestrict.setText(action.getValue(Action.NAME).toString());
-         chkSRestrict.setSelected(false);
- 
-         action = actions.getAction(MATCH_RESTRICTION);
-         txtMatch.setText(""); //$NON-NLS-1$
-         txtMRestrict.setText(action.getValue(Action.NAME).toString());
-         chkMRestrict.setSelected(false);
  
          title = Msg.UNTITLED.toString(new Integer(base++));
--- 194,199 ----
          }
  
!         txtKey.setText(""); //$NON-NLS-1$
          txtSearch.setText(""); //$NON-NLS-1$
  
          title = Msg.UNTITLED.toString(new Integer(base++));
***************
*** 295,298 ****
--- 203,209 ----
      }
  
+     /**
+      * 
+      */
      public boolean isClear()
      {
***************
*** 300,326 ****
      }
  
!     // The following are behaviors associated with the actions executed by actionPerformed
!     public void doPassageOption()
!     {
!         flipOption(PASSAGE);
!     }
! 
!     public void doMatchOption()
!     {
!         flipOption(MATCH);
!     }
! 
!     public void doSearchOption()
!     {
!         flipOption(SEARCH);
!     }
! 
!     private void flipOption(String toWhat)
!     {
!         layCards.show(pnlCards, toWhat);
!         adjustFocus();
!     }
! 
!     // More (...) button was clicked
      public void doMore()
      {
--- 211,217 ----
      }
  
!     /**
!      * More (...) button was clicked
!      */
      public void doMore()
      {
***************
*** 328,332 ****
      }
  
!     // Go button was clicked
      public void doGoPassage()
      {
--- 219,225 ----
      }
  
!     /**
!      * Go button was clicked
!      */
      public void doGoPassage()
      {
***************
*** 334,338 ****
      }
  
!     // Go button was clicked
      public void doGoSearch()
      {
--- 227,233 ----
      }
  
!     /**
!      * Go button was clicked
!      */
      public void doGoSearch()
      {
***************
*** 340,361 ****
      }
  
-     // Enter was hit in txtRestrict
-     public void doSearchEverywhere()
-     {
-         doSearchAction();
-     }
- 
-     // Go button was clicked
-     public void doGoMatch()
-     {
-         doMatchAction();
-     }
- 
-     // Enter was hit in txtMRestrict
-     public void doMatchAnywhere()
-     {
-         doMatchAction();
-     }
- 
      /**
       * Someone pressed return in the passage area
--- 235,238 ----
***************
*** 363,367 ****
      public void doPassageAction()
      {
!         setTitle(txtPassg.getText());
          updateDisplay();
      }
--- 240,244 ----
      public void doPassageAction()
      {
!         setTitle(txtKey.getText());
          updateDisplay();
      }
***************
*** 372,376 ****
      public void doSearchAction()
      {
!         BookMetaData bmd = mdlVersn.getSelectedBookMetaData();
          if (bmd == null)
          {
--- 249,253 ----
      public void doSearchAction()
      {
!         BookMetaData bmd = mdlBible.getSelectedBookMetaData();
          if (bmd == null)
          {
***************
*** 383,429 ****
              String param = txtSearch.getText();
              Book book = bmd.getBook();
  
!             Search search = new Search(param, false);
!             if (chkSRestrict.isSelected())
!             {
!                 Key restrict = book.getKey(txtSRestrict.getText());
!                 search.setRestriction(restrict);
!             }
! 
!             Key key = book.find(search);
! 
!             txtPassg.setText(key.getName());
!             setTitle(param);
!             updateDisplay();
!         }
!         catch (Exception ex)
!         {
!             Reporter.informUser(this, ex);
!         }
!     }
! 
!     /**
!      * Someone pressed return in the match area
!      */
!     public void doMatchAction()
!     {
!         BookMetaData bmd = mdlVersn.getSelectedBookMetaData();
!         if (bmd == null)
!         {
!             noBookInstalled();
!             return;
!         }
! 
!         try
!         {
!             String param = txtMatch.getText();
!             Book book = bmd.getBook();
! 
!             Search search = new Search(param, true);
!             if (chkMRestrict.isSelected())
!             {
!                 Key restrict = book.getKey(txtMRestrict.getText());
!                 search.setRestriction(restrict);
!             }
  
              Key key = book.find(search);
--- 260,266 ----
              String param = txtSearch.getText();
              Book book = bmd.getBook();
+             boolean match = chkMatch.isSelected();
  
!             Search search = new Search(param, match);
  
              Key key = book.find(search);
***************
*** 437,442 ****
              }
  
!             txtPassg.setText(key.getName());
! 
              setTitle(param);
              updateDisplay();
--- 274,278 ----
              }
  
!             txtKey.setText(key.getName());
              setTitle(param);
              updateDisplay();
***************
*** 449,476 ****
  
      /**
-      * Some on (un)checked the restrict match box
-      */
-     public void doRestrictMatch()
-     {
-         boolean selected = chkMRestrict.isSelected();
-         txtMRestrict.setEnabled(selected);
-     }
- 
-     /**
-      * Some on (un)checked the restrict search box
-      */
-     public void doRestrictSearch()
-     {
-         boolean selected = chkSRestrict.isSelected();
-         txtSRestrict.setEnabled(selected);
- 
-     }
- 
-     /**
       * Sync the viewed passage with the passage text box
       */
      private void updateDisplay()
      {
!         BookMetaData bmd = mdlVersn.getSelectedBookMetaData();
          if (bmd == null)
          {
--- 285,293 ----
  
      /**
       * Sync the viewed passage with the passage text box
       */
      private void updateDisplay()
      {
!         BookMetaData bmd = mdlBible.getSelectedBookMetaData();
          if (bmd == null)
          {
***************
*** 482,486 ****
          {
              Book book = bmd.getBook();
!             Key key = book.getKey(txtPassg.getText());
  
              fireCommandMade(new DisplaySelectEvent(this, key, book));
--- 299,303 ----
          {
              Book book = bmd.getBook();
!             Key key = book.getKey(txtKey.getText());
  
              fireCommandMade(new DisplaySelectEvent(this, key, book));
***************
*** 501,516 ****
      public void adjustFocus()
      {
-         if (rdoPassg.isSelected())
-         {
-             txtPassg.grabFocus();
-         }
-         else if (rdoSearch.isSelected())
-         {
-             txtSearch.grabFocus();
-         }
-         else if (rdoMatch.isSelected())
-         {
-             txtMatch.grabFocus();
-         }
      }
  
--- 318,321 ----
***************
*** 536,543 ****
      public void setText(String text)
      {
!         String currentText = txtPassg.getText();
          if (!currentText.equals(text))
          {
!             txtPassg.setText(text);
              setTitle(text);
              updateDisplay();
--- 341,348 ----
      public void setText(String text)
      {
!         String currentText = txtKey.getText();
          if (!currentText.equals(text))
          {
!             txtKey.setText(text);
              setTitle(text);
              updateDisplay();
***************
*** 550,554 ****
      protected void changeVersion()
      {
!         BookMetaData bmd = mdlVersn.getSelectedBookMetaData();
          if (bmd == null)
          {
--- 355,359 ----
      protected void changeVersion()
      {
!         BookMetaData bmd = mdlBible.getSelectedBookMetaData();
          if (bmd == null)
          {
***************
*** 560,564 ****
          {
              Book book = bmd.getBook();
!             Key key = book.getKey(txtPassg.getText());
  
              fireVersionChanged(new DisplaySelectEvent(this, key, book));
--- 365,369 ----
          {
              Book book = bmd.getBook();
!             Key key = book.getKey(txtKey.getText());
  
              fireVersionChanged(new DisplaySelectEvent(this, key, book));
***************
*** 588,593 ****
              dlgSelect = new PassageSelectionPane();
          }
!         String passg = dlgSelect.showInDialog(this, Msg.SELECT_PASSAGE_TITLE.toString(), true, txtPassg.getText());
!         txtPassg.setText(passg);
          doPassageAction();
      }
--- 393,398 ----
              dlgSelect = new PassageSelectionPane();
          }
!         String passg = dlgSelect.showInDialog(this, Msg.SELECT_PASSAGE_TITLE.toString(), true, txtKey.getText());
!         txtKey.setText(passg);
          doPassageAction();
      }
***************
*** 666,674 ****
      }
  
-     // Enumeration of all the keys to known actions
-     private static final String PASSAGE_OPTIONS = "PassageOption"; //$NON-NLS-1$
-     private static final String MATCH_OPTIONS = "MatchOption"; //$NON-NLS-1$
-     private static final String SEARCH_OPTIONS = "SearchOption"; //$NON-NLS-1$
- 
      // For the Passage card
      private static final String VIEW_LABEL = "ViewLabel"; //$NON-NLS-1$
--- 471,474 ----
***************
*** 679,697 ****
      // for the Search card
      private static final String SEARCH_LABEL = "SearchLabel"; //$NON-NLS-1$
-     private static final String RESTRICT_SEARCH = "RestrictSearch"; //$NON-NLS-1$
      private static final String GO_SEARCH = "GoSearch"; //$NON-NLS-1$
      private static final String SEARCH_FIELD = "SearchAction"; //$NON-NLS-1$
-     private static final String SEARCH_RESTRICTION = "SearchEverywhere"; //$NON-NLS-1$
- 
-     // for the Match card
-     private static final String MATCH_LABEL = "MatchLabel"; //$NON-NLS-1$
-     private static final String RESTRICT_MATCH = "RestrictMatch"; //$NON-NLS-1$
-     private static final String GO_MATCH = "GoMatch"; //$NON-NLS-1$
-     private static final String MATCH_FIELD = "MatchAction"; //$NON-NLS-1$
-     private static final String MATCH_RESTRICTION = "MatchAnywhere"; //$NON-NLS-1$
- 
-     private static final String PASSAGE = "p"; //$NON-NLS-1$
-     private static final String SEARCH = "s"; //$NON-NLS-1$
-     private static final String MATCH = "m"; //$NON-NLS-1$
  
      private static int base = 1;
--- 479,484 ----
***************
*** 701,721 ****
      private transient List listeners;
  
!     private BooksComboBoxModel mdlVersn;
      private PassageSelectionPane dlgSelect;
-     private JTextField txtPassg;
-     private JTextField txtSearch;
-     protected JCheckBox chkSRestrict;
-     protected JTextField txtSRestrict;
-     private JTextField txtMatch;
-     protected JCheckBox chkMRestrict;
-     protected JTextField txtMRestrict;
-     private JRadioButton rdoMatch;
-     private JRadioButton rdoSearch;
-     private JRadioButton rdoPassg;
-     private JPanel pnlCards;
-     private CardLayout layCards;
  
      private ActionFactory actions;
  
      /**
       * SERIALUID(dms): A placeholder for the ultimate version id.
--- 488,511 ----
      private transient List listeners;
  
!     private static final ImageIcon ICON_SEARCH = GuiUtil.getIcon("toolbarButtonGraphics/general/Find16.gif"); //$NON-NLS-1$
! 
!     private static final ImageIcon ICON_SELECT = GuiUtil.getIcon("toolbarButtonGraphics/general/Edit16.gif"); //$NON-NLS-1$
! 
!     private static final ImageIcon ICON_HELP = GuiUtil.getIcon("toolbarButtonGraphics/general/ContextualHelp16.gif"); //$NON-NLS-1$
! 
!     private static final ImageIcon ICON_MENU = GuiUtil.getIcon("toolbarButtonGraphics/general/Preferences16.gif"); //$NON-NLS-1$
! 
!     private BooksComboBoxModel mdlBible;
! 
      private PassageSelectionPane dlgSelect;
  
      private ActionFactory actions;
  
+     private JTextField txtKey;
+ 
+     private JTextField txtSearch;
+ 
+     private JCheckBox chkMatch = null;
+ 
      /**
       * SERIALUID(dms): A placeholder for the ultimate version id.
***************
*** 723,725 ****
      private static final long serialVersionUID = 1L;
  }
- 
--- 513,514 ----

Index: DisplaySelectPane.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DisplaySelectPane.properties	30 Aug 2004 09:26:13 -0000	1.4
--- DisplaySelectPane.properties	30 Sep 2004 22:33:32 -0000	1.5
***************
*** 1,39 ****
  
- # for the Passage Lookup radio button
- PassageOption.Enabled=true
- PassageOption.Name=Passage Lookup
- PassageOption.ShortDescription=Passage Lookup
- PassageOption.LongDescription=Passage Lookup
- PassageOption.SmallIcon=
- PassageOption.LargeIcon=
- PassageOption.MnemonicKey=P
- PassageOption.AcceleratorKey=
- PassageOption.AcceleratorKey.Modifiers=
- 
- # for the Match radio button
- MatchOption.Enabled=true
- MatchOption.Name=Match
- MatchOption.ShortDescription=Match
- MatchOption.LongDescription=Match
- MatchOption.SmallIcon=
- MatchOption.LargeIcon=
- MatchOption.MnemonicKey=M
- MatchOption.AcceleratorKey=
- MatchOption.AcceleratorKey.Modifiers=
- 
- # for the Search radio button
- SearchOption.Enabled=true
- SearchOption.Name=Search
- SearchOption.ShortDescription=Search
- SearchOption.LongDescription=Search
- SearchOption.SmallIcon=
- SearchOption.LargeIcon=
- SearchOption.MnemonicKey=S
- SearchOption.AcceleratorKey=
- SearchOption.AcceleratorKey.Modifiers=
- 
  # for the Passage label
  ViewLabel.Enabled=true
! ViewLabel.Name=View:
  ViewLabel.ShortDescription=
  ViewLabel.LongDescription=
--- 1,6 ----
  
  # for the Passage label
  ViewLabel.Enabled=true
! ViewLabel.Name=Show Passage:
  ViewLabel.ShortDescription=
  ViewLabel.LongDescription=
***************
*** 98,123 ****
  #	verses containting Amminadab within 1 verse of mention of Perez.
  
- # for the Search restriction check box
- RestrictSearch.Enabled=true
- RestrictSearch.Name=Restrict to:
- RestrictSearch.ShortDescription=Restrict the search to the provided passages
- RestrictSearch.LongDescription=
- RestrictSearch.SmallIcon=
- RestrictSearch.LargeIcon=
- RestrictSearch.MnemonicKey=R
- RestrictSearch.AcceleratorKey=
- RestrictSearch.AcceleratorKey.Modifiers=
- 
- # for the Search restriction text field
- SearchEverywhere.Enabled=false
- SearchEverywhere.Name=Gen-Rev
- SearchEverywhere.ShortDescription=Restrict searching to these passages
- SearchEverywhere.LongDescription=
- SearchEverywhere.SmallIcon=
- SearchEverywhere.LargeIcon=
- SearchEverywhere.MnemonicKey=
- SearchEverywhere.AcceleratorKey=
- SearchEverywhere.AcceleratorKey.Modifiers=
- 
  # for the Search go button
  GoSearch.Enabled=true
--- 65,68 ----
***************
*** 131,179 ****
  GoSearch.AcceleratorKey.Modifiers=
  
! # for the Match label
! MatchLabel.Name=Find Verses Like:
! MatchLabel.MnemonicKey=V
! 
! # for the Match text entry field
! MatchAction.Enabled=true
! MatchAction.Name=Match
! MatchAction.ShortDescription=Find passages like
! MatchAction.LongDescription=Find passages like
! MatchAction.SmallIcon=
! MatchAction.LargeIcon=
! MatchAction.MnemonicKey=
! MatchAction.AcceleratorKey=
! MatchAction.AcceleratorKey.Modifiers=
! 
! # for the Match restriction check box
! RestrictMatch.Enabled=true
! RestrictMatch.Name=Restrict to:
! RestrictMatch.ShortDescription=Restrict the match to the provided passages
! RestrictMatch.LongDescription=
! RestrictMatch.SmallIcon=
! RestrictMatch.LargeIcon=
! RestrictMatch.MnemonicKey=R
! RestrictMatch.AcceleratorKey=
! RestrictMatch.AcceleratorKey.Modifiers=
! 
! # for the Match restriction text field
! MatchAnywhere.Enabled=false
! MatchAnywhere.Name=Gen-Rev
! MatchAnywhere.ShortDescription=Restrict matching to these passages
! MatchAnywhere.LongDescription=
! MatchAnywhere.SmallIcon=
! MatchAnywhere.LargeIcon=
! MatchAnywhere.MnemonicKey=
! MatchAnywhere.AcceleratorKey=
! MatchAnywhere.AcceleratorKey.Modifiers=
  
! # for the Match go button
! GoMatch.Enabled=true
! GoMatch.Name=Go
! GoMatch.ShortDescription=Match for a passage
! GoMatch.LongDescription=
! GoMatch.SmallIcon=
! GoMatch.LargeIcon=
! GoMatch.MnemonicKey=G
! GoMatch.AcceleratorKey=
! GoMatch.AcceleratorKey.Modifiers=
--- 76,91 ----
  GoSearch.AcceleratorKey.Modifiers=
  
! # for the Blah label
! BlahLabel.Name=Find Verses Like:
! BlahLabel.MnemonicKey=V
  
! # for the Blah text entry field
! BlahAction.Enabled=true
! BlahAction.Name=Blah
! BlahAction.ShortDescription=Find passages like
! BlahAction.LongDescription=Find passages like
! BlahAction.SmallIcon=
! BlahAction.LargeIcon=
! BlahAction.MnemonicKey=
! BlahAction.AcceleratorKey=
! BlahAction.AcceleratorKey.Modifiers=

Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Msg.properties	28 Sep 2004 22:25:06 -0000	1.5
--- Msg.properties	30 Sep 2004 22:33:32 -0000	1.6
***************
*** 42,43 ****
--- 42,60 ----
  PassageSelectionPane.Error=Error: {0}
  PassageSelectionPane.Summary=Summary: {0}
+ 
+ AdvancedSearchPane.Phrase=Includes this phrase:
+ AdvancedSearchPane.Go=Go
+ AdvancedSearchPane.Select=Select
+ AdvancedSearchPane.Restrict=Restrict search to these verses:
+ AdvancedSearchPane.Heading=Search for verses with the following details
+ AdvancedSearchPane.Excludes=Excludes these words:
+ AdvancedSearchPane.Includes=Includes all these words:
+ 
+ KeySelectPane.Go=Go
+ KeySelectPane.Keys=Select
+ KeySelectPane.Match=Match
+ KeySelectPane.Advanced=Advanced
+ KeySelectPane.Help=\ ?\ 
+ KeySelectPane.Bible=Bible:
+ KeySelectPane.Display=Display:
+ KeySelectPane.Search=Search:

Index: Msg.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Msg.java	28 Sep 2004 22:25:06 -0000	1.7
--- Msg.java	30 Sep 2004 22:33:32 -0000	1.8
***************
*** 67,70 ****
--- 67,87 ----
      static final Msg SUMMARY = new Msg("PassageSelectionPane.Summary"); //$NON-NLS-1$
  
+     static final Msg SEARCH_PHRASE = new Msg("AdvancedSearchPane.Phrase"); //$NON-NLS-1$
+     static final Msg SEARCH_GO = new Msg("AdvancedSearchPane.Go"); //$NON-NLS-1$
+     static final Msg SEARCH_SELECT = new Msg("AdvancedSearchPane.Select"); //$NON-NLS-1$
+     static final Msg SEARCH_RESTRICT = new Msg("AdvancedSearchPane.Restrict"); //$NON-NLS-1$
+     static final Msg SEARCH_HEADING = new Msg("AdvancedSearchPane.Heading"); //$NON-NLS-1$
+     static final Msg SEARCH_EXCLUDES = new Msg("AdvancedSearchPane.Excludes"); //$NON-NLS-1$
+     static final Msg SEARCH_INCLUDES = new Msg("AdvancedSearchPane.Includes"); //$NON-NLS-1$
+ 
+     static final Msg SELECT_GO = new Msg("KeySelectPane.Go"); //$NON-NLS-1$
+     static final Msg SELECT_KEYS = new Msg("KeySelectPane.Keys"); //$NON-NLS-1$
+     static final Msg SELECT_MATCH = new Msg("KeySelectPane.Match"); //$NON-NLS-1$
+     static final Msg SELECT_ADVANCED = new Msg("KeySelectPane.Advanced"); //$NON-NLS-1$
+     static final Msg SELECT_HELP = new Msg("KeySelectPane.Help"); //$NON-NLS-1$
+     static final Msg SELECT_BIBLE = new Msg("KeySelectPane.Bible"); //$NON-NLS-1$
+     static final Msg SELECT_DISPLAY = new Msg("KeySelectPane.Display"); //$NON-NLS-1$
+     static final Msg SELECT_SEARCH = new Msg("KeySelectPane.Search"); //$NON-NLS-1$
+ 
      /**
       * Passthrough ctor



More information about the jsword-svn mailing list