Changeset 5680
- Timestamp:
- 10/10/08 15:37:11 (6 weeks ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer
- Files:
-
- 34 modified
-
DataObjectUpdater.java (modified) (1 diff)
-
DataTreeViewerLoader.java (modified) (2 diffs)
-
ExistingObjectsLoader.java (modified) (3 diffs)
-
ExistingObjectsSaver.java (modified) (3 diffs)
-
RndSettingsSaver.java (modified) (2 diffs)
-
ScreenPlateLoader.java (modified) (1 diff)
-
TreeViewerTranslator.java (modified) (11 diffs)
-
actions/ActivationAction.java (modified) (2 diffs)
-
actions/AddAction.java (modified) (4 diffs)
-
actions/AddMetadataAction.java (modified) (3 diffs)
-
actions/BrowserSelectionAction.java (modified) (3 diffs)
-
actions/CopyAction.java (modified) (2 diffs)
-
actions/CreateAction.java (modified) (4 diffs)
-
actions/CutAction.java (modified) (2 diffs)
-
actions/DeleteAction.java (modified) (1 diff)
-
actions/ManagerAction.java (modified) (2 diffs)
-
actions/PasteRndSettingsAction.java (modified) (2 diffs)
-
actions/ResetRndSettingsAction.java (modified) (2 diffs)
-
actions/SetRndSettingsAction.java (modified) (2 diffs)
-
browser/BrowserComponent.java (modified) (2 diffs)
-
browser/BrowserFactory.java (modified) (2 diffs)
-
browser/ContainerFinder.java (modified) (2 diffs)
-
browser/ContainersManager.java (modified) (3 diffs)
-
browser/TreeImageDisplay.java (modified) (3 diffs)
-
browser/TreeImageTimeSet.java (modified) (1 diff)
-
cmd/AnnotateChildrenCmd.java (modified) (2 diffs)
-
finder/RegExVisitor.java (modified) (3 diffs)
-
util/TreeCellRenderer.java (modified) (4 diffs)
-
view/DeleteDialog.java (modified) (4 diffs)
-
view/EditorDialog.java (modified) (1 diff)
-
view/TreeViewer.java (modified) (1 diff)
-
view/TreeViewerComponent.java (modified) (4 diffs)
-
view/TreeViewerControl.java (modified) (1 diff)
-
view/TreeViewerModel.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/DataObjectUpdater.java
r5450 r5680 37 37 38 38 /** 39 * 39 * Updates the data objects. 40 * This class calls one of the <code>addExistingObjects</code> 41 * and <code>cutAndPaste</code> methods in the 42 * <code>DataManagerView</code>. 40 43 * 41 44 * @author Jean-Marie Burel -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/DataTreeViewerLoader.java
r5247 r5680 26 26 27 27 28 29 30 28 //Java imports 31 29 … … 40 38 import org.openmicroscopy.shoola.env.data.views.DataManagerView; 41 39 import org.openmicroscopy.shoola.env.log.LogMessage; 42 43 40 import pojos.ExperimenterData; 44 41 -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ExistingObjectsLoader.java
r4982 r5680 34 34 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 35 35 import org.openmicroscopy.shoola.env.data.views.CallHandle; 36 import pojos.CategoryData;37 import pojos.CategoryGroupData;38 36 import pojos.DataObject; 39 37 import pojos.DatasetData; … … 41 39 42 40 /** 43 * 41 * Loads existing objects of a given type. 42 * This class calls one of the <code>loadExistingObjects</code> method in the 43 * <code>DataManagerView</code>. 44 44 * 45 45 * @author Jean-Marie Burel … … 70 70 private void checkObject(DataObject o) 71 71 { 72 if ((o instanceof DatasetData) || (o instanceof ProjectData) || 73 (o instanceof CategoryData) || (o instanceof CategoryGroupData)) 72 if ((o instanceof DatasetData) || (o instanceof ProjectData)) 74 73 return; 75 74 throw new IllegalArgumentException("Data type not supported."); -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ExistingObjectsSaver.java
r4987 r5680 35 35 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 36 36 import org.openmicroscopy.shoola.env.data.views.CallHandle; 37 38 import pojos.CategoryGroupData;39 37 import pojos.DataObject; 40 38 import pojos.DatasetData; … … 42 40 43 41 /** 44 * 42 * Loads existing objects of a given type. 43 * This class calls one of the <code>addExistingObjects</code> method in the 44 * <code>DataManagerView</code>. 45 45 * 46 46 * @author Jean-Marie Burel … … 74 74 private void checkParent(DataObject o) 75 75 { 76 if ((o instanceof ProjectData) || (o instanceof DatasetData) || 77 (o instanceof CategoryGroupData)) 76 if ((o instanceof ProjectData) || (o instanceof DatasetData)) 78 77 return; 79 78 throw new IllegalArgumentException("Data object not supported."); -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/RndSettingsSaver.java
r5641 r5680 35 35 import org.openmicroscopy.shoola.env.data.model.TimeRefObject; 36 36 import org.openmicroscopy.shoola.env.data.views.CallHandle; 37 import pojos.CategoryData;38 37 import pojos.DatasetData; 39 38 import pojos.ImageData; 40 39 41 40 /** 42 * Pastes the rendering settings associated to the passed set of pixels43 * across a collection of images.44 * This class calls the <code>pasteRndSettings</code> method in the45 * <code>DataManagerView</code>.46 *47 * @author Jean-Marie Burel 48 * <a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a>49 * @author Donald MacDonald 50 * <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a>51 * @version 3.052 * <small>53 * (<b>Internal version:</b> $Revision: $Date: $)54 * </small>55 * @since OME3.056 */41 * Pastes the rendering settings associated to the passed set of pixels 42 * across a collection of images. 43 * This class calls the <code>pasteRndSettings</code> method in the 44 * <code>DataManagerView</code>. 45 * 46 * @author Jean-Marie Burel 47 * <a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a> 48 * @author Donald MacDonald 49 * <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a> 50 * @version 3.0 51 * <small> 52 * (<b>Internal version:</b> $Revision: $Date: $) 53 * </small> 54 * @since OME3.0 55 */ 57 56 public class RndSettingsSaver 58 57 extends DataTreeViewerLoader … … 97 96 private void checkRootType(Class type) 98 97 { 99 if (ImageData.class.equals(type) || DatasetData.class.equals(type) || 100 CategoryData.class.equals(type)) 98 if (ImageData.class.equals(type) || DatasetData.class.equals(type)) 101 99 return; 102 100 throw new IllegalArgumentException("Type not supported."); -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ScreenPlateLoader.java
r5538 r5680 38 38 39 39 /** 40 * 40 * Loads the screen/plate. 41 * This class calls the <code>loadScreenPlates</code> method in the 42 * <code>DataManagerView</code>. 41 43 * 42 44 * @author Jean-Marie Burel -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/TreeViewerTranslator.java
r5538 r5680 46 46 import org.openmicroscopy.shoola.util.ui.UIUtilities; 47 47 import org.openmicroscopy.shoola.util.ui.clsf.TreeCheckNode; 48 import pojos.CategoryData;49 import pojos.CategoryGroupData;50 48 import pojos.DataObject; 51 49 import pojos.DatasetData; … … 111 109 112 110 /** 113 * Transforms a {@link CategoryData} into a visualisation object i.e.114 * a {@link TreeCheckNode}.115 *116 * @param data The {@link CategoryData} to transform.117 * Mustn't be <code>null</code>.118 * @return See above.119 */120 private static TreeCheckNode transformCategoryCheckNode(CategoryData data)121 {122 if (data == null)123 throw new IllegalArgumentException("Cannot be null");124 IconManager im = IconManager.getInstance();125 TreeCheckNode category = new TreeCheckNode(data,126 im.getIcon(IconManager.CATEGORY),127 data.getName(), true);128 return category;129 }130 131 /**132 111 * Transforms a {@link DatasetData} into a visualisation object i.e. 133 112 * a {@link TreeCheckNode}. … … 166 145 return node; 167 146 } 168 169 /**170 * Transforms a {@link CategoryGroupData} into a visualisation object i.e.171 * a {@link TreeCheckNode}. The {@link CategoryData categories} are also172 * transformed and linked to the newly created {@link TreeCheckNode}.173 *174 * @param data The {@link CategoryGroupData} to transform.175 * Mustn't be <code>null</code>.176 * @param userID The id of the current user.177 * @param groupID The id of the group the current user selects when178 * retrieving the data.179 * @return See above.180 */181 private static TreeCheckNode transformCategoryGroupCheckNode(182 CategoryGroupData data, long userID,183 long groupID)184 {185 if (data == null)186 throw new IllegalArgumentException("Cannot be null");187 IconManager im = IconManager.getInstance();188 TreeCheckNode group = new TreeCheckNode(data,189 im.getIcon(IconManager.CATEGORY_GROUP),190 data.getName(), false);191 Set categories = data.getCategories();192 Iterator i = categories.iterator();193 CategoryData child;194 while (i.hasNext()) {195 child = (CategoryData) i.next();196 if (EditorUtil.isWritable(child, userID, groupID))197 group.addChildDisplay(transformCategoryCheckNode(child));198 }199 200 return group;201 }202 147 203 148 /** … … 451 396 452 397 /** 453 * Transforms a {@link CategoryData} into a visualisation object i.e.454 * a {@link TreeImageSet}.455 *456 * @param data The {@link CategoryData} to transform.457 * Mustn't be <code>null</code>.458 * @param userID The id of the current user.459 * @param groupID The id of the group the current user selects when460 * retrieving the data.461 * @return See above.462 */463 private static TreeImageDisplay transformCategory(CategoryData data,464 long userID, long groupID)465 {466 if (data == null)467 throw new IllegalArgumentException("Cannot be null");468 TreeImageSet category = new TreeImageSet(data);469 Set images = data.getImages();470 if (images == null) category.setNumberItems(-1);471 else {472 category.setChildrenLoaded(Boolean.TRUE);473 category.setNumberItems(images.size());474 Iterator i = images.iterator();475 ImageData child;476 while (i.hasNext()) {477 child = (ImageData) i.next();478 if (EditorUtil.isReadable(child, userID, groupID))479 category.addChildDisplay(transformImage(child));480 }481 }482 return category;483 }484 485 /**486 * Transforms a {@link CategoryGroupData} into a visualisation object i.e.487 * a {@link TreeImageSet}. The {@link CategoryData categories} are also488 * transformed and linked to the newly created {@link TreeImageSet}.489 *490 * @param data The {@link CategoryGroupData} to transform.491 * Mustn't be <code>null</code>.492 * @param categories The categories to add.493 * @param userID The id of the current user.494 * @param groupID The id of the group the current user selects when495 * retrieving the data.496 * @return See above.497 */498 private static TreeImageDisplay transformCategoryGroup(499 CategoryGroupData data, Set categories, long userID, long groupID)500 {501 if (data == null)502 throw new IllegalArgumentException("Cannot be null");503 TreeImageSet group = new TreeImageSet(data);504 if (categories != null) {505 group.setChildrenLoaded(Boolean.TRUE);506 Iterator i = categories.iterator();507 CategoryData child;508 while (i.hasNext()) {509 child = (CategoryData) i.next();510 if (EditorUtil.isReadable(child, userID, groupID))511 group.addChildDisplay(transformCategory(child, userID,512 groupID));513 }514 group.setNumberItems(categories.size());515 } else {516 //categories not loaded.517 group.setChildrenLoaded(Boolean.TRUE);518 group.setNumberItems(0);519 }520 return group;521 }522 523 /**524 398 * Transforms a {@link ImageData} into a visualisation object i.e. 525 399 * a {@link TreeImageNode}. … … 567 441 ((ProjectData) ho).getDatasets(), userID, 568 442 groupID)); 569 else if (ho instanceof CategoryGroupData)570 results.add(transformCategoryGroup((CategoryGroupData) ho,571 ((CategoryGroupData) ho).getCategories(),572 userID, groupID));573 443 else if (ho instanceof ImageData) 574 444 results.add(transformImage((ImageData) ho)); … … 585 455 child = transformDataset((DatasetData) ho, userID, groupID); 586 456 results.add(child); 587 } else if (ho instanceof CategoryData) {588 if (orphan == null) {589 orphan = new TreeImageSet(ORPHANED_CATEGORIES);590 orphan.setChildrenLoaded(Boolean.TRUE);591 results.add(orphan);592 }593 child = transformCategory((CategoryData) ho, userID,594 groupID);595 orphan.addChildDisplay(child);596 457 } else if (ho instanceof TagAnnotationData) { 597 458 child = transformTag((TagAnnotationData) ho, userID, … … 651 512 expanded.contains(new Long(ho.getId()))); 652 513 results.add(display); 653 } else if (ho instanceof CategoryGroupData) {654 if (expandedTopNodes != null)655 expanded = (List)656 expandedTopNodes.get(CategoryGroupData.class);657 display = transformCategoryGroup((CategoryGroupData) ho,658 (Set) nodes.get(ho),659 userID, groupID);660 if (expanded != null)661 display.setExpanded(662 expanded.contains(new Long(ho.getId())));663 results.add(display);664 514 } else if (ho instanceof DatasetData) { 665 515 /* … … 701 551 results.add(display); 702 552 } 703 } else if (ho instanceof CategoryData) {704 if (orphan == null) {705 orphan = new TreeImageSet(ORPHANED_CATEGORIES);706 orphan.setChildrenLoaded(true);707 results.add(orphan);708 }709 if (expandedTopNodes != null)710 expanded =711 (List) expandedTopNodes.get(CategoryData.class);712 Set r = (Set) nodes.get(ho); //should only have one element713 if (r != null) { //shouldn't happen714 Iterator k = r.iterator();715 while (k.hasNext()) {716 CategoryData element = (CategoryData) k.next();717 display = transformCategory(element, userID,718 groupID);719 if (expanded != null)720 display.setExpanded(721 expanded.contains(new Long(ho.getId())));722 orphan.addChildDisplay(display);723 }724 }725 553 } else if (ho instanceof ScreenData) { 726 554 if (expandedTopNodes != null) … … 770 598 else if (object instanceof DatasetData) 771 599 return transformDataset((DatasetData) object, userID, groupID); 772 else if (object instanceof CategoryData)773 return transformCategory((CategoryData) object, userID, groupID);774 else if (object instanceof CategoryGroupData)775 return transformCategoryGroup((CategoryGroupData) object,776 ((CategoryGroupData) object).getCategories(),777 userID, groupID);778 600 else if (object instanceof ImageData) 779 601 return transformImage((ImageData) object); … … 811 633 ho = (DataObject) i.next(); 812 634 if (EditorUtil.isWritable(ho, userID, groupID)) { 813 if (ho instanceof CategoryGroupData) { 814 Set categories = ((CategoryGroupData) ho).getCategories(); 815 if (categories != null && categories.size() != 0) 816 results.add(transformCategoryGroupCheckNode( 817 (CategoryGroupData) ho, userID, groupID)); 818 } else if (ho instanceof CategoryData) 819 results.add(transformCategoryCheckNode((CategoryData) ho)); 820 else if (ho instanceof DatasetData) 635 if (ho instanceof DatasetData) 821 636 results.add(transformDatasetCheckNode((DatasetData) ho)); 822 637 } … … 849 664 if (ho instanceof DatasetData) 850 665 results.add(transformDatasetCheckNode((DatasetData) ho)); 851 else if (ho instanceof CategoryData)852 results.add(transformCategoryCheckNode((CategoryData) ho));853 666 else if (ho instanceof ImageData) 854 667 results.add(transformImageCheckNode((ImageData) ho)); -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ActivationAction.java
r5177 r5680 26 26 27 27 //Java imports 28 import java.awt.event.ActionEvent; 29 import javax.swing.Action; 28 30 29 31 //Third-party libraries 30 32 31 33 //Application-internal dependencies 32 import java.awt.event.ActionEvent;33 34 import javax.swing.Action;35 36 34 import org.openmicroscopy.shoola.agents.treeviewer.IconManager; 37 35 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; … … 55 53 extends TreeViewerAction 56 54 { 57 58 /** The name of the action. */ 59 //private static final String NAME = "DataManager"; 60 55 61 56 /** The description of the action. */ 62 57 private static final String DESCRIPTION = "Bring up the DataManager for" + -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/AddAction.java
r5177 r5680 35 35 import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; 36 36 import org.openmicroscopy.shoola.agents.treeviewer.browser.TreeImageDisplay; 37 import org.openmicroscopy.shoola.agents.treeviewer.cmd.ClassifyCmd;38 37 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 39 38 import org.openmicroscopy.shoola.util.ui.UIUtilities; 40 import pojos.CategoryData;41 import pojos.CategoryGroupData;42 39 import pojos.DataObject; 43 40 import pojos.DatasetData; … … 68 65 private static final String NAME_DATASET = "Add existing Dataset..."; 69 66 70 /** The name of the action to add existing <code>Categories</code>. */71 private static final String NAME_CATEGORY = "Add existing Tag...";72 73 67 /** The name of the action to add existing <code>Images</code>. */ 74 68 private static final String NAME_IMAGE = "Add existing Image..."; … … 97 91 setEnabled(model.isObjectWritable(ho)); 98 92 putValue(Action.NAME, NAME_DATASET); 99 } else if (ho instanceof CategoryGroupData) {100 setEnabled(model.isObjectWritable(ho));101 putValue(Action.NAME, NAME_CATEGORY);102 } else if (ho instanceof CategoryData) {103 setEnabled(model.isObjectWritable(ho));104 putValue(Action.NAME, NAME_IMAGE);105 93 } else if (ho instanceof DatasetData) { 106 94 setEnabled(model.isObjectWritable(ho)); … … 140 128 if (d == null) return; 141 129 Object ho = d.getUserObject(); 142 if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData) || 143 (ho instanceof DatasetData)) 130 if ((ho instanceof ProjectData) || (ho instanceof DatasetData)) 144 131 model.addExistingObjects((DataObject) ho); 145 else if (ho instanceof CategoryData) {146 ClassifyCmd cmd = new ClassifyCmd(model, ClassifyCmd.CLASSIFY);147 cmd.execute();148 }149 132 } 150 133 -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/AddMetadataAction.java
r5423 r5680 39 39 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 40 40 import org.openmicroscopy.shoola.util.ui.UIUtilities; 41 import pojos.CategoryData;42 41 import pojos.DatasetData; 43 42 import pojos.ImageData; … … 98 97 return; 99 98 } 100 setEnabled(((ho instanceof DatasetData) || 101 (ho instanceof CategoryData))); 99 setEnabled(ho instanceof DatasetData); 102 100 return; 103 101 } … … 124 122 * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) 125 123 */ 126 public void actionPerformed(ActionEvent e) 127 { 128 //AnnotateChildrenCmd cmd = new AnnotateChildrenCmd(model); 129 //cmd.execute(); 130 model.addMetadata(); 131
