- Timestamp:
- 2003-06-12T18:08:42+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r4597 r4626 228 228 public int indexOf(Classifier classifier) { 229 229 for(int i = 0; i < assigned.size(); i++) { 230 Classifier sibling = (Classifier) assigned.get(i); 231 if(sibling.equals(classifier)) { 232 return i; 230 Object elem = assigned.get(i); 231 if (elem instanceof Classifier) { 232 Classifier sibling = (Classifier)elem; 233 if(sibling.equals(classifier)) { 234 return i; 235 } 236 } 237 } 238 return -1; 239 } 240 // these two methods assume that a custome classifier can never be the same as a classifier 241 public int indexOf(CustomClassifier classifier) { 242 for(int i = 0; i < assigned.size(); i++) { 243 Object elem = assigned.get(i); 244 if (elem instanceof CustomClassifier) { 245 CustomClassifier sibling = (CustomClassifier) assigned.get(i); 246 if(sibling.equals(classifier)) { 247 return i; 248 } 233 249 } 234 250 } … … 327 343 if(object instanceof CustomClassifier) { 328 344 CustomClassifier classifier = (CustomClassifier) object; 329 if(!classifier. valueIsAdjusting()) {345 if(!classifier.isProcessing()) { // are we already in the middle of processing?? 330 346 classifier.process(record); 331 } 347 } 332 348 } 333 349 } … … 438 454 CommandTokenizer tokenizer = new CommandTokenizer(command); 439 455 if(tokenizer.countTokens() >= 6) { 440 tokenizer.nextToken();// Lo ose customclassifier456 tokenizer.nextToken();// Lose customclassifier 441 457 // Get class name. 442 458 String class_name = tokenizer.nextToken(); … … 449 465 replaces = tokenizer.nextToken(); 450 466 } 451 else {467 else if (arg_name.equalsIgnoreCase("-separations")){ 452 468 separations = tokenizer.nextToken(); 453 469 } … … 462 478 custom_classifier.setGatherer(gatherer); 463 479 custom_classifier.recreate(original, separations); 464 assigned.add(index Of(original), custom_classifier);480 assigned.add(index, custom_classifier); 465 481 assigned.removeElement(original); 466 482 } … … 856 872 private class AddListener 857 873 implements ActionListener { 858 859 860 861 862 863 864 874 /** Any implementation of ActionListener must include this method so that we can be informed when an action has occured on one of our target controls, so that we can add the selected Classifier. 875 * @param event An <strong>ActionEvent</strong> containing information garnered from the control action. 876 * @see org.greenstone.gatherer.Gatherer 877 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration 878 * @see org.greenstone.gatherer.cdm.Classifier 879 * @see org.greenstone.gatherer.cdm.CustomClassifier 880 */ 865 881 public void actionPerformed(ActionEvent event) { 866 882 String name = (String)classifier.getSelectedItem(); … … 928 944 assigned.refresh(); 929 945 } 930 cc. destroy(); // Remove gui prompt or else.946 cc.hide(); // Remove gui prompt or else. 931 947 cc = null; 932 948 } … … 939 955 private class ConfigureListener 940 956 implements ActionListener { 941 942 943 944 945 946 957 /** Any implementation of <i>ActionListener</i> must include this method so that we can be informed when an action has occured on one of our target controls. 958 * @param event An <strong>ActionEvent</strong> containing information garnered from the control action. 959 * @see org.greenstone.gatherer.cdm.ArgumentConfiguration 960 * @see org.greenstone.gatherer.cdm.Classifier 961 * @see org.greenstone.gatherer.cdm.CustomClassifier 962 */ 947 963 public void actionPerformed(ActionEvent event) { 948 964 if(!classifier_list.isSelectionEmpty()) { … … 961 977 assigned.refresh(); 962 978 } 963 cc. destroy(); // Remove gui prompt or else.979 cc.hide(); // Remove gui prompt or else. 964 980 cc = null; 965 981 } … … 981 997 assignClassifier(custom_classifier); 982 998 } 983 custom_classifier. destroy(); // Remove gui prompt or else.999 custom_classifier.hide(); // Remove gui prompt or else. 984 1000 custom_classifier = null; 985 1001 }
Note:
See TracChangeset
for help on using the changeset viewer.