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

Show
Ignore:
Timestamp:
09/12/08 13:33:44 (2 months ago)
Author:
jburel
Message:

Fixed layout problem and clean code

Location:
trunk/SRC/org/openmicroscopy/shoola
Files:
30 modified

  • agents/dataBrowser/DataBrowserAgent.java (modified) (1 diff)
  • agents/dataBrowser/ThumbnailsManager.java (modified) (1 diff)
  • agents/dataBrowser/browser/BrowserModel.java (modified) (2 diffs)
  • agents/dataBrowser/layout/LayoutFactory.java (modified) (3 diffs)
  • agents/dataBrowser/layout/LayoutUtils.java (modified) (2 diffs)
  • agents/dataBrowser/layout/SquaryLayout.java (modified) (1 diff)
  • agents/dataBrowser/util/FilteringDialog.java (modified) (3 diffs)
  • agents/dataBrowser/view/DataBrowser.java (modified) (1 diff)
  • agents/dataBrowser/view/DataBrowserModel.java (modified) (2 diffs)
  • agents/dataBrowser/view/ProjectsModel.java (modified) (1 diff)
  • agents/imviewer/browser/Browser.java (modified) (2 diffs)
  • agents/imviewer/browser/BrowserComponent.java (modified) (2 diffs)
  • agents/imviewer/browser/BrowserModel.java (modified) (1 diff)
  • agents/imviewer/util/proj/ProjectionDialog.java (modified) (11 diffs)
  • agents/imviewer/util/proj/ProjectionRef.java (modified) (3 diffs)
  • agents/imviewer/view/ControlPane.java (modified) (5 diffs)
  • agents/imviewer/view/ImViewerComponent.java (modified) (4 diffs)
  • agents/imviewer/view/ImViewerModel.java (modified) (2 diffs)
  • agents/imviewer/view/ToolBar.java (modified) (1 diff)
  • agents/treeviewer/TimeIntervalsLoader.java (modified) (1 diff)
  • agents/treeviewer/actions/CreateTopContainerAction.java (modified) (5 diffs)
  • agents/treeviewer/view/ToolBar.java (modified) (1 diff)
  • env/data/OMEROGateway.java (modified) (1 diff)
  • env/data/OmeroImageServiceImpl.java (modified) (5 diffs)
  • env/data/model/ProjectionParam.java (modified) (4 diffs)
  • util/image/geom/Factory.java (modified) (2 diffs)
  • util/ui/UIUtilities.java (modified) (5 diffs)
  • util/ui/login/ScreenLogin.java (modified) (5 diffs)
  • util/ui/search/QuickSearch.java (modified) (1 diff)
  • util/ui/search/SearchPanel.java (modified) (3 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/DataBrowserAgent.java

    r5472 r5609  
    3737import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory; 
    3838import org.openmicroscopy.shoola.agents.events.iviewer.RndSettingsCopied; 
    39 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewer; 
    40 import org.openmicroscopy.shoola.agents.treeviewer.view.TreeViewerFactory; 
    4139import org.openmicroscopy.shoola.env.Agent; 
    4240import org.openmicroscopy.shoola.env.LookupNames; 
    4341import org.openmicroscopy.shoola.env.config.Registry; 
    44 import org.openmicroscopy.shoola.env.data.events.SaveEventRequest; 
    4542import org.openmicroscopy.shoola.env.event.AgentEvent; 
    4643import org.openmicroscopy.shoola.env.event.AgentEventListener; 
    4744import org.openmicroscopy.shoola.env.event.EventBus; 
    48  
    4945import pojos.ExperimenterData; 
    5046 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/ThumbnailsManager.java

    r5606 r5609  
    8282    private Map<Long, Set>      thumbProviders; 
    8383 
     84    /** 
     85     * Creates a new instance. 
     86     *  
     87     * @param wells The nodes hosting the wells to display. 
     88     */ 
    8489    public ThumbnailsManager(Collection<ImageDisplay> wells) 
    8590    { 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/browser/BrowserModel.java

    r5606 r5609  
    126126            Set children = node.getChildrenDisplay(); 
    127127            if (children == null) return; 
     128            //desktop.removeAll(); 
    128129            Iterator i = children.iterator(); 
    129130            ImageDisplay child; 
    … …  
    152153            Set nodes = rootDisplay.getChildrenDisplay(); 
    153154            Iterator i = nodes.iterator(); 
    154             while (i.hasNext()) { 
     155            while (i.hasNext())  
    155156                        originalNodes.add((ImageDisplay) i.next()); 
    156                 } 
    157157        } 
    158158         
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/layout/LayoutFactory.java

    r5595 r5609  
    7979            case PLATE_LAYOUT: 
    8080                return new PlateLayout(); 
    81                  
    8281            default: 
    8382                throw new IllegalArgumentException("Unsupported layout type: "+ 
    … …  
    9190     * @return See above. 
    9291     */ 
    93     public static Layout createPlateLayout() 
    94     { 
    95         return new PlateLayout();  
    96     } 
     92    public static Layout createPlateLayout() { return new PlateLayout(); } 
    9793     
    9894    /** 
    … …  
    107103    {  
    108104        return createLayout(getDefaultLayoutIndex(), sorter, itemsPerRow);  
     105    } 
     106     
     107    /** 
     108     * Returns the default layout. 
     109     *  
     110     * @param sorter            Class used to sort the nodes by date or  
     111     *                                          alphabetically. 
     112     * @param itemsPerRow       The number of images per row.  
     113     * @return See above. 
     114     */ 
     115    public static Layout getDefaultLayout(ViewerSorter sorter) 
     116    {  
     117        return createLayout(getDefaultLayoutIndex(), sorter,  
     118                                        LayoutUtils.DEFAULT_PER_ROW);  
    109119    } 
    110120     
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/layout/LayoutUtils.java

    r5538 r5609  
    6363 
    6464        /** The default number of items per row. */ 
    65         private static final int        DEFAULT_PER_ROW = 10; 
     65        public static final int DEFAULT_PER_ROW = 10; 
    6666         
    6767        /** 
    … …  
    218218                 
    219219        l = sorter.sort(l); 
    220         if (itemsPerRow > 1) n = itemsPerRow; 
    221          
     220        if (itemsPerRow >= 1) n = itemsPerRow;  
    222221        else { 
    223222                n = l.size(); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/layout/SquaryLayout.java

    r5467 r5609  
    209209        } 
    210210        Object object = n.getHierarchyObject(); 
    211          
    212211        DataObject ho = (DataObject) object; 
    213212        Class klass = object.getClass(); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/util/FilteringDialog.java

    r5457 r5609  
    4343import java.util.List; 
    4444import javax.swing.Box; 
     45import javax.swing.BoxLayout; 
    4546import javax.swing.JButton; 
    4647import javax.swing.JCheckBox; 
    … …  
    270271                ratingOptions = new JComboBox(RATING); 
    271272                rating = new RatingComponent(5, RatingComponent.HIGH_SIZE); 
    272                 fromDate = UIUtilities.createDatePicker(); 
    273                 toDate = UIUtilities.createDatePicker(); 
     273                fromDate = UIUtilities.createDatePicker(false); 
     274                toDate = UIUtilities.createDatePicker(false); 
    274275                tagsArea = new JTextField(); 
    275276                tagsArea.setColumns(15); 
    … …  
    383384        private JPanel buildCalendarPane() 
    384385        { 
     386                JPanel date = new JPanel(); 
     387                date.add(UIUtilities.setTextFont("From: ")); 
     388                date.add(fromDate); 
     389                date.add(UIUtilities.setTextFont("To: ")); 
     390                date.add(toDate); 
    385391                JPanel p = new JPanel(); 
     392                p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS)); 
    386393                p.add(calendarBox); 
    387                 p.add(UIUtilities.setTextFont("From: ")); 
    388                 p.add(fromDate); 
    389                 p.add(UIUtilities.setTextFont("To: ")); 
    390                 p.add(toDate); 
     394                p.add(date); 
    391395                return UIUtilities.buildComponentPanel(p, 0, 0); 
    392396        } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowser.java

    r5606 r5609  
    449449        public void setComponentTitle(String title); 
    450450         
    451         public void viewField(int selectedIndex); 
     451        /** 
     452         * Views the selected well sample field while browsing a plate. 
     453         *  
     454         * @param field The index of the field. 
     455         */ 
     456        public void viewField(int field); 
    452457         
    453458} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserModel.java

    r5606 r5609  
    5252import org.openmicroscopy.shoola.agents.dataBrowser.layout.Layout; 
    5353import org.openmicroscopy.shoola.agents.dataBrowser.layout.LayoutFactory; 
     54import org.openmicroscopy.shoola.agents.dataBrowser.layout.LayoutUtils; 
    5455import org.openmicroscopy.shoola.agents.dataBrowser.visitor.ResetThumbnailVisitor; 
    5556import org.openmicroscopy.shoola.agents.util.ViewerSorter; 
    … …  
    185186                //Do initial layout and set the icons. 
    186187        if (browser.getSelectedLayout() == null) { 
    187                 Layout layout = LayoutFactory.createLayout(type, sorter, 1); 
     188                Layout layout = LayoutFactory.createLayout(type, sorter,  
     189                                LayoutUtils.DEFAULT_PER_ROW); 
    188190            browser.setSelectedLayout(layout); 
    189191        } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/ProjectsModel.java

    r5606 r5609  
    2525 
    2626//Java imports 
    27 import java.util.ArrayList; 
    2827import java.util.Collection; 
    29 import java.util.Iterator; 
    30 import java.util.List; 
    3128import java.util.Set; 
    3229 
    33 import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserLoader; 
    34 import org.openmicroscopy.shoola.agents.dataBrowser.ThumbnailLoader; 
    35 import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay; 
    36 import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageNode; 
     30 
    3731 
    3832//Third-party libraries 
    3933 
    4034//Application-internal dependencies 
    41 import pojos.ImageData; 
     35import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserLoader; 
     36import org.openmicroscopy.shoola.agents.dataBrowser.browser.ImageDisplay; 
    4237import pojos.ProjectData; 
    4338 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/Browser.java

    r5528 r5609  
    5959    extends ObservableComponent 
    6060{ 
    61         /**  
    62          * Factor use to determine the size of the annotate image 
    63          * w.r.t the rendered image. 
    64          */ 
    65         //public static final int       MAX_RATIO = 10; 
    6661         
    6762    /** 
    … …  
    118113     * Sets the zoom factor. 
    119114     *  
    120      * @param factor    The zoom factor to set. 
    121      */ 
    122     public void setZoomFactor(double factor); 
     115     * @param factor The zoom factor to set. 
     116     * @param reset      Pass <code>true</code> to reset the magnification factor. 
     117     *                           <code>false</code> to set it. 
     118     */ 
     119    public void setZoomFactor(double factor, boolean reset); 
    123120     
    124121    /** 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserComponent.java

    r5528 r5609  
    198198    /**  
    199199     * Implemented as specified by the {@link Browser} interface. 
    200      * @see Browser#setZoomFactor(double) 
    201      */ 
    202     public void setZoomFactor(double factor) 
     200     * @see Browser#setZoomFactor(double, boolean) 
     201     */ 
     202    public void setZoomFactor(double factor, boolean reset) 
    203203    { 
    204204        if (factor != -1) { 
    … …  
    222222        } 
    223223        model.setZoomFactor(factor); 
    224         view.zoomImage();   
     224        if (!reset) view.zoomImage();   
    225225    } 
    226226 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserModel.java

    r5499 r5609  
    527527        if (renderedImage == null) return; 
    528528        if (zoomFactor != ZoomAction.DEFAULT_ZOOM_FACTOR)  
    529             displayedImage = Factory.magnifyImage(renderedImage, zoomFactor, 0); 
     529            displayedImage = Factory.magnifyImage(renderedImage, zoomFactor, 0);//Factory.magnifyImage(zoomFactor, renderedImage); 
     530        //Factory.magnifyImage(renderedImage, zoomFactor, 0); 
    530531        else displayedImage = renderedImage; 
    531532    } 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionDialog.java

    r5592 r5609  
    3434import java.util.HashMap; 
    3535import java.util.Iterator; 
     36import java.util.LinkedHashMap; 
    3637import java.util.List; 
    3738import java.util.Map; 
    … …  
    5455//Application-internal dependencies 
    5556import org.openmicroscopy.shoola.agents.imviewer.IconManager; 
     57import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer; 
    5658import org.openmicroscopy.shoola.util.ui.TitlePanel; 
    5759import org.openmicroscopy.shoola.util.ui.UIUtilities; 
    … …  
    8789        public static final String              LOAD_DATASETS_PROPERTY = "loadDatasets"; 
    8890         
     91        private static final Map<Integer, String>       PROJECTIONS; 
     92         
    8993        /** The maximum number of z-sections. */ 
    90         private int                        maxZ; 
     94        private int                             maxZ; 
    9195         
    9296        /** The maximum number of timepoints. */ 
    93         private int                        maxT; 
     97        private int                             maxT; 
    9498     
    9599        /** The pixels type of the original image. */ 
    96         private String                             pixelsType; 
     100        private String                                  pixelsType; 
    97101         
    98102        /** Component hosting a two knobs slider and text field. */ 
    99         private TextualTwoKnobsSlider  textualSlider; 
     103        private TextualTwoKnobsSlider   textualSlider; 
    100104         
    101105        /** The type of projection. */ 
    102         private Map<Integer, Integer>  projectionType; 
     106        private Map<Integer, Integer>   projectionType; 
    103107 
    104108        /** Project the selected z-sections for the currently selected timepoint. */ 
    105         private JButton                            previewButton; 
     109        private JButton                                 previewButton; 
    106110         
    107111        /** Project the selected z-sections of the whole image. */ 
    108         private JButton                            projectionButton; 
     112        private JButton                                 projectionButton; 
    109113         
    110114         /** The bar notifying the user for the data retrieval progress. */ 
    111     private JProgressBar           progressBar; 
     115    private JProgressBar                progressBar; 
    112116     
    113117    /** The reference object hosting the parameters used to project. */ 
    114     private ProjectionRef                  ref; 
     118    private ProjectionRef                       ref; 
    115119     
    116120    /** The label displaying the status. */ 
    117     private JLabel                                 statusLabel; 
     121    private JLabel                                      statusLabel; 
    118122     
    119123    /** The type of supported projections. */ 
    120     private JComboBox                      types; 
     124    private JComboBox                           types; 
    121125     
    122126    /** The UI delegate. */ 
    123     private ProjectionUI           uiDelegate; 
     127    private ProjectionUI                uiDelegate; 
    124128     
    125129    /** Sets the stepping for the mapping. */ 
    126     private JSpinner                       frequency; 
     130    private JSpinner                            frequency; 
    127131     
    128132    /** The name of the image. */ 
    … …  
    138142        private ProjectionDialogControl controller; 
    139143         
     144        static { 
     145                PROJECTIONS = new LinkedHashMap<Integer, String>(); 
     146                PROJECTIONS.put(ImViewer.MAX_INTENSITY, "Maximum Intensity"); 
     147                PROJECTIONS.put(ImViewer.MEAN_INTENSITY, "Mean Intensity"); 
     148                PROJECTIONS.put(ImViewer.SUM_INTENSITY, "Sum Intensity"); 
     149        } 
     150 
    140151        /** Collects and stores the parameters used for projection. */ 
    141152        private void fillProjectionRef() 
    … …  
    153164         * Initializes the components composing the display.  
    154165         *  
    155          * @param projections The projection supported. 
    156166         * @param background  The background color. 
    157167         */ 
    158         private void initComponents(Map<Integer, String> projections,  
    159                                            Color background) 
     168        private void initComponents(Color background) 
    160169        { 
    161170                frequency = new JSpinner(new SpinnerNumberModel(1, 1, maxZ, 1)); 
    … …  
    181190        statusLabel = new JLabel(); 
    182191         
    183         String[] names = new String[projections.size()]; 
     192        String[] names = new String[PROJECTIONS.size()]; 
    184193        int index = 0; 
    185         Iterator<Integer> i = projections.keySet().iterator(); 
     194        Iterator<Integer> i = PROJECTIONS.keySet().iterator(); 
    186195        projectionType = new HashMap<Integer, Integer>(); 
    187196        int j; 
    … …  
    189198                        j = i.next(); 
    190199                        projectionType.put(index, j); 
    191                         names[index] = projections.get(j); 
     200                        names[index] = PROJECTIONS.get(j); 
    192201                        index++; 
    193202                } 
    … …  
    296305         *  
    297306         * @param owner       The owner of the dialog. 
    298          * @param projections The type of projection. 
    299307         * @param maxZ        The number of optical sections. 
    300308         * @param maxT            The number of timepoints. 
    … …  
    305313         * @param imageHeight  The width of the original image. 
    306314         */ 
    307         public ProjectionDialog(JFrame owner, Map<Integer, String> projections,  
    308                                      int maxZ, int maxT, String pixelsType,  
     315        public ProjectionDialog(JFrame owner, int maxZ, int maxT, String pixelsType,  
    309316                                     Color background, String imageName,  
    310317                                     int imageWidth, int imageHeight) 
    … …  
    316323                this.pixelsType = pixelsType; 
    317324                this.imageName = imageName; 
    318                 initComponents(projections, background); 
     325                initComponents(background); 
    319326                buildGUI(); 
    320327                Dimension d = new Dimension(imageWidth, imageHeight); 
    … …  
    405412        { 
    406413                fillProjectionRef(); 
     414                ref.setImageDescription("Projection type: "+ 
     415                                PROJECTIONS.get(ref.getType())); 
    407416                ref.setAllChannels(allChannels); 
    408417                ref.setDatasets(datasets); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionRef.java

    r5592 r5609  
    7676        private String            name; 
    7777         
     78        /** The description of the projected image. */ 
     79        private String                    description; 
     80         
    7881        /**  
    7982         * Project all channels if <code>true</code>, project the active channels 
    … …  
    181184         
    182185        /** 
     186         * Sets the description of the projected image. 
     187         *  
     188         * @param description The value to set. 
     189         */ 
     190        void setImageDescription(String description) 
     191        {  
     192                this.description = description; 
     193        } 
     194         
     195        /** 
    183196         * Sets the collection of datasets to add the image to. 
    184197         *  
    … …  
    205218         
    206219        /** 
     220         * Returns the description of the projected image. 
     221         *  
     222         * @return See above. 
     223         */ 
     224        public String getImageDescription() { return description; } 
     225         
     226        /** 
    207227         * Returns the collection of datasets to add the image to. 
    208228         *  
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ControlPane.java

    r5386 r5609  
    413413     
    414414    /** 
     415     * Builds a tool bar hosting the passed button. 
     416     *  
     417     * @param button The button to add. 
     418     * @return See above 
     419     */ 
     420    private JToolBar createMovieButtonBar(JButton button) 
     421    { 
     422        JToolBar bar = new JToolBar(); 
     423        bar.setFloatable(false); 
     424        bar.setRollover(true); 
     425        bar.setBorder(null); 
     426        bar.add(button); 
     427        return bar; 
     428    } 
     429     
     430    /** 
    415431     * Helper method to create a panel hosting the passed slider. 
    416432     *  
    … …  
    424440        pane.setLayout(new TableLayout(tl));