Changeset 5662
- Timestamp:
- 10/09/08 11:32:19 (6 weeks ago)
- Location:
- trunk/SRC/org/openmicroscopy/shoola
- Files:
-
- 7 modified
-
agents/dataBrowser/DataBrowserTranslator.java (modified) (5 diffs)
-
agents/dataBrowser/view/DataBrowserToolBar.java (modified) (2 diffs)
-
agents/treeviewer/browser/BrowserUI.java (modified) (1 diff)
-
env/data/OMEROGateway.java (modified) (7 diffs)
-
env/data/OmeroMetadataService.java (modified) (1 diff)
-
env/data/OmeroMetadataServiceImpl.java (modified) (4 diffs)
-
env/data/views/calls/DataFilter.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/DataBrowserTranslator.java
r5606 r5662 41 41 import org.openmicroscopy.shoola.agents.dataBrowser.browser.WellSampleNode; 42 42 import org.openmicroscopy.shoola.util.ui.UIUtilities; 43 import pojos.CategoryData;44 import pojos.CategoryGroupData;45 43 import pojos.DataObject; 46 44 import pojos.DatasetData; … … 192 190 formatToolTipFor(node); 193 191 linkImagesTo(images, node, userID, groupID); 194 } else if (uo instanceof CategoryData) { 195 CategoryData data = (CategoryData) uo; 196 String note = ""; 197 images = data.getImages(); 198 if (images != null) note = LEFT+images.size()+RIGHT; 199 node = new ImageSet(data.getName(), note, data); 200 formatToolTipFor(node); 201 linkImagesTo(images, node, userID, groupID); 202 } 192 } 203 193 return node; 204 194 } … … 221 211 Set children; 222 212 Iterator i, j; 223 CategoryData c;224 213 DatasetData d; 225 if (uo instanceof CategoryData) { 226 c = (CategoryData) uo; 227 images = transformImages(c.getImages(), userID, groupID); 228 } else if (uo instanceof CategoryGroupData) { 229 CategoryGroupData cg = (CategoryGroupData) uo; 230 children = cg.getCategories(); 231 if (children != null) { 232 i = children.iterator(); 233 images = new HashSet(); 234 while (i.hasNext()) { 235 c = (CategoryData) i.next(); 236 images.addAll(transformImages(c.getImages(), 237 userID, groupID)); 238 } 239 } 240 } else if (uo instanceof DatasetData) { 214 if (uo instanceof DatasetData) { 241 215 d = (DatasetData) uo; 242 216 images = transformImages(d.getImages(), userID, groupID); … … 485 459 } 486 460 487 /**488 * Transforms a CategoryGroup/Category/Images hierarchy into a visualisation489 * tree.490 *491 * @param groups Collection of {@link CategoryGroupData}s to transform.492 * Mustn't be <code>null</code>.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 Collection of corresponding {@link ImageDisplay}s.497 */498 private static Set transformCategoryGroups(Set groups, long userID,499 long groupID)500 {501 if (groups == null) throw new IllegalArgumentException("No groups.");502 Set results = new HashSet();503 Iterator i = groups.iterator(), j;504 //DataObject505 CategoryGroupData cgData;506 DataObject child;507 //Visualisation object.508 ImageSet group;509 Set categories;510 String note = "";511 while (i.hasNext()) {512 cgData = (CategoryGroupData) i.next();513 categories = cgData.getCategories();514 if (categories != null) note = LEFT+categories.size()+RIGHT;515 group = new ImageSet(cgData.getName(), note, cgData);516 formatToolTipFor(group);517 518 if (categories != null) {519 j = categories.iterator();520 while (j.hasNext()) {521 child = (DataObject) j.next();522 if (isReadable(child, userID, groupID))523 group.addChildDisplay(linkImages(child, userID,524 groupID));525 }526 }527 results.add(group); //add the group ImageSet528 }529 return results;530 }531 532 /**533 * Transforms the specified {@link CategoryGroupData} into its corresponding534 * visualisation element.535 *536 * @param data The {@link CategoryGroupData} to transform.537 * @param userID The id of the current user.538 * @param groupID The id of the group the current user selects when539 * retrieving the data.540 * @return See below.541 */542 private static Set transformCategoryGroup(CategoryGroupData data,543 long userID, long groupID)544 {545 Set set = new HashSet(1);546 set.add(data);547 return transformCategoryGroups(set, userID, groupID);548 }549 550 /**551 * Transforms a Category/Images hierarchy into a visualisation tree.552 *553 * @param categories Collection of {@link CategoryData}s to transform.554 * @param userID The id of the current user.555 * @param groupID The id of the group the current user selects when556 * retrieving the data.557 * @return Set of corresponding {@link ImageDisplay}s.558 */559 private static Set transformCategories(Set categories, long userID,560 long groupID)561 {562 if (categories == null)563 throw new IllegalArgumentException("No categories.");564 Set results = new HashSet();565 Iterator i = categories.iterator();566 CategoryData data;567 ImageSet parent;568 Set images;569 String note = "";570 while (i.hasNext()) {571 data = (CategoryData) i.next();572 if (isReadable(data, userID, groupID)) {573 images = data.getImages();574 if (images != null) note = LEFT+images.size()+RIGHT;575 parent = new ImageSet(data.getName(), note, data);576 formatToolTipFor(parent);577 linkImagesTo(images, parent, userID, groupID);578 results.add(parent);579 }580 }581 return results;582 }583 584 /**585 * Transforms the specified {@link CategoryData} into its corresponding586 * visualisation element.587 *588 * @param data The {@link CategoryData} to transform.589 * @param userID The id of the current user.590 * @param groupID The id of the group the current user selects when591 * retrieving the data.592 * @return See below.593 */594 private static Set transformCategory(CategoryData data, long userID,595 long groupID)596 {597 Set set = new HashSet(1);598 set.add(data);599 return transformCategories(set, userID, groupID);600 }601 602 461 /** 603 462 * Transforms a set of {@link DataObject}s into their corresponding … … 631 490 else if (ho instanceof DatasetData) 632 491 results.add(getFirstElement(transformDataset(ho, userID, 633 groupID)));634 else if (ho instanceof CategoryGroupData)635 results.add(getFirstElement(636 transformCategoryGroup((CategoryGroupData) ho, userID,637 groupID)));638 else if (ho instanceof CategoryData)639 results.add(getFirstElement(640 transformCategory((CategoryData) ho, userID,641 492 groupID))); 642 493 else if (ho instanceof ImageData) { -
trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserToolBar.java
r5641 r5662 34 34 import java.util.Collection; 35 35 import java.util.List; 36 37 36 import javax.swing.Box; 38 37 import javax.swing.BoxLayout; … … 66 65 import org.openmicroscopy.shoola.util.ui.search.SearchComponent; 67 66 import org.openmicroscopy.shoola.util.ui.search.SearchObject; 68 69 67 import pojos.TagAnnotationData; 70 68 import pojos.TextualAnnotationData; -
trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java
r5661 r5662 1131 1131 parent.removeAllChildren(); 1132 1132 parent.setChildrenLoaded(Boolean.TRUE); 1133 System.err.println(parent.getNodeText());1134 1133 if (nodes.size() != 0) { 1135 1134 Iterator i = nodes.iterator(); -
trunk/SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java
r5657 r5662 81 81 import omero.model.AnnotationAnnotationLink; 82 82 import omero.model.BooleanAnnotation; 83 import omero.model.BooleanAnnotationI; 83 84 import omero.model.Dataset; 84 85 import omero.model.Details; … … 86 87 import omero.model.ExperimenterGroup; 87 88 import omero.model.FileAnnotation; 89 import omero.model.FileAnnotationI; 88 90 import omero.model.Format; 89 91 import omero.model.IObject; … … 102 104 import omero.model.ScreenPlateLink; 103 105 import omero.model.TagAnnotation; 106 import omero.model.TagAnnotationI; 104 107 import omero.model.TextAnnotation; 108 import omero.model.TextAnnotationI; 109 import omero.model.TimestampAnnotation; 110 import omero.model.TimestampAnnotationI; 105 111 import omero.model.UrlAnnotation; 112 import omero.model.UrlAnnotationI; 106 113 import omero.model.Well; 107 114 import omero.model.WellSample; … … 126 133 import pojos.TagAnnotationData; 127 134 import pojos.TextualAnnotationData; 135 import pojos.TimeAnnotationData; 128 136 import pojos.URLAnnotationData; 129 137 import pojos.WellData; … … 880 888 return WellSample.class.getName(); 881 889 throw new IllegalArgumentException("NodeType not supported"); 890 } 891 892 /** 893 * Converts the specified type to its corresponding type for search. 894 * 895 * @param nodeType The type to convert. 896 * @return See above. 897 */ 898 private String convertTypeForSearch(Class nodeType) 899 { 900 if (nodeType.equals(Image.class)) 901 return ImageI.class.getName(); 902 else if (nodeType.equals(TagAnnotation.class) || 903 nodeType.equals(TagAnnotationData.class)) 904 return TagAnnotationI.class.getName(); 905 else if (nodeType.equals(BooleanAnnotation.class) || 906 nodeType.equals(BooleanAnnotationData.class)) 907 return BooleanAnnotationI.class.getName(); 908 else if (nodeType.equals(UrlAnnotation.class) || 909 nodeType.equals(URLAnnotationData.class)) 910 return UrlAnnotationI.class.getName(); 911 else if (nodeType.equals(FileAnnotation.class) || 912 nodeType.equals(FileAnnotationData.class)) 913 return FileAnnotationI.class.getName(); 914 else if (nodeType.equals(TextAnnotation.class) || 915 nodeType.equals(TextualAnnotationData.class)) 916 return TextAnnotationI.class.getName(); 917 else if (nodeType.equals(TimestampAnnotation.class) || 918 nodeType.equals(TimeAnnotationData.class)) 919 return TimestampAnnotationI.class.getName(); 920 throw new IllegalArgumentException("type not supported"); 882 921 } 883 922 … … 3025 3064 service.onlyOwnedBy(d); 3026 3065 service.bySomeMustNone(fSome, fMust, fNone); 3027 size = handleSearchResult(ImageI.class.getName(), rType, 3066 size = handleSearchResult( 3067 convertTypeForSearch(Image.class), rType, 3028 3068 service); 3029 3069 if (size instanceof Integer) … … 3082 3122 } 3083 3123 List<String> t = prepareTextSearch(terms, service); 3084 3085 3086 String k = convertPojos(annotationType); 3087 service.onlyType(k); 3124 3125 service.onlyType(convertPojos(annotationType)); 3088 3126 Set rType = new HashSet(); 3089 3127 service.bySomeMustNone(t, null, null); 3090 Object size = handleSearchResult(k, rType, service); 3128 Object size = handleSearchResult( 3129 convertTypeForSearch(annotationType), rType, service); 3091 3130 if (size instanceof Integer) new HashSet(); 3092 3131 return rType; -
trunk/SRC/org/openmicroscopy/shoola/env/data/OmeroMetadataService.java
r5641 r5662 74 74 * specified. 75 75 * @return See above. 76 * @throws DSOutOfServiceException 77 * @throws DSAccessException 76 * @throws DSOutOfServiceException If the connection is broken, or logged 77 * in. 78 * @throws DSAccessException If an error occured while trying to 79 * retrieve data from OMEDS service. 78 80 */ 79 81 public Collection loadTextualAnnotations(Class type, long id, long userID) -
trunk/SRC/org/openmicroscopy/shoola/env/data/OmeroMetadataServiceImpl.java
r5651 r5662 38 38 39 39 //Third-party libraries 40 import org.apache.commons.collections.ListUtils; 41 42 //Application-internal dependencies 40 43 import omero.RString; 41 44 import omero.model.Annotation; … … 46 49 import omero.model.ImageAnnotationLink; 47 50 import omero.model.OriginalFile; 48 import omero.model.Project;49 import omero.model.ProjectAnnotationLink;50 51 import omero.model.TagAnnotation; 51 52 import omero.model.TagAnnotationI; 52 53 import omero.util.PojoOptionsI; 53 54 import org.apache.commons.collections.ListUtils;55 56 //Application-internal dependencies57 54 import org.openmicroscopy.shoola.env.LookupNames; 58 55 import org.openmicroscopy.shoola.env.config.Registry; … … 101 98 102 99 100 /** 101 * Loads the description of the passed tag for the specified user. 102 * 103 * @param tag The tag to handle. 104 * @param userID The id of the user. 105 * @return See above. 106 * @throws DSOutOfServiceException If the connection is broken, or logged 107 * in. 108 * @throws DSAccessException If an error occured while trying to 109 * retrieve data from OMEDS service. 110 */ 103 111 private TagAnnotationData loadTagDescription(TagAnnotationData tag, 104 112 long userID) … … 159 167 of = gateway.uploadFile(fileAnn.getAttachedFile(), 160 168 fileAnn.getServerFileFormat()); 161 //tmp162 169 fa = new FileAnnotationI(); 163 //tmp164 170 fa.setFile(of); 165 /*166 fa.setFile(167 (OriginalFile)168 gateway.findIObject(OriginalFile.class.getName(),169 of.getId().val));170 */171 171 iobject = fa; 172 172 } else { -
trunk/SRC/org/openmicroscopy/shoola/env/data/views/calls/DataFilter.java
r5641 r5662 164 164 boolean annotated, long userID) 165 165 { 166 if (annotationType == null) 167 throw new IllegalArgumentException("Annotation type not valid."); 168 if (nodeType == null) 169 throw new IllegalArgumentException("Node type not valid."); 166 170 loadCall = filterBy(annotationType, nodeType, nodeIds, annotated, 167 171 userID); … … 183 187 List<String> terms, long userID) 184 188 { 189 if (annotationType == null) 190 throw new IllegalArgumentException("Annotation type not valid."); 191 if (nodeType == null) 192 throw new IllegalArgumentException("Node type not valid."); 185 193 loadCall = filterBy(annotationType, nodeType, nodeIds, terms, userID); 186 194 } … … 200 208 long userID) 201 209 { 210 if (nodeType == null) 211 throw new IllegalArgumentException("Node type not valid."); 202 212 loadCall = filterBy(nodeType, nodeIds, context, userID); 203 213 }
