Changeset 6769


Ignore:
Timestamp:
08/05/10 16:04:15 (9 years ago)
Author:
curtis
Message:

Remove soft dependency on ome-io from bio-formats component.
The ome-io component now delegates to the Bio-Formats ImageViewer with
e.g. an OmeroReader, so the dependency graph avoids circular dependencies.

Location:
trunk/components
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/gui/ImageViewer.java

    r6766 r6769  
    7373import loci.formats.meta.MetadataRetrieve; 
    7474import loci.formats.meta.MetadataStore; 
    75 import loci.formats.services.OMEReaderWriterService; 
    7675import loci.formats.services.OMEXMLService; 
    7776 
     
    147146  protected OMEXMLService omexmlService; 
    148147 
    149   // -- Fields - OME I/O -- 
    150  
    151   /** Reader for OME servers. */ 
    152   protected IFormatReader omeReader; 
    153  
    154   /** Reader for OMERO servers. */ 
    155   protected IFormatReader omeroReader; 
    156  
    157   /** Writer for OME servers. */ 
    158   protected IFormatWriter omeWriter; 
    159  
    160   /** Writer for OMERO servers. */ 
    161   protected IFormatWriter omeroWriter; 
    162  
    163148  // -- Constructor -- 
    164149 
     
    181166    catch (DependencyException exc) { 
    182167      LOGGER.debug("OME-XML service unavailable", exc); 
    183     } 
    184     try { 
    185       // NB: avoid dependencies on optional loci.ome.io package 
    186       ServiceFactory factory = new ServiceFactory(); 
    187       OMEReaderWriterService omeIOService = 
    188         factory.getInstance(OMEReaderWriterService.class); 
    189       // OME server I/O engine 
    190       try { 
    191         omeReader = omeIOService.newOMEReader(); 
    192       } 
    193       catch (Exception exc) { 
    194         LOGGER.debug("OME reader not available", exc); 
    195       } 
    196       try { 
    197         omeWriter = omeIOService.newOMEWriter(); 
    198       } 
    199       catch (Exception exc) { 
    200         LOGGER.debug("OME writer not available", exc); 
    201       } 
    202  
    203       // OMERO server I/O engine 
    204       try { 
    205         omeroReader = omeIOService.newOMEROReader(); 
    206       } 
    207       catch (Exception exc) { 
    208         LOGGER.debug("OMERO reader not available", exc); 
    209       } 
    210       try { 
    211         omeroWriter = omeIOService.newOMEROWriter(); 
    212       } 
    213       catch (Exception exc) { 
    214         LOGGER.debug("OMERO writer not available", exc); 
    215       } 
    216     } 
    217     catch (DependencyException e) { 
    218       LOGGER.debug("OME and OMERO reader/writer service unavailable", e); 
    219168    } 
    220169 
     
    322271    fileExit.addActionListener(this); 
    323272    file.add(fileExit); 
    324  
    325     JMenu ome = new JMenu("OME"); 
    326     ome.setMnemonic('o'); 
    327     menubar.add(ome); 
    328     JMenuItem omeDownload = new JMenuItem("Download from OMERO..."); 
    329     omeDownload.setMnemonic('d'); 
    330     omeDownload.setActionCommand("download"); 
    331     omeDownload.addActionListener(this); 
    332     omeDownload.setEnabled(omeroReader != null); 
    333     ome.add(omeDownload); 
    334     JMenuItem omeUpload = new JMenuItem("Upload to OMERO..."); 
    335     omeUpload.setMnemonic('u'); 
    336     omeUpload.setActionCommand("upload"); 
    337     omeUpload.addActionListener(this); 
    338     omeUpload.setEnabled(omeroWriter != null); 
    339     ome.add(omeUpload); 
    340273 
    341274    JMenu options = new JMenu("Options"); 
     
    613546    } 
    614547    else if ("exit".equals(cmd)) dispose(); 
    615     else if ("download".equals(cmd)) { 
    616       // HACK - JOptionPane prevents shutdown on dispose 
    617       setDefaultCloseOperation(EXIT_ON_CLOSE); 
    618  
    619       // TODO - use loci.visbio.ome.OMELoginPane instead, 
    620       // after updating it and repackaging it to loci.ome.io.gui 
    621  
    622       String id = JOptionPane.showInputDialog(this, 
    623         "Enter OMERO connection string:", 
    624         "localhost?port=1099&username=omero&password=omero&id=1"); 
    625       open(id, omeroReader); 
    626     } 
    627     else if ("upload".equals(cmd)) { 
    628       // HACK - JOptionPane prevents shutdown on dispose 
    629       setDefaultCloseOperation(EXIT_ON_CLOSE); 
    630  
    631       // TODO - use loci.visbio.ome.OMELoginPane instead, 
    632       // after updating it and repackaging it to loci.ome.io.gui 
    633  
    634       String id = JOptionPane.showInputDialog(this, 
    635         "Enter OMERO connection string:", 
    636         "localhost?port=1099&username=omero&password=omero"); 
    637       save(id, omeroWriter); 
    638     } 
    639548    else if ("fps".equals(cmd)) { 
    640549      // HACK - JOptionPane prevents shutdown on dispose 
  • trunk/components/ome-io/src/loci/ome/io/services/OMEReaderWriterService.java

    r6026 r6769  
    44 
    55/* 
    6 OME Bio-Formats package for reading and converting biological file formats. 
    7 Copyright (C) 2005-@year@ UW-Madison LOCI and Glencoe Software, Inc. 
     6OME database I/O package for communicating with OME and OMERO servers. 
     7Copyright (C) 2005-@year@ Melissa Linkert, Curtis Rueden and Philip Huettl. 
    88 
    99This program is free software; you can redistribute it and/or modify 
     
    2222*/ 
    2323 
    24 package loci.formats.services; 
     24package loci.ome.io.services; 
    2525 
    2626import loci.common.services.Service; 
  • trunk/components/ome-io/src/loci/ome/io/services/OMEReaderWriterServiceImpl.java

    r6749 r6769  
    2727import loci.formats.IFormatReader; 
    2828import loci.formats.IFormatWriter; 
    29 import loci.formats.services.OMEReaderWriterService; 
    3029import loci.ome.io.OMEReader; 
    3130import loci.ome.io.OMEWriter; 
Note: See TracChangeset for help on using the changeset viewer.