Changeset 2148 for trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
- Timestamp:
- 2001-03-09T19:00:03+13:00 (23 years ago)
- Location:
- trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/CSModel.java
r2145 r2148 111 111 public String getFirstCollection() 112 112 { 113 return (String)collectionList.get(0); 113 if (collectionList.size() > 0) 114 return (String)collectionList.get(0); 115 else 116 return "no collections"; 114 117 } 115 118 /** -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SearchPanel.java
r2147 r2148 19 19 package org.nzdl.gsdl.SimpleGraphicalClient; 20 20 21 import java.awt.*; 22 import java.awt.event.*; 23 import java.io.*; 24 import java.util.*; 21 25 import javax.swing.*; 22 26 import javax.swing.border.*; 23 import java.awt.*;24 import java.awt.event.*;25 import java.util.*;26 27 import javax.swing.event.*; 27 import java.io.*;28 29 28 30 29 // local libraries … … 65 64 JScrollPane scrollResultsPane; 66 65 /** where the doc contents are displayed */ 67 J TextAreadataTextArea;66 JEditorPane dataTextArea; 68 67 JScrollPane scrollDataPane; 68 69 final static String DOC_HEADER = "<html><body>"; 70 final static String DOC_FOOTER = "</body></html>"; 69 71 70 72 /** … … 158 160 dataPanel.setLayout(new BorderLayout()); 159 161 dataPanel.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); 160 dataTextArea = new JTextArea("Document details will appear here", 10, 0); 162 dataTextArea = new JEditorPane("text/html", 163 "<html><body>Document details will appear here.\n\n\n</body></html>"); 161 164 dataTextArea.setEditable(false); 162 dataTextArea.set LineWrap(true);165 dataTextArea.setEditable(false); 163 166 dataTextArea.setFont(docFont); 164 167 dataTextArea.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 168 //dataTextArea.setPreferredSize(new Dimension(100, 100)); 165 169 scrollDataPane = new JScrollPane(dataTextArea); 170 scrollDataPane.setPreferredSize(new Dimension(100, 100)); 166 171 dataPanel.add(scrollDataPane, BorderLayout.CENTER); 167 172 … … 179 184 } 180 185 181 182 183 /* respond to the user pressing the Search button */ 186 /** respond to the user pressing the Search button */ 184 187 185 188 public void actionPerformed(ActionEvent e) { … … 225 228 } // end else 226 229 // default to showing the top ranked document 230 if (docIDs.size() > 0) 227 231 resultsList.setSelectedIndex(0); 228 232 } // end if … … 232 236 } //end actionPerformed 233 237 234 235 236 /* handles selection events in the results list so that when the 238 /** handles selection events in the results list so that when the 237 239 user selects a new title (say) the document contents is 238 240 automatically displayed in the main panel */ … … 252 254 // should cache document contents here to speed access 253 255 String documentContents = csModel.getNzdlService().getDocument(result.getCollectionName(), result.getDocID()); 256 documentContents = DOC_HEADER + documentContents + DOC_FOOTER; 254 257 dataTextArea.setText(documentContents); 255 258 dataTextArea.setCaretPosition(0); … … 257 260 } //end valueChanged 258 261 }//end ResultListSelectionHandler 262 >>>>>>> 1.4 259 263 260 264
Note:
See TracChangeset
for help on using the changeset viewer.