Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
FileOpener Class Reference

Public Member Functions

 FileOpener (FileInfo fi)
 
void open ()
 
ImagePlus open (boolean show)
 
void revertToSaved (ImagePlus imp)
 
ColorModel createColorModel (FileInfo fi)
 
InputStream createInputStream (FileInfo fi) throws IOException, MalformedURLException
 
Properties decodeDescriptionString ()
 

Detailed Description

Opens or reverts an image specified by a FileInfo object. Images can be loaded from either a file (directory+fileName) or a URL (url+fileName). Here is an example:

  public class FileInfo_Test implements PlugIn {
    public void run(String arg) {
      FileInfo fi = new FileInfo();
      fi.width = 256;
      fi.height = 254;
      fi.offset = 768;
      fi.fileName = "blobs.tif";
      fi.directory = "/Users/wayne/Desktop/";
      new FileOpener(fi).open();
    }  
  } 

Definition at line 30 of file FileOpener.java.

Member Function Documentation

ColorModel createColorModel ( FileInfo  fi)
inline

Returns an IndexColorModel for the image specified by this FileInfo.

Definition at line 220 of file FileOpener.java.

InputStream createInputStream ( FileInfo  fi) throws IOException, MalformedURLException
inline

Returns an InputStream for the image described by this FileInfo.

Definition at line 228 of file FileOpener.java.

void open ( )
inline

Opens the image and displays it.

Definition at line 45 of file FileOpener.java.

ImagePlus open ( boolean  show)
inline
Opens the image. Displays it if 'show' is

true. Returns an ImagePlus object if successful.

Definition at line 51 of file FileOpener.java.

void revertToSaved ( ImagePlus  imp)
inline

Restores original disk or network version of image.

Definition at line 100 of file FileOpener.java.


The documentation for this class was generated from the following file: