Changeset 7084


Ignore:
Timestamp:
10/18/10 15:48:06 (9 years ago)
Author:
melissa
Message:

Fixed a few deprecation warnings and compile errors.

Location:
trunk/components
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/in/LIFReader.java

    r7037 r7084  
    3333import loci.common.RandomAccessInputStream; 
    3434import loci.common.services.DependencyException; 
     35import loci.common.services.ServiceException; 
    3536import loci.common.services.ServiceFactory; 
    3637import loci.common.xml.XMLTools; 
     
    335336  /** Parses a string of XML and puts the values in a Hashtable. */ 
    336337  private void initMetadata(String xml) throws FormatException, IOException { 
    337     IMetadata omexml = MetadataTools.createOMEXMLMetadata(); 
     338    IMetadata omexml = null; 
     339    try { 
     340      ServiceFactory factory = new ServiceFactory(); 
     341      OMEXMLService service = factory.getInstance(OMEXMLService.class); 
     342      omexml = service.createOMEXMLMetadata(); 
     343    } 
     344    catch (DependencyException exc) { 
     345      throw new FormatException("Could not create OME-XML store.", exc); 
     346    } 
     347    catch (ServiceException exc) { 
     348      throw new FormatException("Could not create OME-XML store.", exc); 
     349    } 
    338350    MetadataStore store = makeFilterMetadata(); 
    339351    MetadataLevel level = getMetadataOptions().getMetadataLevel(); 
  • trunk/components/legacy/ome-notes/src/loci/ome/notes/Notes.java

    r6881 r7084  
    453453        if (!name.endsWith(".ome")) name += ".ome"; 
    454454 
    455         java.util.List delegates = metadata.getDelegates(); 
    456455        String xml = null; 
    457         for (int i=0; i<delegates.size(); i++) { 
    458           try { 
    459             if (service.isOMEXMLMetadata(delegates.get(i))) { 
    460               xml = service.getOMEXML((MetadataRetrieve) delegates.get(i)); 
    461             } 
    462           } 
    463           catch (ServiceException exc) { } 
    464         } 
     456        try { 
     457          xml = service.getOMEXML((MetadataRetrieve) metadata); 
     458        } 
     459        catch (ServiceException exc) { } 
     460 
    465461        File f = new File(name); 
    466462        FileWriter writer = new FileWriter(f); 
     
    617613    progress.setString("Reading " + currentFile); 
    618614 
    619     metadata = new AggregateMetadata(new ArrayList()); 
     615    ArrayList delegates = new ArrayList(); 
    620616 
    621617    if (currentFile.endsWith(".ome")) { 
     
    624620      s.close(); 
    625621      try { 
    626         metadata.addDelegate(service.createOMEXMLMetadata(xml)); 
     622        delegates.add(service.createOMEXMLMetadata(xml)); 
    627623      } 
    628624      catch (ServiceException e) { } 
     
    657653 
    658654        if (currentTemplate.preferCompanion()) { 
    659           metadata.addDelegate(companionStore); 
    660           metadata.addDelegate(readerStore); 
     655          delegates.add(companionStore); 
     656          delegates.add(readerStore); 
    661657        } 
    662658        else { 
    663           metadata.addDelegate(readerStore); 
    664           metadata.addDelegate(companionStore); 
    665         } 
    666       } 
    667       else metadata.addDelegate(readerStore); 
     659          delegates.add(readerStore); 
     660          delegates.add(companionStore); 
     661        } 
     662      } 
     663      else delegates.add(readerStore); 
    668664 
    669665      // grab thumbnails 
     
    676672      reader.close(); 
    677673    } 
     674    metadata = new AggregateMetadata(delegates); 
    678675 
    679676    progress.setString("Populating fields..."); 
  • trunk/components/visbio/src/loci/visbio/view/CaptureHandler.java

    r6881 r7084  
    270270            try { 
    271271              writer.setId(name); 
    272               writer.savePlane(image, !doMovie); 
     272              writer.savePlane(count - 1, image); 
    273273            } 
    274274            catch (IOException exc) { exc.printStackTrace(); } 
Note: See TracChangeset for help on using the changeset viewer.