Changeset 1420


Ignore:
Timestamp:
09/06/06 15:01:56 (14 years ago)
Author:
curtis
Message:

Style and other code fixes.

Location:
trunk/loci/plugins/browser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/browser/CustomWindow.java

    r1419 r1420  
    2626import ij.*; 
    2727import ij.gui.*; 
    28 import ij.io.FileInfo; 
    2928import ij.measure.Calibration; 
    3029import java.io.File; 
     
    7069  // -- Constructor -- 
    7170 
    72   /** CustomWindow constructors, initialization */ 
     71  /** CustomWindow constructors, initialization. */ 
    7372  public CustomWindow(LociDataBrowser db, ImagePlus imp, ImageCanvas canvas) { 
    7473    super(imp, canvas); 
     
    277276  // -- CustomWindow methods -- 
    278277 
    279   /** selects and shows slice defined by z, t and c */ 
    280   public synchronized void showSlice(int z, int t, int c) { 
    281     int index = db.getIndex(z - 1, t - 1, c - 1); 
     278  /** Selects and shows slice defined by z, t and c. */ 
     279  public synchronized void showSlice(int zVal, int tVal, int cVal) { 
     280    int index = db.getIndex(zVal - 1, tVal - 1, cVal - 1); 
    282281    if (LociDataBrowser.DEBUG) { 
    283282      IJ.log("showSlice: index=" + index + 
    284         "; z=" + z + "; t=" + t + "; c=" + c); 
     283        "; z=" + zVal + "; t=" + tVal + "; c=" + cVal); 
    285284    } 
    286285    showSlice(index); 
    287286  } 
    288287 
    289   /** selects and shows slice defined by index */ 
     288  /** Selects and shows slice defined by index. */ 
    290289  public void showSlice(int index) { 
    291290    index++; 
     
    312311  // -- ImageWindow methods -- 
    313312 
    314   /** adds 3rd and 4th dimension slice position */ 
     313  /** Adds 3rd and 4th dimension slice position. */ 
    315314  public void drawInfo(Graphics g) { 
    316315    if (db == null) return; 
     
    405404  } 
    406405 
    407   /** Set the Z/T values for a custom virtualization. */ 
     406  /** Sets the Z/T values for a custom virtualization. */ 
    408407  public void setVirtualization(int[] values) { 
    409408    z1 = values[0]; 
     
    414413  } 
    415414 
    416   /** Swap the axes - if the flag is set, then animate along Z. */ 
     415  /** Swaps the axes - if the flag is set, then animate along Z. */ 
    417416  public void swap(boolean isZ) { 
    418417    customVirtualization = false; 
     
    433432  } 
    434433 
    435   /** Return true if the axes are swapped. */ 
     434  /** Returns true if the axes are swapped. */ 
    436435  public boolean isSwapped() { return zString.equals(T_STRING); } 
    437436 
    438   /** Return true if we are using a custom virtualization. */ 
     437  /** Returns true if we are using a custom virtualization. */ 
    439438  public boolean isCustom() { return customVirtualization; } 
    440439 
    441   /** Set the frames per second, and adjust the timer accordingly. */ 
     440  /** Sets the frames per second, and adjust the timer accordingly. */ 
    442441  public void setFps(int value) { 
    443442    fps = value; 
     
    471470      // (older versions of ImageJ truncate the final character) 
    472471      if (description.endsWith("</OME")) description += ">"; 
    473        
     472 
    474473      // pop up a new metadata viewer dialog 
    475474      JFrame meta = new JFrame("Metadata - " + getTitle()); 
     
    481480      meta.setVisible(true); 
    482481*/ 
    483       String [] args = {db.filename}; 
    484       MetadataNotebook metaNote = new MetadataNotebook(args,false,false); 
     482      String[] args = {db.filename}; 
     483      MetadataNotebook metaNote = new MetadataNotebook(args, false, false); 
    485484    } 
    486485    else if (cmd.equals("options")) { 
     
    529528 
    530529  /** 
    531    * Initialize the virtual stack, using the argument as its boundaries. 
     530   * Initializes the virtual stack, using the argument as its boundaries. 
    532531   * The argument should be in the form of (z1, z2, t1, t2). 
    533532   */ 
     
    599598    c = channels.isSelected() ? 1 : 2; 
    600599 
    601     if (db.virtual) {setIndices();} 
     600    if (db.virtual) setIndices(); 
    602601    showSlice(z, t, c); 
    603602  } 
  • trunk/loci/plugins/browser/ImagePlusWrapper.java

    r1271 r1420  
    2727import ij.process.*; 
    2828import java.awt.image.*; 
     29import java.io.IOException; 
    2930import loci.formats.*; 
    3031 
     
    4344   * @param stitch true if use file stitching 
    4445   */ 
    45   public ImagePlusWrapper(String name, boolean stitch) throws 
    46     java.io.IOException, FormatException 
     46  public ImagePlusWrapper(String name, IFormatReader r, boolean stitch) 
     47    throws IOException, FormatException 
    4748  { 
    48     FormatReader r = (FormatReader) LociDataBrowser.reader.getReader(name); 
    4949    try { 
    5050      OMEXMLMetadataStore s = new OMEXMLMetadataStore(); 
     
    8181        time = clock; 
    8282      } 
    83       IJ.showProgress((double)i/num); 
     83      IJ.showProgress((double) i/num); 
    8484      BufferedImage img = cm.openImage(name, i); 
    8585      if (img.getWidth() != sizeX || img.getHeight() != sizeY) { 
     
    102102            byte[] tmp = b; 
    103103            b = new byte[w*h]; 
    104             System.arraycopy(tmp,0,b,0,b.length); 
     104            System.arraycopy(tmp, 0, b, 0, b.length); 
    105105          } 
    106           ip = new ByteProcessor (w,h,b,null); 
     106          ip = new ByteProcessor(w, h, b, null); 
    107107          if (stackB == null) { 
    108             stackB = new ImageStack(w,h); 
     108            stackB = new ImageStack(w, h); 
    109109          } 
    110110          stackB.addSlice(name + ":" + (i + 1), ip); 
     
    176176 
    177177} 
    178  
  • trunk/loci/plugins/browser/ImagePreview.java

    r1386 r1420  
    3838  implements PropertyChangeListener 
    3939{ 
    40   ImageIcon thumbnail = null; 
    41   File file = null; 
     40  protected ImageIcon thumbnail = null; 
     41  protected File file = null; 
    4242 
    4343  public ImagePreview(JFileChooser fc) { 
     
    6262      ImageReader ir = new ImageReader(); 
    6363      FormatReader fr = (FormatReader) ir.getReader(file.getAbsolutePath()); 
    64       BufferedImage image = fr.openThumbImage(file.getAbsolutePath(),0); 
     64      BufferedImage image = fr.openThumbImage(file.getAbsolutePath(), 0); 
    6565 
    6666      thumbnail = new ImageIcon(image); 
  • trunk/loci/plugins/browser/LociDataBrowser.java

    r1419 r1420  
    4949  // -- Fields -- 
    5050 
    51   /** filename for each index */ 
     51  /** Filename for each index. */ 
    5252  protected String[] names; 
    5353 
    5454  /** The file format reader used by the plugin. */ 
    55   protected static ImageReader reader = new ImageReader(); 
     55  protected ImageReader reader = new ImageReader(); 
    5656 
    5757  /** The current file name. */ 
    58   protected static String filename; 
    59  
    60   /** whether dataset has multiple Z, T and C positions */ 
     58  protected String filename; 
     59 
     60  /** Whether dataset has multiple Z, T and C positions. */ 
    6161  protected boolean hasZ, hasT, hasC; 
    6262 
    63   /** number of Z, T and C positions */ 
     63  /** Number of Z, T and C positions. */ 
    6464  protected int numZ, numT, numC; 
    6565 
    66   /** lengths of all dimensional axes; lengths[0] equals image depth */ 
     66  /** Lengths of all dimensional axes; lengths[0] equals image depth. */ 
    6767  protected int[] lengths; 
    6868 
    69   /** indices into lengths array for Z, T and C */ 
     69  /** Indices into lengths array for Z, T and C. */ 
    7070  protected int zIndex, tIndex, cIndex; 
    7171 
    72   /** whether stack is accessed from disk as needed */ 
     72  /** Whether stack is accessed from disk as needed. */ 
    7373  protected boolean virtual; 
    7474 
    75   /** cache manager (if virtual stack is used). */ 
     75  /** Cache manager (if virtual stack is used). */ 
    7676  protected CacheManager manager; 
    7777 
     
    123123  } 
    124124 
    125   /** gets the slice number for the given Z, T and C indices */ 
     125  /** Gets the slice number for the given Z, T and C indices. */ 
    126126  public int getIndex(int z, int t, int c) { 
    127127    int[] pos = new int[lengths.length]; 
     
    139139  } 
    140140 
    141   /** Set the series to open. */ 
     141  /** Sets the series to open. */ 
    142142  public void setSeries(int num) { 
    143143    // TODO : this isn't the prettiest way of prompting for a series 
     
    285285        } 
    286286        else { 
    287           ipw = new ImagePlusWrapper(absname, true); 
     287          ipw = new ImagePlusWrapper(absname, reader.getReader(name), true); 
    288288          numZ = ipw.sizeZ; numT = ipw.sizeT; numC = ipw.sizeC; 
    289289          zIndex = ipw.dim.indexOf('Z') - 2; 
  • trunk/loci/plugins/browser/LociOpener.java

    r1368 r1420  
    3333import java.io.File; 
    3434import javax.swing.*; 
    35 import javax.swing.filechooser.FileFilter; 
    3635import loci.formats.*; 
    3736 
     
    4746  public LociOpener() { 
    4847    // set up the file chooser 
     48    fc = new ImageReader().getFileChooser(); 
    4949    String ijDir = OpenDialog.getDefaultDirectory(); 
    50     fc = ijDir == null ? new JFileChooser() : new JFileChooser(ijDir); 
    51  
    52     // add a custom file filter 
    53     FileFilter[] ff = LociDataBrowser.reader.getFileFilters(); 
    54     ff = ComboFileFilter.sortFilters(ff); 
    55     ComboFileFilter combo = 
    56       new ComboFileFilter(ff, "All supported file types"); 
    57     if (ff.length > 1) { 
    58       fc.addChoosableFileFilter(combo); 
    59     } 
    60     for (int i=0; i<ff.length; i++) { 
    61       fc.addChoosableFileFilter(ff[i]); 
    62     } 
    63     if (combo != null) fc.setFileFilter(combo); 
    64     else fc.setFileFilter(ff[0]); 
     50    if (ijDir != null) fc.setCurrentDirectory(new File(ijDir)); 
    6551 
    6652    // add the preview pane 
Note: See TracChangeset for help on using the changeset viewer.