Changeset 7482
- Timestamp:
- 2004-05-27T17:12:03+12:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r7326 r7482 138 138 Gatherer.config.addDirectoryMapping(name, file); 139 139 // Now update the tree 140 Gatherer.g_man. gather_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);140 Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED); 141 141 } 142 142 /** This method calls the builcol.pl scripts via a GShell so as to not lock up the processor. … … 476 476 // workspace_model = null; 477 477 // set the view to Gather pane 478 Gatherer.g_man. setSelectedView(Gatherer.g_man.gather_pane);478 Gatherer.g_man.returnToInitialPane(); 479 479 Gatherer.g_man.collectionChanged(ready()); 480 480 } … … 1198 1198 File file = Gatherer.config.removeDirectoryMapping(target.toString()); 1199 1199 // Update tree. 1200 Gatherer.g_man. gather_pane.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED);1200 Gatherer.g_man.refreshWorkspaceTree(WorkspaceTree.MAPPED_DIRECTORIES_CHANGED); 1201 1201 return file; 1202 1202 } -
trunk/gli/src/org/greenstone/gatherer/collection/DeleteCollectionPrompt.java
r7326 r7482 326 326 list_model.removeElement(collection); 327 327 328 // Refresh the collect s shown in the workspace tree329 Gatherer.g_man. gather_pane.refreshWorkspaceTree(DragTree.LIBRARY_CONTENTS_CHANGED);328 // Refresh the collections shown in the workspace tree 329 Gatherer.g_man.refreshWorkspaceTree(DragTree.LIBRARY_CONTENTS_CHANGED); 330 330 331 331 resultPrompt(true); -
trunk/gli/src/org/greenstone/gatherer/collection/Job.java
r6842 r7482 481 481 progress.downloadComplete(); 482 482 Gatherer.println("Current File: " + current_file_downloading); 483 // !! TEMPORARILY DISABLED !! 483 484 //WorkspaceTreeModel.refreshWebCacheMappings(); 484 if(Gatherer.g_man.gather_pane.workspace_tree != null) {485 FileSystemModel tree_model = (FileSystemModel) Gatherer.g_man.gather_pane.workspace_tree.getModel();486 File new_file = new File(current_file_downloading);487 File parent_file = new_file.getParentFile();488 String download_cache = Utility.getCacheDir().getAbsolutePath();489 ArrayList raw_path = new ArrayList();490 while(parent_file != null && !parent_file.getAbsolutePath().equals(download_cache)) {491 raw_path.add(0, parent_file.getName());492 parent_file = parent_file.getParentFile();493 }494 download_cache = null;495 // Add download cache name496 /** @todo - add to dictionary */497 raw_path.add(0, "Mirroring.Mirror_Cache");498 // And the root node499 raw_path.add(0, tree_model.getRoot());500 TreePath destination_path = new TreePath(raw_path.toArray());501 raw_path = null;502 // Retrieve the destination node503 FileNode destination_node = (FileNode) tree_model.getNode(destination_path);504 // destination_path = null;505 //FileNode new_file_node = new FileNode(new_file);506 507 // It suddenly occurs to me that by retrieving the destination path, we are causing the potential destination node to map its children which includes the file which I am about to add. Hence I was ending up with two copies.508 ///atherer.println("Ready to insert new FileNode.");509 Gatherer.println("Model: " + tree_model);510 Gatherer.println("Destination path: " + destination_path);511 destination_node.unmap();512 ///atherer.println("Destination node: " + destination_node);513 ///atherer.println("New node: " + new_file_node);514 //SynchronizedTreeModelTools.insertNodeInto(tree_model, destination_node, new_file_node);515 516 //new_file_node = null;517 destination_node = null;518 tree_model = null;519 }520 url = null;521 current_url = null;485 // if(Gatherer.g_man.gather_pane.workspace_tree != null) { 486 // FileSystemModel tree_model = (FileSystemModel) Gatherer.g_man.gather_pane.workspace_tree.getModel(); 487 // File new_file = new File(current_file_downloading); 488 // File parent_file = new_file.getParentFile(); 489 // String download_cache = Utility.getCacheDir().getAbsolutePath(); 490 // ArrayList raw_path = new ArrayList(); 491 // while(parent_file != null && !parent_file.getAbsolutePath().equals(download_cache)) { 492 // raw_path.add(0, parent_file.getName()); 493 // parent_file = parent_file.getParentFile(); 494 // } 495 // download_cache = null; 496 // // Add download cache name 497 // /** @todo - add to dictionary */ 498 // raw_path.add(0, "Mirroring.Mirror_Cache"); 499 // // And the root node 500 // raw_path.add(0, tree_model.getRoot()); 501 // TreePath destination_path = new TreePath(raw_path.toArray()); 502 // raw_path = null; 503 // // Retrieve the destination node 504 // FileNode destination_node = (FileNode) tree_model.getNode(destination_path); 505 // // destination_path = null; 506 // //FileNode new_file_node = new FileNode(new_file); 507 508 // // It suddenly occurs to me that by retrieving the destination path, we are causing the potential destination node to map its children which includes the file which I am about to add. Hence I was ending up with two copies. 509 // ///atherer.println("Ready to insert new FileNode."); 510 // Gatherer.println("Model: " + tree_model); 511 // Gatherer.println("Destination path: " + destination_path); 512 // destination_node.unmap(); 513 // ///atherer.println("Destination node: " + destination_node); 514 // ///atherer.println("New node: " + new_file_node); 515 // //SynchronizedTreeModelTools.insertNodeInto(tree_model, destination_node, new_file_node); 516 517 // //new_file_node = null; 518 // destination_node = null; 519 // tree_model = null; 520 // } 521 // url = null; 522 // current_url = null; 522 523 } 523 524 -
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r7360 r7482 575 575 } 576 576 synchronized(this) { 577 ///ystem.err.println("Queue size = " + queue.size()); 578 // Force the trees to refresh (but only if there is something on screen!) 579 if(Gatherer.g_man != null) { 580 Gatherer.g_man.refreshTrees(DragTree.COLLECTION_CONTENTS_CHANGED); 581 } 577 // Force both workspace and collection trees to refresh 578 if (Gatherer.g_man != null) { 579 Gatherer.g_man.refreshWorkspaceTree(DragTree.COLLECTION_CONTENTS_CHANGED); 580 Gatherer.g_man.refreshCollectionTree(DragTree.COLLECTION_CONTENTS_CHANGED); 581 } 582 582 583 // Reset status area 583 584 file_status.setText(Dictionary.get("FileActions.No_Activity")); -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r7326 r7482 91 91 public MirrorPane mirror_pane = null; 92 92 /** The gather pane is more like a file manager where you drag files from one tree to another. */ 93 p ublicGatherPane gather_pane = null;93 private GatherPane gather_pane = null; 94 94 /** The enrich pane is used to assign, edit and remove metadata from files within the collection. */ 95 95 public EnrichPane enrich_pane = null; … … 619 619 } 620 620 621 public void refreshTrees(int refresh_reason) 621 622 public void refreshCollectionTree(int refresh_reason) 623 { 624 if (gather_pane != null) { 625 gather_pane.refreshCollectionTree(refresh_reason); 626 } 627 } 628 629 630 public void refreshWorkspaceTree(int refresh_reason) 622 631 { 623 632 if (gather_pane != null) { 624 633 gather_pane.refreshWorkspaceTree(refresh_reason); 625 gather_pane.refreshCollectionTree(refresh_reason); 626 } 627 } 628 629 /** Allows the system to programatically set the selected tab. 630 * @param component The view you wish to make visable in the tab pane as a <strong>Component</strong>. 631 */ 632 public void setSelectedView(Component component) { 633 tab_pane.setSelectedComponent(component); 634 } 634 } 635 } 636 637 638 /** Returns to some "initial" pane (when no collection is loaded) */ 639 public void returnToInitialPane() 640 { 641 if (gather_pane != null) { 642 tab_pane.setSelectedComponent(gather_pane); 643 } 644 } 645 635 646 636 647 /** Specifies whether a certain tab is enabled or not. */ -
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r7360 r7482 81 81 /** The collection model which is used to build, and hold the data of, the collection tree. */ 82 82 private TreeModel collection = null; 83 /** The Tree model used as the data source for the workspace tree. */84 private TreeModel workspace = null;85 83 /** The button used to cancel all pending file queue jobs. */ 86 84 private JButton stop_action = null; … … 111 109 /** Ensures that expansion and selection events between collection trees based on the same model are synchronized. */ 112 110 private TreeSynchronizer collection_tree_sync = null; 113 /** Ensures that expansion and selection events between workspace trees based on the same model are synchronized. */114 private TreeSynchronizer workspace_tree_sync = null;115 111 /** The button used to delete files, which also doubles as a drop target for files from the Trees. */ 116 112 private UndoManager bin_button = null; … … 125 121 126 122 /** The tree showing the available source workspace. */ 127 public WorkspaceTree workspace_tree = null; 123 private WorkspaceTree workspace_tree = null; 124 128 125 129 126 /* Constructor. … … 136 133 this.file_queue = Gatherer.f_man.getQueue(); 137 134 this.collection_tree_sync = collection_tree_sync; 138 this.workspace_tree_sync = workspace_tree_sync;139 135 140 136 // Create components. -
trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r7339 r7482 737 737 738 738 Gatherer.config.set("general.show_file_size", Configuration.COLLECTION_SPECIFIC, show_file_size_checkbox.isSelected()); 739 Gatherer.g_man.refreshTrees(DragTree.TREE_DISPLAY_CHANGED); 739 // Force both workspace and collection trees to redraw 740 if (Gatherer.g_man != null) { 741 Gatherer.g_man.refreshWorkspaceTree(DragTree.COLLECTION_CONTENTS_CHANGED); 742 Gatherer.g_man.refreshCollectionTree(DragTree.COLLECTION_CONTENTS_CHANGED); 743 } 740 744 741 745 Gatherer.config.set("general.view_extracted_metadata", Configuration.COLLECTION_SPECIFIC, view_extracted_metadata_checkbox.isSelected()); -
trunk/gli/src/org/greenstone/gatherer/gui/tree/WorkspaceTree.java
r6086 r7482 17 17 18 18 19 public WorkspaceTree(String name) { 19 public WorkspaceTree(String name) 20 { 20 21 super(name, WorkspaceTreeModel.getWorkspaceTreeModel(), null, true); 21 22 } 22 23 23 24 24 public void refresh(int refresh_reason) { 25 public void refresh(int refresh_reason) 26 { 25 27 Gatherer.println("WorkspaceTree::refresh()... "); 26 28 … … 47 49 48 50 // The method for displaying the tree has changed - redraw the tree 49 if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) {50 Gatherer.println("...Reason: tree display changed.");51 updateUI();52 }51 if (refresh_reason == DragTree.TREE_DISPLAY_CHANGED) { 52 Gatherer.println("...Reason: tree display changed."); 53 updateUI(); 54 } 53 55 54 56 // The collection specific mapped directories have changed - refresh only them … … 82 84 } 83 85 84 // If the collection import directoryis open, it must be refreshed86 // If the specified folder is open, it must be refreshed 85 87 if (tree_node_path_str.equals(folder_path_str)) { 86 88 System.err.println("Must refresh node " + tree_node_path_str + "!");
Note:
See TracChangeset
for help on using the changeset viewer.