• 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 5687

Show
Ignore:
Timestamp:
10/14/08 12:09:36 (7 weeks ago)
Author:
jburel
Message:

Fixed problem related to menus

Location:
trunk/SRC/org/openmicroscopy/shoola/agents
Files:
1 added
10 modified
1 moved

  • imviewer/view/ImViewerFactory.java (modified) (2 diffs)
  • treeviewer/actions/BrowseContainerAction.java (moved) (moved from trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ViewAction.java) (10 diffs)
  • treeviewer/actions/RefreshExperimenterData.java (modified) (1 diff)
  • treeviewer/actions/RemoveExperimenterNode.java (modified) (1 diff)
  • treeviewer/actions/SwitchUserAction.java (modified) (1 diff)
  • treeviewer/actions/ViewImageAction.java (added)
  • treeviewer/view/ManagePopupMenu.java (modified) (1 diff)
  • treeviewer/view/PopupMenu.java (modified) (4 diffs)
  • treeviewer/view/ToolBar.java (modified) (1 diff)
  • treeviewer/view/TreeViewerControl.java (modified) (6 diffs)
  • treeviewer/view/TreeViewerFactory.java (modified) (3 diffs)
  • treeviewer/view/TreeViewerWin.java (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerFactory.java

    r5567 r5687  
    7979        /** The name associated to the component. */ 
    8080        private static final String NAME = "Viewer: "; 
     81         
     82        /** The name of the windows menu. */ 
     83        private static final String MENU_NAME = "Image Viewer"; 
     84         
    8185         
    8286        /** The sole instance. */ 
    … …  
    306310                viewers = new HashSet<ImViewer>(); 
    307311                isAttached = false; 
    308                 windowMenu = new JMenu("Viewers"); 
     312                windowMenu = new JMenu(MENU_NAME); 
    309313        } 
    310314 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/BrowseContainerAction.java

    r5656 r5687  
    11/* 
    2  * org.openmicroscopy.shoola.agents.treeviewer.actions.ViewAction 
     2 * org.openmicroscopy.shoola.agents.treeviewer.actions.BrowseContainerAction 
    33 * 
    44 *------------------------------------------------------------------------------ 
    … …  
    2828import java.awt.event.ActionEvent; 
    2929import java.util.List; 
    30  
    3130import javax.swing.Action; 
    3231 
    … …  
    4948 
    5049/**  
    51  * Views or browses the selected node depending on the hierarchy object type. 
     50 * Browses the selected node depending on the hierarchy object type. 
    5251 * 
    5352 * @author  Jean-Marie Burel &nbsp;&nbsp;&nbsp;&nbsp; 
    … …  
    5958 * @since OME2.2 
    6059 */ 
    61 public class ViewAction 
     60public class BrowseContainerAction 
    6261    extends TreeViewerAction 
    6362{ 
    6463 
    65     /** Name of the action when the <code>DataObject</code> is an Image. */ 
    66     private static final String VIEW = "View"; 
    67      
    6864    /** Name of the action when the <code>DataObject</code> isn't an Image. */ 
    69     private static final String BROWSE = "Browse"; 
     65    private static final String NAME = "Browse"; 
    7066     
    7167    /** Description of the action. */ 
    7268    private static final String DESCRIPTION = "Browse the selected nodes"; 
    73      
    74     /** Description of the action when the selected node is an image. */ 
    75     private static final String DESCRIPTION_IMAGE = "View the selected image"; 
    7669     
    7770    /** Convenience reference to the icon manager. */ 
    … …  
    9285        } 
    9386        if (selectedDisplay.getParentDisplay() == null) { //root 
    94             name = BROWSE; 
     87            name = NAME; 
    9588            setEnabled(false); 
    9689            putValue(Action.SMALL_ICON, icons.getIcon(IconManager.BROWSER));  
    … …  
    10093        Browser browser = model.getSelectedBrowser(); 
    10194        if (selectedDisplay instanceof TreeImageTimeSet) { 
    102                 name = BROWSE; 
     95                name = NAME; 
    10396            putValue(Action.SMALL_ICON, icons.getIcon(IconManager.BROWSER));  
    10497            if (browser.getSelectedDisplays().length > 1) { 
    … …  
    118111        } 
    119112        if (ho == null || !(ho instanceof DataObject) || 
    120                 ho instanceof ExperimenterData) setEnabled(false); 
     113                ho instanceof ExperimenterData || ho instanceof ImageData)  
     114                setEnabled(false); 
    121115        else { 
    122116            if (browser != null) { 
    … …  
    125119                    //for this version 
    126120                    setEnabled(false); 
    127                     name = BROWSE; 
     121                    name = NAME; 
    128122                    putValue(Action.SMALL_ICON,  
    129123                                        icons.getIcon(IconManager.BROWSER));  
    … …  
    131125                } 
    132126            } 
    133             if ((ho instanceof ImageData)) { 
    134                 name = VIEW;   
    135                 description = DESCRIPTION_IMAGE; 
    136                 putValue(Action.SHORT_DESCRIPTION,  
    137                         UIUtilities.formatToolTipText(description)); 
    138                 putValue(Action.SMALL_ICON, icons.getIcon(IconManager.VIEWER));  
    139             } else { 
    140                 name = BROWSE; 
    141                 putValue(Action.SMALL_ICON, icons.getIcon(IconManager.BROWSER)); 
    142             } 
     127            name = NAME; 
     128                putValue(Action.SMALL_ICON, icons.getIcon(IconManager.BROWSER)); 
    143129             
    144130            if (selectedDisplay instanceof TreeImageSet) { 
    … …  
    158144     * @param model Reference to the Model. Mustn't be <code>null</code>. 
    159145     */ 
    160     public ViewAction(TreeViewer model) 
     146    public BrowseContainerAction(TreeViewer model) 
    161147    { 
    162148        super(model); 
    163         name = BROWSE; 
     149        name = NAME; 
    164150        icons = IconManager.getInstance(); 
    165151        putValue(Action.SHORT_DESCRIPTION,  
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/RefreshExperimenterData.java

    r4982 r5687  
    5757 
    5858        /** Name of the action. */ 
    59     private static final String NAME = "Refresh Experimenter"; 
     59    private static final String NAME = "Refresh User"; 
    6060     
    6161    /** Description of the action. */ 
    62     private static final String DESCRIPTION = "Reload the experimenter data."; 
     62    private static final String DESCRIPTION = "Reload the user's data."; 
    6363     
    6464    /** 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/RemoveExperimenterNode.java

    r5010 r5687  
    5959 
    6060        /** The name of the action. */ 
    61         private static final String NAME = "Remove Experimenter"; 
     61        private static final String NAME = "Remove User"; 
    6262         
    6363        /** The description of the action. */ 
    6464        private static final String DESCRIPTION = "Remove the data of the" + 
    65                         "selected user from the display"; 
     65                        "selected user from the display."; 
    6666         
    6767        /** 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/SwitchUserAction.java

    r5180 r5687  
    5454 
    5555        /** The name of the action. */ 
    56         private static final String NAME = "Switch user"; 
     56        private static final String NAME = "Switch User..."; 
    5757         
    5858        /** The description of the action. */ 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/ManagePopupMenu.java

    r4695 r5687  
    5757 
    5858    /** Reference to the control. */ 
    59     private TreeViewerControl controller; 
     59    private TreeViewerControl   controller; 
    6060     
    6161    /** Button to add element to the specified container. */ 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/PopupMenu.java

    r5450 r5687  
    7979        private JMenuItem           deleteElement; 
    8080 
    81         /** Button to classify the selected elements. */ 
    82         private JMenuItem               classifyElement; 
    83  
    84         /** Button to classify the selected elements. */ 
    85         private JMenuItem               declassifyElement; 
    86  
    8781        /** Button to browse the categories the image belongs to. */ 
    8882        private JMenuItem                       browseClassificationElement; 
    89  
    90         /** Button to classify the images contained in the selected element. */ 
    91         private JMenuItem               classifyChildrenElement; 
    9283 
    9384        /** Button to annotate the images contained in the selected element. */ 
    … …  
    152143                switch (index) { 
    153144                case TreeViewer.FULL_POP_UP_MENU: 
    154                         a = controller.getAction(TreeViewerControl.VIEW); 
     145                        a = controller.getAction(TreeViewerControl.BROWSE); 
    155146                        view = new JMenuItem(a); 
    156147                        initMenuItem(view, a.getActionName()); 
    … …  
    173164                        existingElement = new JMenuItem(a); 
    174165                        initMenuItem(existingElement, a.getActionName()); 
    175                         a = controller.getAction(TreeViewerControl.CLASSIFY); 
    176                         classifyElement = new JMenuItem(a); 
    177                         initMenuItem(classifyElement, a.getActionName()); 
    178                         a = controller.getAction(TreeViewerControl.DECLASSIFY); 
    179                         declassifyElement = new JMenuItem(a); 
    180                         initMenuItem(declassifyElement, a.getActionName()); 
     166                         
    181167                        a = controller.getAction(TreeViewerControl.ANNOTATE_CHILDREN); 
    182168                        annotateChildrenElement = new JMenuItem(a); 
    183169                        initMenuItem(annotateChildrenElement, a.getActionName()); 
    184                         a = controller.getAction(TreeViewerControl.CLASSIFY_CHILDREN); 
    185                         classifyChildrenElement = new JMenuItem(a); 
    186                         initMenuItem(classifyChildrenElement, a.getActionName()); 
     170                         
    187171                        a = controller.getAction(TreeViewerControl.REMOVE_FROM_DISPLAY); 
    188172                        removeExperimenterElement = new JMenuItem(a); 
    … …  
    255239                                add(new JSeparator(JSeparator.HORIZONTAL)); 
    256240                                add(browseClassificationElement); 
    257                                 //add(classifyElement); 
    258                                 //add(declassifyElement); 
    259                                 //add(classifyChildrenElement); 
    260241                                //add(new JSeparator(JSeparator.HORIZONTAL)); 
    261242                                //add(annotateChildrenElement); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/ToolBar.java

    r5628 r5687  
    8181        bar.setRollover(true); 
    8282        bar.setBorder(null); 
    83         JButton b = new JButton(controller.getAction(TreeViewerControl.VIEW)); 
     83        JButton b = new JButton(controller.getAction(TreeViewerControl.BROWSE)); 
     84        UIUtilities.unifiedButtonLookAndFeel(b); 
     85        bar.add(b); 
     86        b = new JButton(controller.getAction(TreeViewerControl.VIEW)); 
    8487        UIUtilities.unifiedButtonLookAndFeel(b); 
    8588        bar.add(b); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java

    r5681 r5687  
    8383import org.openmicroscopy.shoola.agents.treeviewer.actions.SwitchUserAction; 
    8484import org.openmicroscopy.shoola.agents.treeviewer.actions.TreeViewerAction; 
    85 import org.openmicroscopy.shoola.agents.treeviewer.actions.ViewAction; 
     85import org.openmicroscopy.shoola.agents.treeviewer.actions.BrowseContainerAction; 
     86import org.openmicroscopy.shoola.agents.treeviewer.actions.ViewImageAction; 
    8687import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; 
    87 import org.openmicroscopy.shoola.agents.treeviewer.browser.TreeImageDisplay; 
    8888import org.openmicroscopy.shoola.agents.treeviewer.cmd.CopyCmd; 
    8989import org.openmicroscopy.shoola.agents.treeviewer.cmd.CutCmd; 
    … …  
    119119{ 
    120120 
    121         /** Identifies the <code>View action</code> in the Edit menu. */ 
    122         static final Integer    VIEW = new Integer(1); 
     121        /** Identifies the <code>Browse action</code> in the Edit menu. */ 
     122        static final Integer    BROWSE = new Integer(1); 
    123123 
    124124        /** Identifies the <code>Create object action</code> in the File menu. */ 
    … …  
    252252        static final Integer    CREATE_TOP_SCREEN = new Integer(40); 
    253253         
     254        /** Identifies the <code>View action</code> in the Edit menu. */ 
     255        static final Integer    VIEW = new Integer(41); 
     256         
    254257        /**  
    255258         * Reference to the {@link TreeViewer} component, which, in this context, 
    … …  
    273276        private void createActions() 
    274277        { 
    275                 actionsMap.put(VIEW, new ViewAction(model)); 
     278                actionsMap.put(BROWSE, new BrowseContainerAction(model)); 
    276279                actionsMap.put(CREATE_OBJECT, new CreateAction(model)); 
    277280                actionsMap.put(COPY_OBJECT, new CopyAction(model)); 
    … …  
    325328                                new CreateTopContainerAction(model,  
    326329                                                CreateTopContainerAction.SCREEN)); 
     330                actionsMap.put(VIEW, new ViewImageAction(model)); 
    327331        } 
    328332 
    … …  
    414418 
    415419                }); 
    416         } 
    417  
    418         /** 
    419          * Resets the selected node.  
    420          *  
    421          * @param d The node to reset. 
    422          */ 
    423         private void resetSelectedDisplay(TreeImageDisplay d) 
    424         { 
    425                 Browser b = model.getSelectedBrowser(); 
    426                 if (b != null) { 
    427                         //b.setSelectedDisplay(null); 
    428                         b.setSelectedDisplay(d); 
    429                 } 
    430420        } 
    431421         
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerFactory.java

    r5519 r5687  
    7070        private static final String NAME = "Data Manager"; 
    7171         
     72        /** The name of the windows menu. */ 
     73        private static final String MENU_NAME = "Data Manager"; 
     74         
    7275        /** The sole instance. */ 
    7376        private static final TreeViewerFactory  singleton = new TreeViewerFactory(); 
    … …  
    145148        } 
    146149 
     150        /** 
     151         * Saves the data before closing the application. 
     152         *  
     153         * @param evt 
     154         * @param agent 
     155         */ 
    147156        public static void saveOnClose(SaveEventRequest evt, Object agent) 
    148157        { 
    … …  
    223232                viewers = new HashSet<TreeViewer>(); 
    224233                isAttached = false; 
    225                 windowMenu = new JMenu("DataManagers"); 
     234                windowMenu = new JMenu(MENU_NAME); 
    226235        } 
    227236 
  • trunk/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerWin.java

    r5628 r5687  
    263263        //menu.add(createRootMenu()); 
    264264        menu.add(new JSeparator(JSeparator.HORIZONTAL)); 
     265        a = controller.getAction(TreeViewerControl.BROWSE); 
     266        item = new JMenuItem(a); 
     267        item.setText(a.getActionName()); 
     268        menuItems.add(item); 
     269        menu.add(item); 
    265270        a = controller.getAction(TreeViewerControl.VIEW); 
    266271        item = new JMenuItem(a); 
    … …  
    295300        menu.add(new JMenuItem( 
    296301                controller.getAction(TreeViewerControl.DELETE_OBJECT))); 
    297         /* 
    298         menu.add(new JSeparator(JSeparator.HORIZONTAL)); 
    299         menu.add(new JMenuItem( 
    300                 controller.getAction(TreeViewerControl.FIND))); 
    301         menu.add(new JMenuItem( 
    302                 controller.getAction(TreeViewerControl.CLEAR))); 
    303         menu.add(new JSeparator(JSeparator.HORIZONTAL)); 
    304         menu.add(new JMenuItem( 
    305                 controller.getAction(TreeViewerControl.CLASSIFY))); 
    306         menu.add(new JMenuItem( 
    307                 controller.getAction(TreeViewerControl.DECLASSIFY))); 
    308                 */ 
    309302        return menu; 
    310303    } 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/