Changeset 2569


Ignore:
Timestamp:
04/06/07 13:39:38 (13 years ago)
Author:
melissa
Message:

Deprecated IFormatWriter.save(String, Image, boolean); replaced with
IFormatWriter.saveImage(String, Image, boolean).

Location:
trunk/loci
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/formats/FormatTools.java

    r2564 r2569  
    606606      Image image = reader.openImage(in, i); 
    607607      long m = System.currentTimeMillis(); 
    608       writer.save(out, image, i == num - 1); 
     608      writer.saveImage(out, image, i == num - 1); 
    609609      long e = System.currentTimeMillis(); 
    610610      System.out.print("."); 
  • trunk/loci/formats/FormatWriter.java

    r2455 r2569  
    6868  // -- IFormatWriter API methods -- 
    6969 
    70   /** 
    71    * Saves the given image to the specified (possibly already open) file. 
    72    * If this image is the last one in the file, the last flag must be set. 
    73    */ 
    74   public abstract void save(String id, Image image, boolean last) 
     70  /* @see IFormatWriter#saveImage(String, Image, boolean) */ 
     71  public abstract void saveImage(String id, Image image, boolean last) 
    7572    throws FormatException, IOException; 
     73 
     74  /* @see IFormatWriter#save(String, Image, boolean) */  
     75  public void save(String id, Image image, boolean last) 
     76    throws FormatException, IOException 
     77  { 
     78    saveImage(id, image, last); 
     79  } 
    7680 
    7781  /** Reports whether the writer can save multiple images to a single file. */ 
  • trunk/loci/formats/IFormatWriter.java

    r2320 r2569  
    3636   * If this image is the last one in the file, the last flag must be set. 
    3737   */ 
     38  void saveImage(String id, Image image, boolean last) 
     39    throws FormatException, IOException; 
     40   
     41  /** @deprecated Replaced by {@link #saveImage(String, Image, boolean)} */ 
    3842  void save(String id, Image image, boolean last) 
    3943    throws FormatException, IOException; 
  • trunk/loci/formats/ImageWriter.java

    r2550 r2569  
    155155  // -- IFormatWriter API methods -- 
    156156 
     157  /* @see IFormatWriter#saveImage(String, Image, boolean) */ 
     158  public void saveImage(String id, Image image, boolean last) 
     159    throws FormatException, IOException 
     160  { 
     161    getWriter(id).saveImage(id, image, last); 
     162  } 
     163 
    157164  /* @see IFormatWriter#save(String, Image, boolean) */ 
    158165  public void save(String id, Image image, boolean last) 
  • trunk/loci/formats/out/AVIWriter.java

    r2492 r2569  
    9595   * If this image is the last one in the file, the last flag must be set. 
    9696   */ 
    97   public void save(String id, Image image, boolean last) 
     97  public void saveImage(String id, Image image, boolean last) 
    9898    throws FormatException, IOException 
    9999  { 
  • trunk/loci/formats/out/EPSWriter.java

    r2455 r2569  
    5252   * If this image is the last one in the file, the last flag must be set. 
    5353   */ 
    54   public void save(String id, Image image, boolean last) 
     54  public void saveImage(String id, Image image, boolean last) 
    5555    throws FormatException, IOException 
    5656  { 
  • trunk/loci/formats/out/ImageIOWriter.java

    r2455 r2569  
    7272   * The last flag is ignored, since this writer produces single-image files. 
    7373   */ 
    74   public void save(String id, Image image, boolean last) 
     74  public void saveImage(String id, Image image, boolean last) 
    7575    throws FormatException, IOException 
    7676  { 
  • trunk/loci/formats/out/JPEGWriter.java

    r2455 r2569  
    4343 
    4444  /* @see loci.formats.IFormatWriter#save(String, Image, boolean) */ 
    45   public void save(String id, Image image, boolean last) 
     45  public void saveImage(String id, Image image, boolean last) 
    4646    throws FormatException, IOException 
    4747  { 
  • trunk/loci/formats/out/LegacyQTWriter.java

    r2455 r2569  
    106106  // -- IFormatWriter API methods -- 
    107107 
    108   /** 
    109    * Saves the given image to the specified (possibly already open) file. 
    110    * If this image is the last one in the file, the last flag must be set. 
    111    */ 
    112   public void save(String id, Image image, boolean last) 
     108  /* @see loci.formats.IFormatWriter#save(String, Image, boolean) */ 
     109  public void saveImage(String id, Image image, boolean last) 
    113110    throws FormatException, IOException 
    114111  { 
     
    285282  } 
    286283 
    287   /** Reports whether the writer can save multiple images to a single file. */ 
     284  /* @see loci.formats.IFormatWriter#canDoStacks(String) */ 
    288285  public boolean canDoStacks(String id) { return true; } 
    289286 
  • trunk/loci/formats/out/QTWriter.java

    r2455 r2569  
    150150  // -- IFormatWriter API methods -- 
    151151 
    152   /** 
    153    * Saves the given image to the specified (possibly already open) file. 
    154    * If this image is the last one in the file, the last flag must be set. 
    155    */ 
    156   public void save(String id, Image image, boolean last) 
     152  /* @see loci.formats.IFormatWriter#save(String, Image, boolean) */  
     153  public void saveImage(String id, Image image, boolean last) 
    157154    throws FormatException, IOException 
    158155  { 
     
    590587  } 
    591588 
    592   /** Reports whether the writer can save multiple images to a single file. */ 
     589  /* @see loci.formats.IFormatWriter#canDoStacks(String) */ 
    593590  public boolean canDoStacks(String id) { return true; } 
    594591 
  • trunk/loci/formats/out/TiffWriter.java

    r2455 r2569  
    2828import java.awt.image.BufferedImage; 
    2929import java.io.*; 
    30 import java.util.Hashtable; 
     30import java.util.*; 
    3131import loci.formats.*; 
     32 
     33//import org.openmicroscopy.xml.*; 
     34//import org.openmicroscopy.xml.st.*; 
     35//import loci.formats.ome.OMEXMLMetadataStore; 
    3236 
    3337/** TiffWriter is the file format writer for TIFF files. */ 
     
    103107  // -- IFormatWriter API methods -- 
    104108 
    105   /** 
    106    * Saves the given image to the specified (possibly already open) file. 
    107    * If this image is the last one in the file, the last flag must be set. 
    108    */ 
    109   public void save(String id, Image image, boolean last) 
     109  /* @see loci.formats.IFormatWriter#save(String, Image, boolean) */  
     110  public void saveImage(String id, Image image, boolean last) 
    110111    throws FormatException, IOException 
    111112  { 
     
    119120  /* @see loci.formats.IFormatWriter#close() */ 
    120121  public void close() throws FormatException, IOException { 
     122    // write the metadata, if enabled  
     123   
     124    /* 
     125    if (metadataEnabled && store != null && currentId != null) { 
     126      // TODO : use reflection to access the OMEXMLMetadataStore 
     127      if (store instanceof OMEXMLMetadataStore) { 
     128        try {  
     129          // writes valid OME-TIFF  
     130          RandomAccessFile raf = new RandomAccessFile(currentId, "rw");  
     131          RandomAccessStream in = new RandomAccessStream(currentId); 
     132          OMENode xml = (OMENode) ((OMEXMLMetadataStore) store).getRoot(); 
     133          Vector images = xml.getChildNodes("Image"); 
     134          for (int p=0; p<images.size(); p++) { 
     135            PixelsNode pix =  
     136              (PixelsNode) ((ImageNode) images.get(p)).getDefaultPixels(); 
     137            DOMUtil.createChild(pix.getDOMElement(), "TiffData"); 
     138          } 
     139         
     140          Hashtable[] ifds = TiffTools.getIFDs(in);   
     141          TiffTools.overwriteIFDValue(raf, 0, TiffTools.IMAGE_DESCRIPTION, 
     142            xml.writeOME(true)); 
     143        } 
     144        catch (Exception e) { 
     145          e.printStackTrace(); 
     146        } 
     147      } 
     148      else { 
     149        throw new FormatException("Expecting an OMEXMLMetadataStore; got a " +  
     150          store.getClass()); 
     151      }  
     152    } 
     153    */  
     154 
    121155    if (out != null) out.close(); 
    122156    out = null; 
     
    125159  } 
    126160 
    127   /** Reports whether the writer can save multiple images to a single file. */ 
     161  /* @see loci.formats.IFormatWriter#canDoStacks(String) */ 
    128162  public boolean canDoStacks(String id) { return true; } 
    129163 
  • trunk/loci/plugins/Exporter.java

    r2560 r2569  
    151151            img = ImageTools.makeType(img, types[types.length - 1]); 
    152152          } 
    153           w.save(outfile, img, i == is.getSize() - 1); 
     153          w.saveImage(outfile, img, i == is.getSize() - 1); 
    154154        } 
    155         else w.save(outfile, img, i == is.getSize() - 1); 
     155        else w.saveImage(outfile, img, i == is.getSize() - 1); 
    156156      } 
    157157    } 
Note: See TracChangeset for help on using the changeset viewer.