• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.clients
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 5680

Show
Ignore:
Timestamp:
10/10/08 15:37:11 (6 weeks ago)
Author:
jburel
Message:

Cleaning

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  
    3737 
    3838/**  
    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>. 
    4043 * 
    4144 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/DataTreeViewerLoader.java

    r5247 r5680  
    2626 
    2727 
    28  
    29  
    3028//Java imports 
    3129 
    … …  
    4038import org.openmicroscopy.shoola.env.data.views.DataManagerView; 
    4139import org.openmicroscopy.shoola.env.log.LogMessage; 
    42  
    4340import pojos.ExperimenterData; 
    4441 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ExistingObjectsLoader.java

    r4982 r5680  
    3434import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    3535import org.openmicroscopy.shoola.env.data.views.CallHandle; 
    36 import pojos.CategoryData; 
    37 import pojos.CategoryGroupData; 
    3836import pojos.DataObject; 
    3937import pojos.DatasetData; 
    … …  
    4139 
    4240/**  
    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>. 
    4444 * 
    4545 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
    … …  
    7070    private void checkObject(DataObject o) 
    7171    { 
    72         if ((o instanceof DatasetData) || (o instanceof ProjectData) || 
    73             (o instanceof CategoryData) || (o instanceof CategoryGroupData)) 
     72        if ((o instanceof DatasetData) || (o instanceof ProjectData)) 
    7473            return; 
    7574        throw new IllegalArgumentException("Data type not supported."); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ExistingObjectsSaver.java

    r4987 r5680  
    3535import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    3636import org.openmicroscopy.shoola.env.data.views.CallHandle; 
    37  
    38 import pojos.CategoryGroupData; 
    3937import pojos.DataObject; 
    4038import pojos.DatasetData; 
    … …  
    4240 
    4341/**  
    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>. 
    4545 * 
    4646 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
    … …  
    7474    private void checkParent(DataObject o) 
    7575    { 
    76         if ((o instanceof ProjectData) || (o instanceof DatasetData) || 
    77                 (o instanceof CategoryGroupData)) 
     76        if ((o instanceof ProjectData) || (o instanceof DatasetData)) 
    7877            return; 
    7978        throw new IllegalArgumentException("Data object not supported.");    
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/RndSettingsSaver.java

    r5641 r5680  
    3535import org.openmicroscopy.shoola.env.data.model.TimeRefObject; 
    3636import org.openmicroscopy.shoola.env.data.views.CallHandle; 
    37 import pojos.CategoryData; 
    3837import pojos.DatasetData; 
    3938import pojos.ImageData; 
    4039 
    4140/**  
    42 * Pastes the rendering settings associated to the passed set of pixels 
    43 * across a collection of images. 
    44 * This class calls the <code>pasteRndSettings</code> method in the 
    45 * <code>DataManagerView</code>. 
    46 * 
    47 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
    48 * <a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a> 
    49 * @author Donald MacDonald &nbsp;&nbsp;&nbsp;&nbsp; 
    50 * <a href="mailto:donald@lifesci.dundee.ac.uk">donald@lifesci.dundee.ac.uk</a> 
    51 * @version 3.0 
    52 * <small> 
    53 * (<b>Internal version:</b> $Revision: $Date: $) 
    54 * </small> 
    55 * @since OME3.0 
    56 */ 
     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 &nbsp;&nbsp;&nbsp;&nbsp; 
     47 * <a href="mailto:j.burel@dundee.ac.uk">j.burel@dundee.ac.uk</a> 
     48 * @author Donald MacDonald &nbsp;&nbsp;&nbsp;&nbsp; 
     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 */ 
    5756public class RndSettingsSaver  
    5857        extends DataTreeViewerLoader 
    … …  
    9796        private void checkRootType(Class type) 
    9897        { 
    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)) 
    10199                        return; 
    102100                throw new IllegalArgumentException("Type not supported."); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/ScreenPlateLoader.java

    r5538 r5680  
    3838 
    3939/**  
    40  *  
     40 * Loads the screen/plate. 
     41 * This class calls the <code>loadScreenPlates</code> method in the 
     42 * <code>DataManagerView</code>.  
    4143 * 
    4244 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/TreeViewerTranslator.java

    r5538 r5680  
    4646import org.openmicroscopy.shoola.util.ui.UIUtilities; 
    4747import org.openmicroscopy.shoola.util.ui.clsf.TreeCheckNode; 
    48 import pojos.CategoryData; 
    49 import pojos.CategoryGroupData; 
    5048import pojos.DataObject; 
    5149import pojos.DatasetData; 
    … …  
    111109     
    112110    /** 
    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     /** 
    132111     * Transforms a {@link DatasetData} into a visualisation object i.e. 
    133112     * a {@link TreeCheckNode}. 
    … …  
    166145        return node; 
    167146    } 
    168      
    169     /** 
    170      * Transforms a {@link CategoryGroupData} into a visualisation object i.e. 
    171      * a {@link TreeCheckNode}. The {@link CategoryData categories} are also 
    172      * 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 when  
    178      *                      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     }   
    202147     
    203148    /** 
    … …  
    451396     
    452397    /** 
    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 when  
    460      *                      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 also 
    488      * 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 when  
    495      *                      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     /** 
    524398     * Transforms a {@link ImageData} into a visualisation object i.e. 
    525399     * a {@link TreeImageNode}. 
    … …  
    567441                            ((ProjectData) ho).getDatasets(), userID,  
    568442                                                groupID)); 
    569                 else if (ho instanceof CategoryGroupData) 
    570                     results.add(transformCategoryGroup((CategoryGroupData) ho,  
    571                             ((CategoryGroupData) ho).getCategories(), 
    572                             userID, groupID)); 
    573443                else if (ho instanceof ImageData)  
    574444                    results.add(transformImage((ImageData) ho));         
    … …  
    585455                        child = transformDataset((DatasetData) ho, userID, groupID); 
    586456                        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); 
    596457                } else if (ho instanceof TagAnnotationData) { 
    597458                        child = transformTag((TagAnnotationData) ho, userID,  
    … …  
    651512                                        expanded.contains(new Long(ho.getId()))); 
    652513                    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);  
    664514                } else if (ho instanceof DatasetData) { 
    665515                        /* 
    … …  
    701551                                results.add(display);  
    702552                        } 
    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 element 
    713                         if (r != null) {  //shouldn't happen 
    714                                 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                         } 
    725553                } else if (ho instanceof ScreenData) { 
    726554                        if (expandedTopNodes != null) 
    … …  
    770598        else if (object instanceof DatasetData) 
    771599            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); 
    778600        else if (object instanceof ImageData) 
    779601            return transformImage((ImageData) object); 
    … …  
    811633            ho = (DataObject) i.next(); 
    812634            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)  
    821636                    results.add(transformDatasetCheckNode((DatasetData) ho)); 
    822637            }   
    … …  
    849664                if (ho instanceof DatasetData) 
    850665                    results.add(transformDatasetCheckNode((DatasetData) ho)); 
    851                 else if (ho instanceof CategoryData) 
    852                     results.add(transformCategoryCheckNode((CategoryData) ho)); 
    853666                else if (ho instanceof ImageData) 
    854667                    results.add(transformImageCheckNode((ImageData) ho)); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ActivationAction.java

    r5177 r5680  
    2626 
    2727//Java imports 
     28import java.awt.event.ActionEvent; 
     29import javax.swing.Action; 
    2830 
    2931//Third-party libraries 
    3032 
    3133//Application-internal dependencies 
    32 import java.awt.event.ActionEvent; 
    33  
    34 import javax.swing.Action; 
    35  
    3634import org.openmicroscopy.shoola.agents.treeviewer.IconManager; 
    3735import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    … …  
    5553    extends TreeViewerAction 
    5654{ 
    57  
    58     /** The name of the action. */ 
    59     //private static final String NAME = "DataManager"; 
    60      
     55         
    6156    /** The description of the action. */ 
    6257    private static final String DESCRIPTION = "Bring up the DataManager for" + 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/AddAction.java

    r5177 r5680  
    3535import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; 
    3636import org.openmicroscopy.shoola.agents.treeviewer.browser.TreeImageDisplay; 
    37 import org.openmicroscopy.shoola.agents.treeviewer.cmd.ClassifyCmd; 
    3837import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    3938import org.openmicroscopy.shoola.util.ui.UIUtilities; 
    40 import pojos.CategoryData; 
    41 import pojos.CategoryGroupData; 
    4239import pojos.DataObject; 
    4340import pojos.DatasetData; 
    … …  
    6865    private static final String NAME_DATASET = "Add existing Dataset..."; 
    6966     
    70     /** The name of the action to add existing <code>Categories</code>. */ 
    71     private static final String NAME_CATEGORY = "Add existing Tag..."; 
    72      
    7367    /** The name of the action to add existing <code>Images</code>. */ 
    7468    private static final String NAME_IMAGE = "Add existing Image..."; 
    … …  
    9791            setEnabled(model.isObjectWritable(ho)); 
    9892            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); 
    10593        } else if (ho instanceof DatasetData) { 
    10694            setEnabled(model.isObjectWritable(ho)); 
    … …  
    140128        if (d == null) return; 
    141129        Object ho = d.getUserObject(); 
    142         if ((ho instanceof ProjectData) || (ho instanceof CategoryGroupData) || 
    143             (ho instanceof DatasetData)) 
     130        if ((ho instanceof ProjectData) || (ho instanceof DatasetData)) 
    144131            model.addExistingObjects((DataObject) ho); 
    145         else if (ho instanceof CategoryData) { 
    146             ClassifyCmd cmd = new ClassifyCmd(model, ClassifyCmd.CLASSIFY); 
    147             cmd.execute(); 
    148         } 
    149132    } 
    150133     
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/AddMetadataAction.java

    r5423 r5680  
    3939import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    4040import org.openmicroscopy.shoola.util.ui.UIUtilities; 
    41 import pojos.CategoryData; 
    4241import pojos.DatasetData; 
    4342import pojos.ImageData; 
    … …  
    9897                                return; 
    9998                        } 
    100                         setEnabled(((ho instanceof DatasetData) ||  
    101                                         (ho instanceof CategoryData))); 
     99                        setEnabled(ho instanceof DatasetData); 
    102100                        return; 
    103101                } 
    … …  
    124122         * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) 
    125123         */ 
    126         public void actionPerformed(ActionEvent e) 
    127         { 
    128                 //AnnotateChildrenCmd cmd = new AnnotateChildrenCmd(model); 
    129                 //cmd.execute(); 
    130                 model.addMetadata(); 
    131