Changeset 8992
- Timestamp:
- 2005-02-10T11:31:41+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r8813 r8992 241 241 242 242 // also check for wget 243 boolean mirror_workflow = Configuration.get(StaticStrings.WORKFLOW_MIRROR, false);244 if ( mirror_workflow) {243 boolean download_workflow = Configuration.get("workflow.download", false); 244 if (download_workflow) { 245 245 wget_version_str = StaticStrings.NO_WGET_STR; 246 246 // has the user specified a path? -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeModel.java
r8787 r8992 87 87 workspace_tree_root.add(FileSystem.getHomeFolderNode()); 88 88 89 // Add the "Downloaded Files" node, if Mirroringis enabled90 if (Gatherer.g_man. mirror_pane != null) {89 // Add the "Downloaded Files" node, if the Download pane is enabled 90 if (Gatherer.g_man.download_pane != null) { 91 91 downloaded_files_node = FileSystem.getDownloadedFilesNode(); 92 92 workspace_tree_root.add(downloaded_files_node); -
trunk/gli/src/org/greenstone/gatherer/gems/GEMSPreferences.java
r8971 r8992 55 55 static final private Dimension SIZE = new Dimension(640, 345); 56 56 57 //private EmailField email_field;58 57 private JButton apply_button; 59 58 private JButton cancel_button; 60 59 private JButton ok_button; 61 62 private JCheckBox use_proxy_checkbox;63 private JCheckBox workflow_create;64 private JCheckBox workflow_mirror;65 private JCheckBox workflow_gather;66 private JCheckBox workflow_enrich;67 private JCheckBox workflow_design;68 private JCheckBox workflow_export;69 60 70 61 private JComboBox language_combobox; … … 177 168 178 169 Dictionary.registerText(interface_language_label, "GEMS.Preferences.Selected_Languages_Tooltip"); 179 //email_field = new EmailField(Configuration.getColor("coloring.error_background", false));180 //email_field.setText(Configuration.getEmail());181 //Dictionary.registerTooltip(email_field, "GEMS.Preferences.Selected_Languages_Tooltip");182 170 183 171 // Language -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r8813 r8992 67 67 extends JFrame 68 68 implements ActionListener, ChangeListener { 69 /** The mirror pane contains controls for mirroring internet sites. */70 public MirrorPane mirror_pane = null;69 /** The download pane contains controls for downloading internet sites. */ 70 public DownloadPane download_pane = null; 71 71 /** The gather pane is more like a file manager where you drag files from one tree to another. */ 72 72 private GatherPane gather_pane = null; … … 93 93 /** The panel within the window that other components are placed on. */ 94 94 private JPanel content_pane = null; 95 /** The dummy export pane. */96 private JPanel export_pane = new JPanel();97 95 /** The last view pane selected. */ 98 96 private JPanel previous_pane; … … 237 235 // Help Options. 238 236 // ************* 239 else if(esrc == menu_bar.help_about) { 237 else if (esrc == menu_bar.help_general) { 238 HelpFrame.setView("introduction"); 239 } 240 else if (esrc == menu_bar.help_download) { 241 HelpFrame.setView("downloadingfiles"); 242 } 243 else if (esrc == menu_bar.help_gather) { 244 HelpFrame.setView("collectingfiles"); 245 } 246 else if (esrc == menu_bar.help_enrich) { 247 HelpFrame.setView("enrichingacollection"); 248 } 249 else if (esrc == menu_bar.help_design) { 250 HelpFrame.setView("designingacollection"); 251 } 252 else if (esrc == menu_bar.help_create) { 253 HelpFrame.setView("producingthecollection"); 254 } 255 else if (esrc == menu_bar.help_about) { 240 256 new AboutDialog(this); 241 257 } 242 else if(esrc == menu_bar.help_build) {243 HelpFrame.setView("producingthecollection");244 }245 else if(esrc == menu_bar.help_collect) {246 HelpFrame.setView("collectingfiles");247 }248 else if(esrc == menu_bar.help_design) {249 HelpFrame.setView("designingacollection");250 }251 else if(esrc == menu_bar.help_general) {252 HelpFrame.setView("introduction");253 }254 else if(esrc == menu_bar.help_metaedit) {255 HelpFrame.setView("enrichingacollection");256 }257 else if(esrc == menu_bar.help_mirror) {258 HelpFrame.setView("downloadingfiles");259 }260 else if(esrc == menu_bar.help_preview) {261 HelpFrame.setView("previewingthecollection");262 }263 258 } 264 259 … … 267 262 */ 268 263 public void afterDisplay() { 269 if ( mirror_pane != null) {270 mirror_pane.afterDisplay();264 if (download_pane != null) { 265 download_pane.afterDisplay(); 271 266 } 272 267 enrich_pane.afterDisplay(); … … 330 325 tab_pane.setFont(Configuration.getFont("general.font", false)); 331 326 332 if(Configuration.get( StaticStrings.WORKFLOW_MIRROR, true)) {333 mirror_pane = new MirrorPane();334 tab_pane.addTab("GUI. Mirror", Utility.getImage("mirroring.gif"), mirror_pane);335 tab_pane.setEnabledAt(tab_pane.indexOfComponent( mirror_pane), Configuration.get(StaticStrings.WORKFLOW_MIRROR, false));327 if(Configuration.get("workflow.download", true)) { 328 download_pane = new DownloadPane(); 329 tab_pane.addTab("GUI.Download", Utility.getImage("mirroring.gif"), download_pane); 330 tab_pane.setEnabledAt(tab_pane.indexOfComponent(download_pane), Configuration.get("workflow.download", false)); 336 331 } 337 332 … … 355 350 tab_pane.addTab("GUI.Design", Utility.getImage("build.gif"), design_pane); 356 351 tab_pane.setEnabledAt(tab_pane.indexOfComponent(design_pane), false); 357 }358 359 if(Configuration.get("workflow.export", true)) {360 tab_pane.addTab("GUI.Export", Utility.getImage("export.gif"), export_pane);361 tab_pane.setEnabledAt(tab_pane.indexOfComponent(export_pane), false);362 352 } 363 353 … … 442 432 public void lockCollection(boolean import_stage, boolean lock) { 443 433 locked = lock; 444 if (import_stage) {445 int collection_pos = tab_pane.indexOfComponent(gather_pane);446 int metaedit_pos = tab_pane.indexOfComponent(enrich_pane);447 int config_pos = tab_pane.indexOfComponent(design_pane);448 tab_pane.setEnabledAt( collection_pos, !lock);449 tab_pane.setEnabledAt( metaedit_pos, !lock);450 tab_pane.setEnabledAt( config_pos, !lock);434 if (import_stage) { 435 int gather_pos = tab_pane.indexOfComponent(gather_pane); 436 int enrich_pos = tab_pane.indexOfComponent(enrich_pane); 437 int design_pos = tab_pane.indexOfComponent(design_pane); 438 tab_pane.setEnabledAt(gather_pos, !lock); 439 tab_pane.setEnabledAt(enrich_pos, !lock); 440 tab_pane.setEnabledAt(design_pos, !lock); 451 441 } 452 442 else { 453 int config_pos = tab_pane.indexOfComponent(design_pane);454 tab_pane.setEnabledAt( config_pos, !lock);443 int design_pos = tab_pane.indexOfComponent(design_pane); 444 tab_pane.setEnabledAt(design_pos, !lock); 455 445 } 456 446 } … … 470 460 collection_name = null; 471 461 // Now pass on the message to anyone who cares 472 if(gather_pane != null) { 462 if (download_pane != null) { 463 download_pane.modeChanged(mode); 464 } 465 if (gather_pane != null) { 473 466 gather_pane.modeChanged(mode); 474 467 } 475 if(design_pane != null) { 468 if (enrich_pane != null) { 469 enrich_pane.modeChanged(mode); 470 } 471 if (design_pane != null) { 476 472 design_pane.modeChanged(mode); 477 473 } 478 if (create_pane != null) {474 if (create_pane != null) { 479 475 create_pane.modeChanged(mode); 480 }481 if(enrich_pane != null) {482 enrich_pane.modeChanged(mode);483 }484 if (mirror_pane != null) {485 mirror_pane.modeChanged(mode);486 476 } 487 477 } … … 503 493 504 494 // Update the loaded panes 505 if ( mirror_pane != null) {506 mirror_pane.refresh(refresh_reason, collection_loaded);495 if (download_pane != null) { 496 download_pane.refresh(refresh_reason, collection_loaded); 507 497 } 508 498 if (gather_pane != null) { … … 566 556 // Some tabs are also dependant on if a collection is ready 567 557 Component component = tab_pane.getComponentAt(index); 568 if(component == enrich_pane || component == design_pane || component == export_pane || component ==create_pane) {558 if(component == enrich_pane || component == design_pane || component == create_pane) { 569 559 tab_pane.setEnabledAt(index, state && Gatherer.c_man != null && Gatherer.c_man.ready()); 570 560 } … … 586 576 } 587 577 } 588 }589 // If the rawname was mirror then rebuild workspace tree to remove caches.590 if (rawname.equals("Mirror")) {591 // gather_pane.refreshWorkspaceTree(WorkspaceTree.FOLDER_SHORTCUTS_CHANGED);592 578 } 593 579 } … … 754 740 menu_bar.tabSelected(tab_pane.getSelectedIndex()); 755 741 int selected_index = tab_pane.getSelectedIndex(); 756 if (selected_index == tab_pane.indexOfComponent( mirror_pane)) {757 mirror_pane.gainFocus();742 if (selected_index == tab_pane.indexOfComponent(download_pane)) { 743 download_pane.gainFocus(); 758 744 } 759 745 else if (selected_index == tab_pane.indexOfComponent(gather_pane)) { … … 781 767 pane.updateUI(); 782 768 // Also update all of the tabs according to workflow. 783 workflowUpdate(" Mirror", Configuration.get("workflow.mirror", false));769 workflowUpdate("Download", Configuration.get("workflow.download", false)); 784 770 workflowUpdate("Gather", Configuration.get("workflow.gather", false)); 785 771 workflowUpdate("Enrich", Configuration.get("workflow.enrich", false)); 786 772 workflowUpdate("Design", Configuration.get("workflow.design", false)); 787 workflowUpdate("Export", Configuration.get("workflow.export", false));788 773 workflowUpdate("Create", Configuration.get("workflow.create", false)); 789 774 } … … 852 837 implements Runnable { 853 838 private boolean ready = false; 854 private int mirror_pos = -1;839 private int download_pos = -1; 855 840 private int enrich_pos = -1; 856 841 private int design_pos = -1; … … 862 847 this.ready = ready; 863 848 this.tab_pane = tab_pane; 864 mirror_pos = tab_pane.indexOfComponent(mirror_pane);849 download_pos = tab_pane.indexOfComponent(download_pane); 865 850 enrich_pos = tab_pane.indexOfComponent(enrich_pane); 866 851 design_pos = tab_pane.indexOfComponent(design_pane); 867 852 create_pos = tab_pane.indexOfComponent(create_pane); 868 export_pos = tab_pane.indexOfComponent(export_pane);869 853 } 870 854 871 855 public void run() 872 856 { 873 if ( mirror_pos != -1) {857 if (download_pos != -1) { 874 858 if (ready) { 875 tab_pane.setEnabledAt( mirror_pos, Configuration.get("workflow.mirror", false));859 tab_pane.setEnabledAt(download_pos, Configuration.get("workflow.download", false)); 876 860 } 877 861 else { 878 tab_pane.setEnabledAt( mirror_pos, Configuration.get("workflow.mirror", true));862 tab_pane.setEnabledAt(download_pos, Configuration.get("workflow.download", true)); 879 863 } 880 864 } … … 887 871 if (create_pos != -1) { 888 872 tab_pane.setEnabledAt(create_pos, ready && Configuration.get("workflow.create", false)); 889 }890 if (export_pos != -1) {891 tab_pane.setEnabledAt(export_pos, ready && Configuration.get("workflow.export", false));892 873 } 893 874 } -
trunk/gli/src/org/greenstone/gatherer/gui/MenuBar.java
r8588 r8992 70 70 public JMenuItem edit_cut; 71 71 public JMenuItem edit_paste; 72 public JMenuItem help_general; 73 public JMenuItem help_download; 74 public JMenuItem help_gather; 75 public JMenuItem help_enrich; 76 public JMenuItem help_design; 77 public JMenuItem help_create; 72 78 public JMenuItem help_about; 73 public JMenuItem help_browse; 74 public JMenuItem help_build; 75 public JMenuItem help_collect; 76 public JMenuItem help_design; 77 public JMenuItem help_export; 78 public JMenuItem help_general; 79 public JMenuItem help_metaedit; 80 public JMenuItem help_mirror ; 81 public JMenuItem help_preview; 79 82 80 83 81 public MenuBar(MenuListener menu_listener) … … 178 176 Dictionary.setText(help, "Menu.Help"); 179 177 178 help_general = new JMenuItem(); 179 help_general.addActionListener(Gatherer.g_man); 180 Dictionary.registerText(help_general, "Source.General"); 181 182 help_download = new JMenuItem(Utility.BLANK_ICON); 183 help_download.addActionListener(Gatherer.g_man); 184 Dictionary.registerText(help_download, "GUI.Download"); 185 186 help_gather = new JMenuItem(Utility.BLANK_ICON); 187 help_gather.addActionListener(Gatherer.g_man); 188 Dictionary.registerText(help_gather, "GUI.Gather"); 189 190 help_enrich = new JMenuItem(Utility.BLANK_ICON); 191 help_enrich.addActionListener(Gatherer.g_man); 192 Dictionary.registerText(help_enrich, "GUI.Enrich"); 193 194 help_design = new JMenuItem(Utility.BLANK_ICON); 195 help_design.addActionListener(Gatherer.g_man); 196 Dictionary.registerText(help_design, "GUI.Design"); 197 198 help_create = new JMenuItem(Utility.BLANK_ICON); 199 help_create.addActionListener(Gatherer.g_man); 200 Dictionary.registerText(help_create, "GUI.Create"); 201 180 202 help_about = new JMenuItem(); 181 203 help_about.addActionListener(Gatherer.g_man); 182 204 Dictionary.registerText(help_about, "Menu.Help_About"); 183 205 184 help_browse = new JMenuItem(Utility.BLANK_ICON);185 help_browse.addActionListener(Gatherer.g_man);186 Dictionary.registerText(help_browse, "GUI.Hunt");187 188 help_build = new JMenuItem(Utility.BLANK_ICON);189 help_build.addActionListener(Gatherer.g_man);190 Dictionary.registerText(help_build, "GUI.Create");191 192 help_collect = new JMenuItem(Utility.BLANK_ICON);193 help_collect.addActionListener(Gatherer.g_man);194 Dictionary.registerText(help_collect, "GUI.Gather");195 196 help_design = new JMenuItem(Utility.BLANK_ICON);197 help_design.addActionListener(Gatherer.g_man);198 Dictionary.registerText(help_design, "GUI.Design");199 200 help_export = new JMenuItem(Utility.BLANK_ICON);201 help_export.addActionListener(Gatherer.g_man);202 Dictionary.registerText(help_export, "GUI.Export");203 204 help_general = new JMenuItem();205 help_general.addActionListener(Gatherer.g_man);206 Dictionary.registerText(help_general, "Source.General");207 208 help_metaedit = new JMenuItem(Utility.BLANK_ICON);209 help_metaedit.addActionListener(Gatherer.g_man);210 Dictionary.registerText(help_metaedit, "GUI.Enrich");211 212 help_mirror = new JMenuItem(Utility.BLANK_ICON);213 help_mirror.addActionListener(Gatherer.g_man);214 Dictionary.registerText(help_mirror, "GUI.Mirror");215 216 help_preview = new JMenuItem(Utility.BLANK_ICON);217 help_preview.addActionListener(Gatherer.g_man);218 Dictionary.registerText(help_preview, "GUI.Preview");219 220 206 // Layout (help menu) 221 207 help.add(help_general); 222 208 help.add(new JSeparator()); 223 if (Configuration.get("workflow.browse", true)) { 224 help.add(help_browse); 225 } 226 if (Configuration.get("workflow.mirror", true)) { 227 help.add(help_mirror); 209 if (Configuration.get("workflow.download", true)) { 210 help.add(help_download); 228 211 } 229 212 if (Configuration.get("workflow.gather", true)) { 230 help.add(help_ collect);213 help.add(help_gather); 231 214 } 232 215 if (Configuration.get("workflow.enrich", true)) { 233 help.add(help_ metaedit);216 help.add(help_enrich); 234 217 } 235 218 if (Configuration.get("workflow.design", true)) { 236 219 help.add(help_design); 237 220 } 238 if (Configuration.get("workflow.export", true)) {239 help.add(help_export);240 }241 221 if (Configuration.get("workflow.create", true)) { 242 help.add(help_build); 243 } 244 if (Configuration.get("workflow.preview", true)) { 245 help.add(help_preview); 222 help.add(help_create); 246 223 } 247 224 help.add(new JSeparator()); … … 291 268 selected = null; 292 269 } 293 294 295 // public class MagicMenuItem296 // extends JMenuItem {297 298 // private boolean can_enable;299 // private boolean should_enable;300 301 // public MagicMenuItem(String title, int key_event) {302 // super(title, key_event);303 // super.setEnabled(false);304 // can_enable = false;305 // should_enable = false;306 // }307 308 // public void setCanEnable(boolean can_enable) {309 // this.can_enable = can_enable;310 // if (can_enable) {311 // super.setEnabled(should_enable);312 // }313 // else {314 // super.setEnabled(false);315 // }316 // }317 318 // public void setEnabled(boolean should_enable) {319 // this.should_enable = should_enable;320 // if (can_enable) {321 // super.setEnabled(should_enable);322 // }323 // }324 // }325 270 } -
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r8884 r8992 69 69 private JCheckBox use_proxy_checkbox; 70 70 private JCheckBox view_extracted_metadata_checkbox; 71 private JCheckBox workflow_ mirror;71 private JCheckBox workflow_download; 72 72 private JCheckBox workflow_gather; 73 73 private JCheckBox workflow_enrich; … … 533 533 Dictionary.registerText(title_label, "Preferences.Workflow.Title"); 534 534 535 workflow_ mirror= new JCheckBox();536 workflow_ mirror.setSelected(Configuration.get("workflow.mirror", false));537 workflow_ mirror.setPreferredSize(ROW_SIZE);538 Dictionary.registerText(workflow_ mirror, "Preferences.Workflow.Mirror");535 workflow_download = new JCheckBox(); 536 workflow_download.setSelected(Configuration.get("workflow.download", false)); 537 workflow_download.setPreferredSize(ROW_SIZE); 538 Dictionary.registerText(workflow_download, "Preferences.Workflow.Download"); 539 539 540 540 workflow_gather = new JCheckBox(); … … 569 569 checklist_pane.setLayout(new BoxLayout(checklist_pane, BoxLayout.Y_AXIS)); 570 570 checklist_pane.add(title_label); 571 if (Configuration.get("workflow. mirror", true)) {572 checklist_pane.add(workflow_ mirror);571 if (Configuration.get("workflow.download", true)) { 572 checklist_pane.add(workflow_download); 573 573 } 574 574 if (Configuration.get("workflow.gather", true)) { … … 696 696 697 697 // Workflow preferences 698 Configuration.set("workflow. mirror", false, workflow_mirror.isSelected());698 Configuration.set("workflow.download", false, workflow_download.isSelected()); 699 699 Configuration.set("workflow.gather", false, workflow_gather.isSelected()); 700 700 Configuration.set("workflow.enrich", false, workflow_enrich.isSelected()); 701 701 Configuration.set("workflow.design", false, workflow_design.isSelected()); 702 702 Configuration.set("workflow.create", false, workflow_create.isSelected()); 703 Gatherer.g_man.workflowUpdate(" Mirror", workflow_mirror.isSelected());703 Gatherer.g_man.workflowUpdate("Download", workflow_download.isSelected()); 704 704 Gatherer.g_man.workflowUpdate("Gather", workflow_gather.isSelected()); 705 705 Gatherer.g_man.workflowUpdate("Enrich", workflow_enrich.isSelected()); … … 795 795 } 796 796 public void run() { 797 workflow_ mirror.setSelected(element.getEnabled("mirror"));797 workflow_download.setSelected(element.getEnabled("download")); 798 798 workflow_gather.setSelected(element.getEnabled("gather")); 799 799 workflow_enrich.setSelected(element.getEnabled("enrich")); -
trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java
r8978 r8992 242 242 static final public String WIN_9X_OPEN_COMMAND = "command.com /c start \"%1\""; 243 243 static final public String WIN_OPEN_COMMAND = "cmd.exe /c start \"\" \"%1\""; 244 static final public String WORKFLOW_MIRROR = "workflow.mirror";245 244 static final public String YES_STR = "yes"; 246 245 static final public String ZERO_CHARACTER = "0";
Note:
See TracChangeset
for help on using the changeset viewer.