Changeset 8846
- Timestamp:
- 2004-12-17T15:07:36+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/Collection.java
r8783 r8846 129 129 /** Determine the number of documents and folders in this collection. */ 130 130 public int getCount() { 131 return getCount((TreeNode)Gatherer.c_man.get RecordSet().getRoot(), true, true);131 return getCount((TreeNode)Gatherer.c_man.getCollectionTreeModel().getRoot(), true, true); 132 132 } 133 133 134 134 /** Calculates the number of documents in this collection. */ 135 135 public int getDocumentCount() { 136 return getCount((TreeNode)Gatherer.c_man.get RecordSet().getRoot(), false, true);136 return getCount((TreeNode)Gatherer.c_man.getCollectionTreeModel().getRoot(), false, true); 137 137 } 138 138 -
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r8813 r8846 704 704 705 705 706 /** Retrieve the record set (tree model) associated with the current collection. */ 707 public TreeModel getRecordSet() { 706 /** Retrieve the tree model associated with the current collection. */ 707 public CollectionTreeModel getCollectionTreeModel() 708 { 708 709 if (collection_model == null && collection != null) { 709 710 // Use the import directory to generate a new CollectionTreeModel -
trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTree.java
r8783 r8846 47 47 public WorkspaceTree(String name) 48 48 { 49 super(name, WorkspaceTreeModel.getWorkspaceTreeModel(), null,true);49 super(name, WorkspaceTreeModel.getWorkspaceTreeModel(), true); 50 50 } 51 51 -
trunk/gli/src/org/greenstone/gatherer/gui/EnrichPane.java
r8813 r8846 50 50 import org.greenstone.gatherer.Dictionary; 51 51 import org.greenstone.gatherer.Gatherer; 52 import org.greenstone.gatherer.collection.Collection Manager;52 import org.greenstone.gatherer.collection.CollectionTree; 53 53 import org.greenstone.gatherer.collection.CollectionTreeNode; 54 54 import org.greenstone.gatherer.gui.tree.DragTree; … … 123 123 private JTextField table_label; 124 124 /** A reference to the collection tree. */ 125 private DragTree collection_tree;125 private CollectionTree collection_tree; 126 126 /** Provide synchronization between the collection trees in this view and the collection pane view. */ 127 127 private TreeSynchronizer collection_tree_sync = null; … … 235 235 /** Used to create, connect and layout the components to be shown on this control panel. 236 236 * @see org.greenstone.gatherer.Gatherer 237 * @see org.greenstone.gatherer.collection.CollectionManager238 237 * @see org.greenstone.gatherer.file.FileOpenActionListener 239 238 * @see org.greenstone.gatherer.gui.Filter … … 253 252 254 253 DragGroup group = new DragGroup(); 255 TreeModel collection_model = Gatherer.c_man.getRecordSet(); 256 if (collection_model != null) { 257 collection_tree = new DragTree("Enrich", collection_model, null, false); 258 } 259 else { 260 collection_tree = new DragTree("Enrich", null, false); 261 } 254 collection_tree = new CollectionTree("Enrich", Gatherer.c_man.getCollectionTreeModel(), false); 262 255 group.add(collection_tree); 263 256 collection_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); … … 456 449 // Update collection tree 457 450 if (refresh_reason == Gatherer.COLLECTION_OPENED) { 458 collection_tree.setModel(Gatherer.c_man.get RecordSet());451 collection_tree.setModel(Gatherer.c_man.getCollectionTreeModel()); 459 452 } 460 453 -
trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java
r8813 r8846 48 48 import org.greenstone.gatherer.Dictionary; 49 49 import org.greenstone.gatherer.Gatherer; 50 import org.greenstone.gatherer.collection.CollectionTree; 50 51 import org.greenstone.gatherer.collection.CollectionTreeNode; 51 import org.greenstone.gatherer.collection.CollectionManager;52 52 import org.greenstone.gatherer.file.FileNode; 53 53 import org.greenstone.gatherer.file.FileOpenActionListener; … … 73 73 private DragGroup group = null; 74 74 /** The tree showing the files within the collection. */ 75 private DragTree collection_tree =null;75 private CollectionTree collection_tree = null; 76 76 /** The threaded queue that handles the actually movement of files, so that the gui remains responsive. */ 77 77 private FileQueue file_queue = null; … … 80 80 /** The filter currently applied to the workspace tree. */ 81 81 private Filter workspace_filter = null; 82 /** The collection model which is used to build, and hold the data of, the collection tree. */83 private TreeModel collection = null;84 82 /** The button used to cancel all pending file queue jobs. */ 85 83 private JButton stop_action = null; … … 259 257 Dictionary.registerText(collection_label, "Collection.No_Collection"); 260 258 261 collection = Gatherer.c_man.getRecordSet(); 262 if (collection != null) { 263 collection_tree = new DragTree(Utility.COLLECTION_TREE, collection, null, true); 264 collection_tree.setEnabled(true); 265 } 266 else { 267 collection_tree = new DragTree(Utility.COLLECTION_TREE, null, true); 268 collection_tree.setEnabled(false); 269 } 259 collection_tree = new CollectionTree(Utility.COLLECTION_TREE, Gatherer.c_man.getCollectionTreeModel(), true); 260 collection_tree.setEnabled(Gatherer.c_man.getCollectionTreeModel() != null); 270 261 group.add(collection_tree); 271 262 collection_tree.addFocusListener(this); … … 425 416 // Update collection tree 426 417 if (refresh_reason == Gatherer.COLLECTION_OPENED) { 427 collection_tree.setModel(Gatherer.c_man.get RecordSet());418 collection_tree.setModel(Gatherer.c_man.getCollectionTreeModel()); 428 419 } 429 420 -
trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java
r8813 r8846 22 22 import org.greenstone.gatherer.util.Utility; 23 23 24 public class DragTree24 public abstract class DragTree 25 25 extends JTree 26 26 implements Autoscroll, DragGestureListener, DragSourceListener, DropTargetListener, DragComponent, TreeSelectionListener { … … 63 63 64 64 65 public DragTree(String name, String background_name, boolean mixed_selection) { 66 super(); 67 init(name, background_name, mixed_selection); 68 } 69 70 public DragTree(String name, TreeModel model, String background_name, boolean mixed_selection) { 65 public DragTree(String name, TreeModel model, boolean mixed_selection) 66 { 71 67 super(model); 72 init(name, background_name, mixed_selection); 68 init(name, mixed_selection); 69 73 70 // Connection 74 71 setModel(model); 75 72 } 76 73 77 public void init(String name, String background_name,boolean mixed_selection) {74 public void init(String name, boolean mixed_selection) { 78 75 if(NO_DRAG_CURSOR == null) { 79 76 NO_DRAG_CURSOR = DragSource.DefaultMoveNoDrop; … … 85 82 // Init 86 83 this.name = name; 87 if(background_name != null) {88 this.disabled_background = new ImageIcon("background.gif");89 this.normal_background = new ImageIcon(background_name);90 }91 84 92 85 // Creation
Note:
See TracChangeset
for help on using the changeset viewer.