Changeset 2256 for trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
- Timestamp:
- 2001-04-02T21:22:19+12:00 (23 years ago)
- Location:
- trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/Constants.java
r2251 r2256 66 66 /* Query History Table Column Titles */ 67 67 68 String[] QUERY_HISTORY_COLUMN_TITLES = {"Time/Date", "Collection", "Terms", "Hits"}; 68 69 69 70 70 -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/QueryHistoryModel.java
r2251 r2256 29 29 30 30 private ArrayList historyItems; 31 private ArrayList columnTitles; 32 33 private String COLLECTION = "Collection"; 34 private String DATE_TIME = "Date/Time"; 35 private String TERMS = "Terms"; 36 private String HITS = "Hits"; 37 31 38 32 39 public QueryHistoryModel() { 33 40 super(); 34 41 historyItems = new ArrayList(); 42 columnTitles = new ArrayList(); 43 columnTitles.add( DATE_TIME); 44 columnTitles.add( COLLECTION); 45 columnTitles.add( TERMS); 46 columnTitles.add( HITS); 35 47 } 36 48 … … 43 55 44 56 public int getColumnCount() { 45 return QUERY_HISTORY_COLUMN_TITLES.length;57 return columnTitles.size(); 46 58 } 47 59 … … 55 67 56 68 public String getColumnName(int column) { 57 return QUERY_HISTORY_COLUMN_TITLES[column];69 return (String) columnTitles.get(column); 58 70 } 59 71 60 72 public Object getValueAt( int row, int column ) { 61 // column resolution is a bit awkward 62 // Collection = 0 63 // Terms = 1 73 QueryHistoryItem historyItem = (QueryHistoryItem)historyItems.get(row); 74 if (column == columnTitles.indexOf(DATE_TIME)) return historyItem.getDate(); 75 if (column == columnTitles.indexOf(COLLECTION)) return new CollectionName(historyItem.getCollectionName()); 76 if (column == columnTitles.indexOf(TERMS)) return new Query(historyItem.getQuery().toString()); 77 if (column == columnTitles.indexOf(HITS)) return new Long(historyItem.getNumOfHits()); 64 78 65 if (column == 0) return ((QueryHistoryItem)historyItems.get(row)).getDate(); 66 67 68 if (column == 1) return new CollectionName(((QueryHistoryItem)historyItems.get(row)).getCollectionName()); 69 70 if (column == 2) return ((QueryHistoryItem)historyItems.get(row)).getQuery(); 71 if (column == 3) return new Long(((QueryHistoryItem)historyItems.get(row)).getNumOfHits()); 79 // something has gone wrong if we get here! 80 // but display something anyway... 72 81 return "row" + row + "col" + column; 73 82 } -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java
r2254 r2256 38 38 import org.nzdl.gsdl.service.NzdlService; 39 39 import org.nzdl.gsdl.service.NzdlServiceClient; 40 import org.nzdl.gsdl.util. NzdlPreferences;40 import org.nzdl.gsdl.util.*; 41 41 42 42 … … 66 66 JComboBox collectionList; 67 67 JPanel queryFormulationPanel, resultsPanel, dataPanel, optionsPanel; 68 JPanel queryTypePanel, searchControlPanel; 68 69 JPanel collectionListPanel, searchTextFieldPanel, searchButtonPanel; 69 70 JList resultsList; 70 71 JCheckBox stemCheckBox, caseFoldCheckBox; 72 JRadioButton rankedRadioButton, booleanRadioButton; 73 ButtonGroup buttonGroup; 71 74 JScrollPane scrollResultsPane; 72 75 JScrollPane scrollDataPane; … … 140 143 141 144 optionsPanel = new JPanel(); 145 146 queryTypePanel = new JPanel(); 147 queryTypePanel.setLayout(new GridLayout(2,1)); 148 rankedRadioButton = new JRadioButton("ranked"); 149 rankedRadioButton.setActionCommand(rankedRadioButton.getText()); 150 rankedRadioButton.setSelected(rankedRadioButton.getText() == NzdlConstants.DEFAULT_QUERY_TYPE); 151 rankedRadioButton.setToolTipText("Display results in a ranked list"); 152 153 booleanRadioButton = new JRadioButton("boolean"); 154 booleanRadioButton.setActionCommand(booleanRadioButton.getText()); 155 booleanRadioButton.setSelected(booleanRadioButton.getText() == NzdlConstants.DEFAULT_QUERY_TYPE); 156 booleanRadioButton.setToolTipText("Allows the use of Boolean operators: AND(&) OR(|) and NOT(!)"); 157 buttonGroup = new ButtonGroup(); 158 buttonGroup.add(rankedRadioButton); 159 buttonGroup.add(booleanRadioButton); 160 queryTypePanel.add(rankedRadioButton); 161 queryTypePanel.add(booleanRadioButton); 162 142 163 stemCheckBox = new JCheckBox("Stemming", true); 143 164 stemCheckBox.setToolTipText("Strip endings such as '...ing', '...ed'"); 144 165 caseFoldCheckBox = new JCheckBox("Match case", false); 145 166 caseFoldCheckBox.setToolTipText("Only match when the case is the same"); 167 168 optionsPanel.add(queryTypePanel); 146 169 optionsPanel.add(stemCheckBox); 147 170 optionsPanel.add(caseFoldCheckBox); … … 149 172 searchButtonPanel = new JPanel(); 150 173 searchButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); 151 searchButtonPanel.add(optionsPanel);152 174 searchButtonPanel.add(searchButton); 175 176 searchControlPanel = new JPanel(); 177 searchControlPanel.setLayout(new BorderLayout()); 178 searchControlPanel.add(optionsPanel, BorderLayout.WEST); 179 searchControlPanel.add(searchButtonPanel, BorderLayout.EAST); 153 180 154 181 queryFormulationPanel = new JPanel(); … … 158 185 queryFormulationPanel.add(collectionListPanel); 159 186 queryFormulationPanel.add(searchTextFieldPanel); 160 queryFormulationPanel.add(search ButtonPanel);187 queryFormulationPanel.add(searchControlPanel); 161 188 162 189 resultsPanel = new JPanel(); … … 219 246 //send query to collection 220 247 NzdlQuery nzdlQuery = new NzdlQuery(queryString); 248 nzdlQuery.setQueryType(buttonGroup.getSelection().getActionCommand()); 249 System.err.println(buttonGroup.getSelection().getActionCommand()); 250 //nzdlQuery.setQueryType("boolean"); 221 251 nzdlQuery.setStemming(stemCheckBox.isSelected()); 222 252 // interface reverses underlying logic so negate UI element state
Note:
See TracChangeset
for help on using the changeset viewer.