[jsword-svn]
bibledesktop/java/main/org/crosswire/bibledesktop/book s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Mon Apr 11 04:26:31 MST 2005
Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book
In directory www.crosswire.org:/tmp/cvs-serv24384/java/main/org/crosswire/bibledesktop/book
Modified Files:
Msg.properties DisplaySelectPane.java AdvancedSearchPane.java
Msg.java AdvancedSearchPane.properties
DisplaySelectPane.properties
Log Message:
Tried to make app look better under FC3/JDK5. Worked on button size.
Removed match from main screen.
Added Ranking to Advanced Search, with a slider to limit the number of verses in a ranked search.
Index: DisplaySelectPane.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.properties,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DisplaySelectPane.properties 8 Mar 2005 02:31:36 -0000 1.9
--- DisplaySelectPane.properties 11 Apr 2005 11:26:29 -0000 1.10
***************
*** 54,59 ****
# for the best match toggle button
! Match.Name=Match
! Match.MnemonicKey=M
# for the advanced search button
--- 54,59 ----
# for the best match toggle button
! Rank.Name=Rank
! Rank.MnemonicKey=R
# for the advanced search button
Index: AdvancedSearchPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/AdvancedSearchPane.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AdvancedSearchPane.java 5 Apr 2005 00:33:30 -0000 1.5
--- AdvancedSearchPane.java 11 Apr 2005 11:26:29 -0000 1.6
***************
*** 24,31 ****
--- 24,35 ----
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+ import javax.swing.JSlider;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
+ import javax.swing.SwingConstants;
import javax.swing.WindowConstants;
+ import javax.swing.event.ChangeEvent;
+ import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
***************
*** 111,114 ****
--- 115,149 ----
lblExcludes.setLabelFor(txtExcludes);
+ chkRank = new JCheckBox(actions.getAction(HEAD_RANK));
+ chkRank.setBackground(headBG);
+ chkRank.setForeground(headFG);
+ chkRank.setFont(headFont);
+ lblRank = actions.createJLabel(RANK);
+ setLabelRank(DisplaySelectPane.getNumRankedVerses());
+ lblRank.setVisible(false);
+ sliderRank = new JSlider(SwingConstants.HORIZONTAL,
+ 0, DisplaySelectPane.getMaxNumRankedVerses(), DisplaySelectPane.getNumRankedVerses());
+ sliderRank.setMajorTickSpacing(DisplaySelectPane.getMaxNumRankedVerses()/5);
+ sliderRank.setMinorTickSpacing(DisplaySelectPane.getMaxNumRankedVerses()/20);
+ sliderRank.setPaintTicks(true);
+ sliderRank.setPaintLabels(true);
+ sliderRank.setVisible(false);
+ sliderRank.addChangeListener(new ChangeListener()
+ {
+ public void stateChanged(ChangeEvent e)
+ {
+ JSlider source = (JSlider)e.getSource();
+ int val = source.getValue();
+ if (source.getValueIsAdjusting())
+ {
+ setLabelRank(val);
+ }
+ else
+ {
+ DisplaySelectPane.setNumRankedVerses(val);
+ }
+ }
+ });
+
chkRestrict = new JCheckBox(actions.getAction(HEAD_RESTRICT));
chkRestrict.setBackground(headBG);
***************
*** 192,226 ****
this.setBorder(BorderFactory.createLineBorder(SystemColor.control, 5));
this.setLayout(new GridBagLayout());
! this.add(lblHeading, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblPhrase, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtPhrase, new GridBagConstraints(1, 2, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblIncludes, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtIncludes, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblExcludes, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtExcludes, new GridBagConstraints(1, 4, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(chkRestrict, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblPresets, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(cboPresets, new GridBagConstraints(1, 6, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblRestrict, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtRestrict, new GridBagConstraints(1, 7, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(btnRestrict, new GridBagConstraints(2, 7, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
! // this.add(chkHebGrk, new GridBagConstraints(0, 8, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! // this.add(lblHebInc, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtHebInc, new GridBagConstraints(1, 9, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblHebExc, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtHebExc, new GridBagConstraints(1, 10, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblGrkInc, new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtGrkInc, new GridBagConstraints(1, 11, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblGrkExc, new GridBagConstraints(0, 12, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtGrkExc, new GridBagConstraints(1, 12, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(chkTime, new GridBagConstraints(0, 13, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! // this.add(lblAfter, new GridBagConstraints(0, 14, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtAfter, new GridBagConstraints(1, 14, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblBefore, new GridBagConstraints(0, 15, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtBefore, new GridBagConstraints(1, 15, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! this.add(chkSummary, new GridBagConstraints(0, 16, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblSummary, new GridBagConstraints(0, 17, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(scrSummary, new GridBagConstraints(1, 17, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! this.add(btnGo, new GridBagConstraints(2, 18, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0));
}
--- 227,265 ----
this.setBorder(BorderFactory.createLineBorder(SystemColor.control, 5));
this.setLayout(new GridBagLayout());
! int gridy = 0;
! this.add(lblHeading, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblPhrase, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtPhrase, new GridBagConstraints(1, gridy, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblIncludes, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtIncludes, new GridBagConstraints(1, gridy, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblExcludes, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtExcludes, new GridBagConstraints(1, gridy, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(chkRank, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblRank, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(sliderRank, new GridBagConstraints(1, gridy, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(chkRestrict, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblPresets, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(cboPresets, new GridBagConstraints(1, gridy, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(lblRestrict, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(txtRestrict, new GridBagConstraints(1, gridy, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 5, 2, 5), 0, 0));
! this.add(btnRestrict, new GridBagConstraints(2, gridy, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
! // this.add(chkHebGrk, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! // this.add(lblHebInc, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtHebInc, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblHebExc, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtHebExc, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblGrkInc, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtGrkInc, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblGrkExc, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtGrkExc, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(chkTime, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! // this.add(lblAfter, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtAfter, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! // this.add(lblBefore, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! // this.add(txtBefore, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! this.add(chkSummary, new GridBagConstraints(0, ++gridy, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0));
! this.add(lblSummary, new GridBagConstraints(0, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
! this.add(scrSummary, new GridBagConstraints(1, gridy, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 5, 2, 5), 0, 0));
! this.add(btnGo, new GridBagConstraints(2, ++gridy, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(10, 0, 5, 5), 0, 0));
}
***************
*** 266,269 ****
--- 305,345 ----
}
+ public boolean isRanked()
+ {
+ return chkRank.isSelected();
+ }
+
+ public void setLabelRank(int val)
+ {
+ if (val == 0)
+ {
+ lblRank.setText(Msg.RANK.toString("All")); //$NON-NLS-1$
+ }
+ else if (val == 1)
+ {
+ lblRank.setText(Msg.RANK_ONE.toString());
+ }
+ else
+ {
+ lblRank.setText(Msg.RANK.toString(new Integer(val)));
+ }
+ }
+
+ /**
+ * Someone clicked the rank check button
+ */
+ public void doHeadRank()
+ {
+ boolean visible = chkRank.isSelected();
+
+ lblRank.setVisible(visible);
+ sliderRank.setVisible(visible);
+
+ if (dlgMain != null)
+ {
+ dlgMain.pack();
+ }
+ }
+
/**
* Someone clicked the restrict toggle button
***************
*** 407,410 ****
--- 483,500 ----
StringBuffer search = new StringBuffer();
+ String restrict = txtRestrict.getText();
+ if (restrict != null && restrict.trim().length() > 0)
+ {
+ if (search.length() != 0)
+ {
+ search.append(SPACE);
+ }
+
+ search.append(plus);
+ search.append(open);
+ search.append(restrict);
+ search.append(close);
+ }
+
String phrase = txtPhrase.getText();
if (phrase != null && phrase.trim().length() > 0)
***************
*** 444,461 ****
}
- String restrict = txtRestrict.getText();
- if (restrict != null && restrict.trim().length() > 0)
- {
- if (search.length() != 0)
- {
- search.append(SPACE);
- }
-
- search.append(plus);
- search.append(open);
- search.append(restrict);
- search.append(close);
- }
-
txtSummary.setText(search.toString());
--- 534,537 ----
***************
*** 526,529 ****
--- 602,607 ----
private static final String PHRASE = "Phrase"; //$NON-NLS-1$
private static final String RESTRICT = "Restrict"; //$NON-NLS-1$
+ private static final String HEAD_RANK = "HeadRank"; //$NON-NLS-1$
+ private static final String RANK = "RankSomeSlider"; //$NON-NLS-1$
private static final String HEAD_RESTRICT = "HeadRestrict"; //$NON-NLS-1$
private static final String HEAD_BASE = "HeadBase"; //$NON-NLS-1$
***************
*** 584,587 ****
--- 662,668 ----
private JTextField txtExcludes;
private JLabel lblHeading;
+ private JCheckBox chkRank;
+ private JLabel lblRank;
+ private JSlider sliderRank;
private JCheckBox chkRestrict;
private JLabel lblRestrict;
Index: Msg.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Msg.java 1 Apr 2005 17:10:14 -0000 1.15
--- Msg.java 11 Apr 2005 11:26:29 -0000 1.16
***************
*** 58,61 ****
--- 58,63 ----
static final Msg PRESETS = new Msg("AdvancedSearchPane.Presets"); //$NON-NLS-1$
static final Msg ADVANCED_SELECT_TITLE = new Msg("AdvancedSearchPane.SelectPassageTitle"); //$NON-NLS-1$
+ static final Msg RANK = new Msg("AdvancedSearchPane.Rank"); //$NON-NLS-1$
+ static final Msg RANK_ONE = new Msg("AdvancedSearchPane.RankOne"); //$NON-NLS-1$
/**
Index: DisplaySelectPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** DisplaySelectPane.java 1 Apr 2005 17:10:14 -0000 1.29
--- DisplaySelectPane.java 11 Apr 2005 11:26:29 -0000 1.30
***************
*** 1,6 ****
package org.crosswire.bibledesktop.book;
- import java.awt.BorderLayout;
- import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
--- 1,4 ----
***************
*** 20,24 ****
import javax.swing.ImageIcon;
import javax.swing.JButton;
- import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
--- 18,21 ----
***************
*** 42,47 ****
import org.crosswire.jsword.book.search.basic.DefaultSearchModifier;
import org.crosswire.jsword.book.search.basic.DefaultSearchRequest;
- import org.crosswire.jsword.book.search.parse.IndexSearcher;
- import org.crosswire.jsword.book.search.parse.PhraseParamWord;
import org.crosswire.jsword.passage.Key;
import org.crosswire.jsword.passage.NoSuchKeyException;
--- 39,42 ----
***************
*** 100,103 ****
--- 95,99 ----
mdlBible = new BooksComboBoxModel(BookFilters.getBibles());
JComboBox cboBible = new JComboBox(mdlBible);
+ cboBible.setPrototypeDisplayValue(" "); //$NON-NLS-1$
selected = mdlBible.getSelectedBook();
if (selected != null)
***************
*** 110,115 ****
{
// The application has started and there are no installed bibles.
- // So make the combo box a reasonable size.
- cboBible.setPrototypeDisplayValue(" "); //$NON-NLS-1$
// Should always get a key from book, unless we need a PassageTally
// But here we don't have a book yet.
--- 106,109 ----
***************
*** 149,158 ****
*/
- JPanel pnlBible = new JPanel();
- pnlBible.setLayout(new BorderLayout());
- pnlBible.add(lblBible, BorderLayout.WEST);
- pnlBible.add(cboBible, BorderLayout.EAST); // CENTER);
- // pnlBible.add(btnMenu, BorderLayout.EAST);
-
JLabel lblKey = actions.createJLabel(VIEW_LABEL);
txtKey = new JTextField();
--- 143,146 ----
***************
*** 170,175 ****
btnKey = new JButton(actions.getAction(MORE));
btnKey.setIcon(ICON_SELECT);
! btnKey.setBorderPainted(false);
btnKeyGo = new JButton(actions.getAction(GO_PASSAGE));
txtSearch = new JTextField();
--- 158,164 ----
btnKey = new JButton(actions.getAction(MORE));
btnKey.setIcon(ICON_SELECT);
! btnKey.setBorder(BorderFactory.createEmptyBorder(3,5,3,5));
btnKeyGo = new JButton(actions.getAction(GO_PASSAGE));
+ btnKeyGo.setBorder(BorderFactory.createEmptyBorder(4,5,4,5));
txtSearch = new JTextField();
***************
*** 178,209 ****
lblSearch.setLabelFor(txtSearch);
btnSearch = new JButton(actions.getAction(GO_SEARCH));
JButton btnHelp = new JButton(actions.getAction(HELP));
! btnHelp.setBorder(BorderFactory.createLineBorder(SystemColor.control, 5));
! btnHelp.setBackground(Color.yellow);
btnHelp.setText(null);
dlgHelp = new QuickHelpDialog(GuiUtil.getFrame(this), Msg.HELP_TITLE.toString(), Msg.HELP_TEXT.toString());
btnAdvanced = new JButton(actions.getAction(ADVANCED));
! btnAdvanced.setBorderPainted(false);
btnIndex = new JButton(actions.getAction(INDEX));
!
! chkMatch = new JCheckBox(actions.getAction(MATCH));
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(btnIndex, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 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.EAST, 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));
enableComponents();
--- 167,197 ----
lblSearch.setLabelFor(txtSearch);
btnSearch = new JButton(actions.getAction(GO_SEARCH));
+ btnSearch.setBorder(BorderFactory.createEmptyBorder(4,5,4,5));
JButton btnHelp = new JButton(actions.getAction(HELP));
! btnHelp.setBorder(BorderFactory.createEmptyBorder(2,5,2,5));
btnHelp.setText(null);
dlgHelp = new QuickHelpDialog(GuiUtil.getFrame(this), Msg.HELP_TITLE.toString(), Msg.HELP_TEXT.toString());
btnAdvanced = new JButton(actions.getAction(ADVANCED));
! btnAdvanced.setBorder(BorderFactory.createEmptyBorder(3,5,3,5));
btnIndex = new JButton(actions.getAction(INDEX));
! btnIndex.setBorder(BorderFactory.createEmptyBorder(3,15,3,15));
this.setLayout(new GridBagLayout());
! this.add(lblBible, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
! this.add(cboBible, new GridBagConstraints(2, 0, 4, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, 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(2, 0, 1, 2), 0, 0));
! this.add(btnKey, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 2), 0, 0));
! this.add(btnKeyGo, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, 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(btnIndex, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 2, 2), 0, 0));
! this.add(txtSearch, new GridBagConstraints(2, 2, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 3, 2), 0, 0));
! this.add(btnAdvanced, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 2), 0, 0));
! this.add(btnSearch, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
enableComponents();
***************
*** 291,302 ****
}
! // We may want to do ranking for more than just
! // "match"
! boolean rank = chkMatch.isSelected();
! if (rank)
! {
! String quote = IndexSearcher.getPreferredSyntax(PhraseParamWord.class);
! param = quote + param + quote;
! }
DefaultSearchModifier modifier = new DefaultSearchModifier();
--- 279,283 ----
}
! boolean rank = advanced.isRanked();
DefaultSearchModifier modifier = new DefaultSearchModifier();
***************
*** 305,314 ****
Key results = selected.find(new DefaultSearchRequest(param, modifier));
! // we get PassageTallys for best match searches
if (results instanceof PassageTally || rank)
{
PassageTally tally = (PassageTally) results;
tally.setOrdering(PassageTally.ORDER_TALLY);
! tally.trimRanges(getNumRankedVerses(), RestrictionType.NONE);
}
--- 286,298 ----
Key results = selected.find(new DefaultSearchRequest(param, modifier));
! // we get PassageTallys for rank searches
if (results instanceof PassageTally || rank)
{
PassageTally tally = (PassageTally) results;
tally.setOrdering(PassageTally.ORDER_TALLY);
! if (getNumRankedVerses() > 0)
! {
! tally.trimRanges(getNumRankedVerses(), RestrictionType.NONE);
! }
}
***************
*** 342,350 ****
/**
! * Match is an action, but we don't need to do anything because match is
* only used when search is clicked. But ActionFactory will complain if we
* leave it out.
*/
! public void doMatch()
{
// Do nothing
--- 326,334 ----
/**
! * Rank is an action, but we don't need to do anything because rank is
* only used when search is clicked. But ActionFactory will complain if we
* leave it out.
*/
! public void doRank()
{
// Do nothing
***************
*** 465,468 ****
--- 449,454 ----
//
/**
+ * Gets the number of verses that should be shown when a search result is
+ * ranked. A value of 0 means show all.
* @return Returns the numRankedVerses.
*/
***************
*** 473,484 ****
--- 459,501 ----
/**
+ * Sets the number of verses that should be shown when a search result is
+ * ranked. This can be a value in the range of 0 to maxNumRankedVerses.
+ * Values outside this range are silently constrained to the range.
* @param newNumRankedVerses The numRankedVerses to set.
*/
public static void setNumRankedVerses(int newNumRankedVerses)
{
+ if (newNumRankedVerses < 0)
+ {
+ newNumRankedVerses = 0;
+ }
+ else if (newNumRankedVerses > maxNumRankedVerses)
+ {
+ newNumRankedVerses = maxNumRankedVerses;
+ }
numRankedVerses = newNumRankedVerses;
}
/**
+ * @return Returns the maxNumRankedVerses.
+ */
+ public static int getMaxNumRankedVerses()
+ {
+ return maxNumRankedVerses;
+ }
+
+ /**
+ * @param newMaxNumRankedVerses The maxNumRankedVerses to set.
+ */
+ public static void setMaxNumRankedVerses(int newMaxNumRankedVerses)
+ {
+ if (newMaxNumRankedVerses < numRankedVerses)
+ {
+ newMaxNumRankedVerses = numRankedVerses;
+ }
+ maxNumRankedVerses = newMaxNumRankedVerses;
+ }
+
+ /**
* Someone changed the version combo
*/
***************
*** 565,569 ****
txtSearch.setBackground(searchable ? SystemColor.text : SystemColor.control);
txtSearch.setVisible(searchable);
- chkMatch.setEnabled(searchable);
btnAdvanced.setEnabled(searchable);
btnSearch.setEnabled(searchable);
--- 582,585 ----
***************
*** 702,706 ****
private static final String SEARCH_FIELD = "SearchAction"; //$NON-NLS-1$
private static final String ADVANCED = "Advanced"; //$NON-NLS-1$
- private static final String MATCH = "Match"; //$NON-NLS-1$
private static final String BIBLE = "Bible"; //$NON-NLS-1$
private static final String INDEX = "Index"; //$NON-NLS-1$
--- 718,721 ----
***************
*** 727,731 ****
private JTextField txtKey;
private JTextField txtSearch;
- private JCheckBox chkMatch;
private JButton btnAdvanced;
private JButton btnSearch;
--- 742,745 ----
***************
*** 759,762 ****
--- 773,781 ----
/**
+ * What is the limit to which numRankedVerses can be set.
+ */
+ private static int maxNumRankedVerses = 200;
+
+ /**
* Serialization ID
*/
Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.properties,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Msg.properties 1 Apr 2005 17:10:14 -0000 1.13
--- Msg.properties 11 Apr 2005 11:26:29 -0000 1.14
***************
*** 32,37 ****
Using ~2 widens the passage by 2 verses either side on any match. So "<code>perez ~1 + amminadab</code>" finds<br\>\
verses containting Amminadab within 1 verse of mention of Perez.
- DisplaySelectPane.Match=Match
- DisplaySelectPane.Advanced=Advanced
DisplaySelectPane.Bible=Bible:
DisplaySelectPane.AdvancedTitle=Advanced Search
--- 32,35 ----
***************
*** 55,57 ****
--- 53,57 ----
AdvancedSearchPane.SelectPassageTitle=Select Passages to Restrict Search to
+ AdvancedSearchPane.Rank=Show {0} verses:
+ AdvancedSearchPane.RankOne=Show best verse:
Index: AdvancedSearchPane.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/AdvancedSearchPane.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AdvancedSearchPane.properties 9 Oct 2004 21:45:24 -0000 1.1
--- AdvancedSearchPane.properties 11 Apr 2005 11:26:29 -0000 1.2
***************
*** 6,9 ****
--- 6,13 ----
Excludes.Name=Excludes all these words:
+ HeadRank.Name:Prioritize the found verses
+ RankSomeSlider.Name=Show
+ RankSomeSlider.MnemonicKey=L
+
HeadRestrict.Name:Restrict search to parts of the Bible
Restrict.Name:Include these verses:
More information about the jsword-svn
mailing list