Changeset 5528
- Timestamp:
- 07/04/08 13:41:43 (2 months ago)
- Location:
- trunk
- Files:
-
- 14 added
- 28 modified
-
LIB/common-3.0-Beta3.jar (modified) (previous)
-
LIB/model-psql-3.0-Beta3.jar (modified) (previous)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/ContainerLoader.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/DataLoader.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/IconManager.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/ProjectionSaver.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/actions/ProjectionAction.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/actions/RendererAction.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/browser/Browser.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserComponent.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/graphx/projection12.png (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/graphx/projection16.png (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/graphx/projection48.png (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionCanvas.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionDialog.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionDialogControl.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionRef.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionSavingDialog.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/proj/ProjectionUI.java (added)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewer.java (modified) (4 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java (modified) (7 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java (modified) (10 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java (modified) (3 diffs)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerUI.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/imviewer/view/ToolBar.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/treeviewer/view/DeleteDialog.java (modified) (1 diff)
-
SRC/org/openmicroscopy/shoola/agents/util/EditorUtil.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/OMEROGateway.java (modified) (4 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/OmeroImageService.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/OmeroImageServiceImpl.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/views/ImageDataView.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/views/ImageDataViewImpl.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/data/views/calls/ProjectionSaver.java (added)
-
SRC/org/openmicroscopy/shoola/env/data/views/calls/RelatedContainersLoader.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/rnd/PixelsServicesFactory.java (modified) (2 diffs)
-
SRC/org/openmicroscopy/shoola/env/rnd/RenderingControl.java (modified) (4 diffs)
-
SRC/org/openmicroscopy/shoola/env/rnd/RenderingControlProxy.java (modified) (3 diffs)
-
SRC/org/openmicroscopy/shoola/util/ui/filechooser/CreateFolderDialog.java (modified) (5 diffs)
-
SRC/org/openmicroscopy/shoola/util/ui/filechooser/FileChooser.java (modified) (1 diff)
-
TEST/org/openmicroscopy/shoola/env/data/NullRenderingService.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/DataLoader.java
r5256 r5528 39 39 import org.openmicroscopy.shoola.env.data.views.MetadataHandlerView; 40 40 import org.openmicroscopy.shoola.env.log.LogMessage; 41 42 41 import pojos.ExperimenterData; 43 42 44 43 /** 45 * 44 * Parent of all classes that load data asynchronously for a {@link ImViewer}. 45 * All these classes invoke methods of the {@link DataHandlerView}, 46 * {@link MetadataHandlerView} or {@link ImageDataView}, 47 * which this class makes available through a <code>protected</code> field. 48 * Also, this class extends {@link DSCallAdapter} so that subclasses 49 * automatically become observers to an asynchronous call. This class provides 50 * default implementations of some of the callbacks to notify the 51 * {@link ImViewer} of the progress and the user in the case of errors. 52 * Subclasses should at least implement the <code>handleResult</code> method 53 * to feed the {@link ImViewer} back with the results. 46 54 * 47 55 * @author Jean-Marie Burel -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/IconManager.java
r5422 r5528 234 234 public static int SET_RND_SETTINGS = 57; 235 235 236 /** The <code>Projection</code> icon. */ 237 public static int PROJECTION = 58; 238 239 /** The <code>Projection 48</code> icon. */ 240 public static int PROJECTION_48 = 59; 241 242 /** The <code>Projection 12</code> icon. */ 243 public static int PROJECTION_12 = 60; 244 236 245 /** 237 246 * The maximum ID used for the icon IDs. 238 247 * Allows to correctly build arrays for direct indexing. 239 248 */ 240 private static int MAX_ID = 57;249 private static int MAX_ID = 60; 241 250 242 251 /** Paths of the icon files. */ … … 303 312 relPaths[HISTORY_CLEAR_12] = "nuvola_history_clear12.png"; 304 313 relPaths[SET_RND_SETTINGS] = "nuvola_redo16.png"; 314 relPaths[PROJECTION] = "projection16.png"; 315 relPaths[PROJECTION_48] = "projection48.png"; 316 relPaths[PROJECTION_12] = "projection12.png"; 305 317 } 306 318 -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/actions/RendererAction.java
r4694 r5528 72 72 super(model, NAME); 73 73 putValue(Action.SHORT_DESCRIPTION, 74 74 75 UIUtilities.formatToolTipText(DESCRIPTION)); 75 76 IconManager icons = IconManager.getInstance(); -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/Browser.java
r5463 r5528 332 332 public double getGridRatio(); 333 333 334 /** 335 * Returns the background color of the canvas. 336 * 337 * @return See above. 338 */ 339 public Color getBackgroundColor(); 340 334 341 public void initializeMagnificationFactor(double f); 335 342 -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/browser/BrowserComponent.java
r5463 r5528 350 350 } 351 351 352 /** 353 * Implemented as specified by the {@link Browser} interface. 354 * @see Browser#getBackgroundColor() 355 */ 356 public Color getBackgroundColor() 357 { 358 return model.getBackgroundColor(); 359 } 360 352 361 /** 353 362 * Implemented as specified by the {@link Browser} interface. -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java
r5150 r5528 46 46 import org.openmicroscopy.shoola.agents.imviewer.util.ImagePaintingFactory; 47 47 import org.openmicroscopy.shoola.agents.imviewer.view.ImViewer; 48 import org.openmicroscopy.shoola.agents.util.EditorUtil; 48 49 import org.openmicroscopy.shoola.env.ui.UserNotifier; 49 50 import org.openmicroscopy.shoola.util.filter.file.TIFFFilter; … … 287 288 String getPartialImageName() 288 289 { 289 String originalName = model.getImageName(); 290 String name = originalName; 291 String[] l = UIUtilities.splitString(originalName); 292 if (l != null) { 293 int n = l.length; 294 if (n >= 1) name = l[n-1]; 295 } 296 297 if (Pattern.compile(".").matcher(name).find()) { 298 l = name.split("\\."); 299 if (l.length >= 1) { 300 name = ""; 301 int n = l.length-1; 302 for (int i = 0; i < n; i++) { 303 name += l[i]; 304 if (i < (n-1)) name += "."; 305 } 306 } 307 } 308 return name; 290 return EditorUtil.removeFileExtension(model.getImageName()); 309 291 } 310 292 -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewer.java
r5500 r5528 30 30 import java.awt.Point; 31 31 import java.awt.image.BufferedImage; 32 import java.util.Collection; 32 33 import java.util.List; 33 34 import java.util.Map; … … 39 40 40 41 //Application-internal dependencies 42 import org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjectionRef; 41 43 import org.openmicroscopy.shoola.env.data.model.ChannelMetadata; 42 44 import org.openmicroscopy.shoola.env.rnd.RenderingControl; … … 44 46 import org.openmicroscopy.shoola.util.ui.component.ObservableComponent; 45 47 import pojos.ExperimenterData; 48 import pojos.ImageData; 46 49 47 50 /** … … 835 838 /** Sets the original rendering settings. */ 836 839 public void setOriginalRndSettings(); 840 841 /** Shows the projection dialog and preview. */ 842 public void showProjection(); 843 844 /** 845 * Projects a selected portion of the optical sections 846 * for the currently selected timepoint and active channel. 847 * 848 * @param ref Object containing the projection parameters. 849 */ 850 public void projectionPreview(ProjectionRef ref); 851 852 /** 853 * Projects the whole image according the projection parameters. 854 * 855 * @param ref Object containing the projection parameters. 856 */ 857 public void projectImage(ProjectionRef ref); 858 859 /** 860 * Sets the containers contained the image. 861 * 862 * @param containers The collection to set. 863 */ 864 public void setContainers(Collection containers); 865 866 /** Loads the containers containing the image. */ 867 public void loadContainers(); 868 869 /** 870 * Sets the projected preview image. 871 * 872 * @param image The value to display. 873 */ 874 public void setRenderProjected(BufferedImage image); 875 876 /** 877 * Sets the newly created projected image. 878 * 879 * @param image The projected image. 880 */ 881 public void setProjectedImage(ImageData image); 837 882 838 883 } -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java
r5525 r5528 35 35 import java.awt.image.BufferedImage; 36 36 import java.util.ArrayList; 37 import java.util.Collection; 37 38 import java.util.HashMap; 38 39 import java.util.Iterator; 40 import java.util.LinkedHashMap; 39 41 import java.util.List; 40 42 import java.util.Map; … … 60 62 import org.openmicroscopy.shoola.agents.imviewer.util.HistoryItem; 61 63 import org.openmicroscopy.shoola.agents.imviewer.util.PreferencesDialog; 64 import org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjectionDialog; 65 import org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjectionRef; 62 66 import org.openmicroscopy.shoola.agents.imviewer.util.UnitBarSizeDialog; 63 67 import org.openmicroscopy.shoola.agents.imviewer.util.player.MoviePlayerDialog; … … 80 84 import org.openmicroscopy.shoola.util.ui.component.AbstractComponent; 81 85 import pojos.ExperimenterData; 86 import pojos.ImageData; 82 87 83 88 /** … … 116 121 static final String ANNOTATION = "The annotations"; 117 122 118 /** The message if rendering setting to annotation. */119 static final String RATING = "The rating";120 121 123 /** The Model sub-component. */ 122 124 private ImViewerModel model; … … 149 151 private boolean saveBeforeCopy; 150 152 153 /** The possible projections options. */ 154 private Map<Integer, String> projections; 155 156 /** The projection dialog. */ 157 private ProjectionDialog projection; 158 151 159 /** Creates an history item. */ 152 160 private void createHistoryItem() … … 733 741 pref.isHistory()) { 734 742 if (image != null) 735 view.setRestoreSize(image.getWidth(), image.getHeight()); 743 view.setRestoreSize(image.getWidth(), 744 image.getHeight()); 736 745 //boolean oldValue = view.isHistoryShown(); 737 746 view.showHistory(true); … … 2399 2408 } 2400 2409 2410 /** 2411 * Implemented as specified by the {@link ImViewer} interface. 2412 * @see ImViewer#showProjection() 2413 */ 2414 public void showProjection() 2415 { 2416 if (model.getState() == DISCARDED) 2417 throw new IllegalArgumentException("This method cannot be invoked" + 2418 " in the DISCARDED state."); 2419 if (projections == null) { 2420 projections = new LinkedHashMap<Integer, String>(); 2421 projections.put(RenderingControl.MAX_INTENSITY, 2422 "Maximum Intensity"); 2423 projections.put(RenderingControl.MEAN_INTENSITY, 2424 "Mean Intensity"); 2425 projections.put(RenderingControl.SUM_INTENSITY, 2426 "Sum Intensity"); 2427 } 2428 if (projection == null) { 2429 projection = new ProjectionDialog(view, projections, 2430 model.getMaxZ()+1, 2431 model.getBrowser().getBackgroundColor(), 2432 model.getImageName(), 2433 model.getOriginalImage()); 2434 projection.addPropertyChangeListener(controller); 2435 projection.setProjectedImage(model.getOriginalImage()); 2436 UIUtilities.incrementRelativeToAndShow(view.getBounds(), 2437 projection); 2438 } else { 2439 projection.setVisible(true); 2440 } 2441 } 2442 2443 /** 2444 * Implemented as specified by the {@link ImViewer} interface. 2445 * @see ImViewer#projectImage(ProjectionRef) 2446 */ 2447 public void projectImage(ProjectionRef ref) 2448 { 2449 if (model.getState() == DISCARDED) 2450 throw new IllegalArgumentException("This method cannot be invoked" + 2451 " in the DISCARDED state."); 2452 if (projection == null) return; 2453 if (!projection.isVisible()) return; 2454 UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); 2455 un.notifyInfo("Projection preview", "Not yet implemented"); 2456 projection.setVisible(false); 2457 projection.dispose(); 2458 projection = null; 2459 //model.fireProjectImage(ref); 2460 } 2461 2462 /** 2463 * Implemented as specified by the {@link ImViewer} interface. 2464 * @see ImViewer#setRenderProjected(BufferedImage) 2465 */ 2466 public void setRenderProjected(BufferedImage image) 2467 { 2468 if (image == null) { 2469 UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); 2470 un.notifyInfo("Projection preview", "An error has occurred " + 2471 "while projecting the data."); 2472 } 2473 projection.setProjectedImage(image); 2474 } 2475 2476 /** 2477 * Implemented as specified by the {@link ImViewer} interface. 2478 * @see ImViewer#projectionPreview(ProjectionRef) 2479 */ 2480 public void projectionPreview(ProjectionRef ref) 2481 { 2482 if (model.getState() == DISCARDED) 2483 throw new IllegalArgumentException("This method cannot be invoked" + 2484 " in the DISCARDED state."); 2485 if (projection == null) return; 2486 if (!projection.isVisible()) return; 2487 2488 /* 2489 BufferedImage img = null; 2490 try { 2491 img = model.renderProjected(ref.getStartZ(), ref.getEndZ(), 2492 ref.getStepping(), ref.getType()); 2493 } catch (Exception e) { 2494 projection.setProjectedImage(null); 2495 UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); 2496 un.notifyInfo("Projection preview", "An error has occurred " + 2497 "while projecting the data."); 2498 } 2499 projection.setProjectedImage(img); 2500 */ 2501 model.fireRenderProjected(ref); 2502 } 2503 2504 /** 2505 * Implemented as specified by the {@link ImViewer} interface. 2506 * @see ImViewer#setContainers(Collection) 2507 */ 2508 public void setContainers(Collection containers) 2509 { 2510 if (model.getState() == DISCARDED) 2511 throw new IllegalArgumentException("This method cannot be invoked" + 2512 " in the DISCARDED state."); 2513 if (projection == null) return; 2514 if (!projection.isVisible()) return; 2515 projection.setContainers(containers); 2516 } 2517 2518 /** 2519 * Implemented as specified by the {@link ImViewer} interface. 2520 * @see ImViewer#loadContainers() 2521 */ 2522 public void loadContainers() 2523 { 2524 if (model.getState() == DISCARDED) 2525 throw new IllegalArgumentException("This method cannot be invoked" + 2526 " in the DISCARDED state."); 2527 if (projection == null) return; 2528 if (!projection.isVisible()) return; 2529 model.fireContainersLoading(); 2530 } 2531 2532 /** 2533 * Implemented as specified by the {@link ImViewer} interface. 2534 * @see ImViewer#setProjectedImage(ImageData) 2535 */ 2536 public void setProjectedImage(ImageData image) 2537 { 2538 UserNotifier un = ImViewerAgent.getRegistry().getUserNotifier(); 2539 String message; 2540 if (image == null) 2541 message = "An error has occurred while creating the " + 2542 "projected image."; 2543 else message = "The image, "+image.getName() +" has been successfully " 2544 +"created"; 2545 un.notifyInfo("Projection", message); 2546 projection.setVisible(false); 2547 projection.dispose(); 2548 projection = null; 2549 } 2550 2401 2551 } -
trunk/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerControl.java
r5500 r5528 70 70 import org.openmicroscopy.shoola.agents.imviewer.actions.PlayMovieAction; 71 71 import org.openmicroscopy.shoola.agents.imviewer.actions.PreferencesAction; 72 import org.openmicroscopy.shoola.agents.imviewer.actions.ProjectionAction; 72 73 import org.openmicroscopy.shoola.agents.imviewer.actions.ROIToolAction; 73 74 import org.openmicroscopy.shoola.agents.imviewer.actions.RendererAction; … … 93 94 import org.openmicroscopy.shoola.agents.imviewer.util.InfoDialog; 94 95 import org.openmicroscopy.shoola.agents.imviewer.util.player.MoviePlayerDialog; 96 import org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjectionDialog; 97 import org.openmicroscopy.shoola.agents.imviewer.util.proj.ProjectionRef; 95 98 import org.openmicroscopy.shoola.agents.util.tagging.view.Tagger; 96 99 import org.openmicroscopy.shoola.env.data.model.ChannelMetadata; … … 300 303 */ 301 304 static final Integer SET_ORIGINAL_RND_SETTINGS = new Integer(62); 305 306 /** Identifies the <code>Projection</code> action. */ 307 static final Integer PROJECTION = new Integer(63); 302 308 303 309 /** … … 398 404 actionsMap.put(SET_ORIGINAL_RND_SETTINGS, 399 405 new SetOriginalRndSettingsAction(model)); 406 actionsMap.put(PROJECTION, new ProjectionAction(model)); 400 407 } 401 408 … … 729 736 public void propertyChange(PropertyChangeEvent pce) 730 737 { 731 String p ropName = pce.getPropertyName();732 if (ImViewer.Z_SELECTED_PROPERTY.equals(p ropName)) {738 String pName = pce.getPropertyName(); 739 if (ImViewer.Z_SELECTED_PROPERTY.equals(pName)) { 733 740 view.setZSection(((Integer) pce.getNewValue()).intValue()); 734 } else if (ImViewer.T_SELECTED_PROPERTY.equals(p ropName)) {741 } else if (ImViewer.T_SELECTED_PROPERTY.equals(pName)) { 735 742 view.setTimepoint(((Integer) pce.getNewValue()).intValue()); 736 } else if (ChannelButton.CHANNEL_SELECTED_PROPERTY.equals(p ropName)) {743 } else if (ChannelButton.CHANNEL_SELECTED_PROPERTY.equals(pName)) { 737 744 Map map = (Map) pce.getNewValue(); 738 745 if (map == null) return; … … 745 752 ((Boolean) map.get(index)).booleanValue()); 746 753 } 747 } else if (LoadingWindow.CLOSED_PROPERTY.equals(p ropName)) {754 } else if (LoadingWindow.CLOSED_PROPERTY.equals(pName)) { 748 755 model.discard(); 749 } else if (Renderer.RENDER_PLANE_PROPERTY.equals(p ropName)) {756 } else if (Renderer.RENDER_PLANE_PROPERTY.equals(pName)) { 750 757 model.renderXYPlane(); 751 } else if (Renderer.SELECTED_CHANNEL_PROPERTY.equals(p ropName)) {758 } else if (Renderer.SELECTED_CHANNEL_PROPERTY.equals(pName)) { 752 759 if (model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL)) { 753 760 int c = ((Integer) pce.getNewValue()).intValue(); … … 756 763 model.displayChannelMovie(); 757 764 } 758 } else if (ChannelButton.INFO_PROPERTY.equals(p ropName)) {765 } else if (ChannelButton.INFO_PROPERTY.equals(pName)) { 759 766 int index = ((Integer) pce.getNewValue()).intValue(); 760 767 ChannelMetadata data = model.getChannelMetadata(index); … … 768 775 "selected channel."); 769 776 } 770 } else if (ChannelButton.CHANNEL_COLOR_PROPERTY.equals(p ropName) ||771 ChannelColorMenuItem.CHANNEL_COLOR_PROPERTY.equals(p ropName)) {777 } else if (ChannelButton.CHANNEL_COLOR_PROPERTY.equals(pName) || 778 ChannelColorMenuItem.CHANNEL_COLOR_PROPERTY.equals(pName)) { 772 779 colorPickerIndex = ((Integer) pce.getNewValue()).intValue(); 773 780 showColorPicker(colorPickerIndex); 774 } else if (ColourPicker.COLOUR_PROPERTY.equals(p ropName)) {781 } else if (ColourPicker.COLOUR_PROPERTY.equals(pName)) { 775 782 Color c = (Color) pce.getNewValue();
