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

Show
Ignore:
Timestamp:
09/26/08 09:22:10 (8 weeks ago)
Author:
jburel
Message:

Option to launch a viewer with newly created projected image.

Location:
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer
Files:
4 modified

  • RenderingSettingsCreator.java (modified) (5 diffs)
  • view/ImViewer.java (modified) (1 diff)
  • view/ImViewerComponent.java (modified) (5 diffs)
  • view/ImViewerModel.java (modified) (1 diff)

Legend:

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

    r5592 r5630  
    3636import org.openmicroscopy.shoola.env.data.views.CallHandle; 
    3737import org.openmicroscopy.shoola.env.rnd.RndProxyDef; 
     38import pojos.ImageData; 
     39 
    3840/**  
     41 * Creates rendering settings for the passed projected image. 
     42 * This class calls <code>createRndSetting</code> method in the 
     43 * <code>ImViewerView</code>. 
    3944 *  
    4045 * 
    … …  
    5358{ 
    5459         
    55         /** The ID of the projected pixels set. */ 
    56     private long                pixelsID; 
     60        /** The projected image. */ 
     61    private ImageData           image; 
    5762     
    5863    /** The rendering settings to copy i.e. setting of the original image. */ 
    59     private RndProxyDef         rndToCopy; 
     64    private RndProxyDef         rndToCopy; 
    6065     
    6166    /** Collection of channel's indexes. */ 
    … …  
    7075     * @param viewer    The view this loader is for. 
    7176     *                  Mustn't be <code>null</code>. 
    72      * @param pixelsID  The id of the pixels set. 
     77     * @param image     The projected image. 
    7378     * @param rndToCopy The rendering settings of the original image. 
    7479     * @param indexes   Collection of channel's indexes.  
    7580     *                                  Mustn't be <code>null</code>. 
    7681     */ 
    77     public RenderingSettingsCreator(ImViewer viewer, long pixelsID,  
     82    public RenderingSettingsCreator(ImViewer viewer, ImageData image,  
    7883                                                                RndProxyDef rndToCopy,  
    7984                                                                List<Integer> indexes) 
    8085    { 
    8186        super(viewer); 
    82         this.pixelsID = pixelsID; 
     87        if (image == null) 
     88                throw new IllegalArgumentException("No image specified."); 
     89        this.image = image; 
    8390        this.rndToCopy = rndToCopy; 
    8491        this.indexes = indexes; 
    … …  
    9198    public void load() 
    9299    { 
    93        handle = ivView.createRndSetting(pixelsID, rndToCopy, indexes, this); 
     100       handle = ivView.createRndSetting(image.getDefaultPixels().getId(),  
     101                   rndToCopy, indexes, this); 
    94102    } 
    95103 
    … …  
    107115    { 
    108116        if (viewer.getState() == ImViewer.DISCARDED) return;  //Async cancel. 
    109         viewer.setProjectedRenderingSettings((Boolean) result); 
     117        viewer.setProjectedRenderingSettings((Boolean) result, image); 
    110118    } 
    111119     
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewer.java

    r5622 r5630  
    896896         * Sets the settings created for the projected image. 
    897897         *  
    898          * @param result The value to set. 
    899          */ 
    900         public void setProjectedRenderingSettings(Boolean result); 
     898         * @param result        The value to set. 
     899         * @param image         The projected image. 
     900         */ 
     901        public void setProjectedRenderingSettings(Boolean result, ImageData image); 
    901902         
    902903} 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java

    r5622 r5630  
    5555import org.openmicroscopy.shoola.agents.events.iviewer.MeasurementTool; 
    5656import org.openmicroscopy.shoola.agents.events.iviewer.SaveRelatedData; 
     57import org.openmicroscopy.shoola.agents.events.iviewer.ViewImage; 
    5758import org.openmicroscopy.shoola.agents.events.iviewer.ViewerState; 
    5859import org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent; 
    … …  
    364365                } else if (option == MessageBox.CANCEL) return false; 
    365366                return true; 
     367        } 
     368         
     369 
     370        /** 
     371         * Notifies that the projected image has been created an asks if the  
     372         * user wants to launch a viewer with the projected image. 
     373         *  
     374         * @param message       The message to display. 
     375         * @param image         The projected image. 
     376         */ 
     377        private void notifyProjection(String message, ImageData image) 
     378        { 
     379                String text = message; 
     380                text += "\n Do you want to launch a viewer with the projected image."; 
     381                 
     382                MessageBox msg = new MessageBox(view, "Projection", text); 
     383                int option = msg.centerMsgBox(); 
     384                if (option == MessageBox.YES_OPTION) { 
     385                        EventBus bus = ImViewerAgent.getRegistry().getEventBus(); 
     386                        bus.post(new ViewImage(image, null)); 
     387                } 
    366388        } 
    367389         
    … …  
    25142536                model.fireContainersLoading(); 
    25152537        } 
    2516  
     2538         
    25172539        /**  
    25182540         * Implemented as specified by the {@link ImViewer} interface. 
    … …  
    25342556                if (projection.isApplySettings()) { 
    25352557                        projection.setStatus("Applying Rendering settings", false); 
    2536                         model.firePojectedRndSettingsCreation(indexes, 
    2537                                         image.getDefaultPixels().getId()); 
     2558                        model.firePojectedRndSettingsCreation(indexes, image); 
    25382559                        fireStateChange(); 
    25392560                } else { 
    2540                         message = "The projected image has been successfully created."; 
    2541                         un.notifyInfo("Projection", message); 
     2561                        notifyProjection("The projected image has been " + 
     2562                                        "successfully created.", image); 
    25422563                        projection.setVisible(false); 
    25432564                        projection.dispose(); 
    … …  
    25482569        /**  
    25492570         * Implemented as specified by the {@link ImViewer} interface. 
    2550          * @see ImViewer#setProjectedRenderingSettings(Boolean) 
    2551          */ 
    2552         public void setProjectedRenderingSettings(Boolean result) 
    2553         { 
    2554                 UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); 
     2571         * @see ImViewer#setProjectedRenderingSettings(Boolean, ImageData) 
     2572         */ 
     2573        public void setProjectedRenderingSettings(Boolean result, ImageData image) 
     2574        { 
    25552575                String message; 
    25562576                if (result) 
    2557                         message = "The rendering setting of the projected image have " + 
    2558                                         "been successfully copied."; 
     2577                        message = "The projected image and the rendering settings \n have" + 
     2578                                        " been successfully created."; 
    25592579                else 
    25602580                        message = "An error has occurred while copying the " + 
    2561                         "rendering setting of the projected image."; 
    2562                 un.notifyInfo("Projection", message); 
     2581                        "rendering settings of the projected image."; 
     2582                notifyProjection(message, image); 
    25632583                projection.setVisible(false); 
    25642584                projection.dispose(); 
  • trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java

    r5622 r5630  
    14171417         * for the pixels set. 
    14181418         *  
    1419          * @param indexes  The indexes of the projected channels. 
    1420          * @param pixelsID The id of the pixels set. 
    1421          */ 
    1422         void firePojectedRndSettingsCreation(List<Integer> indexes, long pixelsID) 
     1419         * @param indexes       The indexes of the projected channels. 
     1420         * @param image         The projected image. 
     1421         */ 
     1422        void firePojectedRndSettingsCreation(List<Integer> indexes, ImageData image) 
    14231423        { 
    14241424                RndProxyDef def = currentRndControl.getRndSettingsCopy(); 
    14251425                RenderingSettingsCreator l = new RenderingSettingsCreator(component,  
    1426                                 pixelsID, def, indexes); 
     1426                                image, def, indexes); 
    14271427                l.load(); 
    14281428        } 

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/