Changeset 2825


Ignore:
Timestamp:
05/25/07 13:44:19 (13 years ago)
Author:
melissa
Message:

Check value of "bioformats.forceThumbnails" to determine whether or not to
load all of the thumbnails before displaying the series chooser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/ImporterOptions.java

    r2785 r2825  
    3434import java.util.Vector; 
    3535import javax.swing.Box; 
     36import javax.swing.JLabel; 
     37import javax.swing.ImageIcon; 
    3638import loci.formats.*; 
    3739 
     
    8183  public static final String PREF_CONCATENATE = "bioformats.concatenate"; 
    8284  public static final String PREF_RANGE = "bioformats.specifyRanges"; 
     85  public static final String PREF_THUMBNAIL = "bioformats.forceThumbnails"; 
    8386 
    8487  // labels for user dialog; when trimmed these double as argument & macro keys 
     
    118121  private boolean concatenate; 
    119122  private boolean specifyRanges; 
     123  private boolean forceThumbnails; 
    120124 
    121125  private String location; 
     
    137141  public boolean isConcatenate() { return concatenate; } 
    138142  public boolean isSpecifyRanges() { return specifyRanges; } 
     143  public boolean isForceThumbnails() { return forceThumbnails; } 
    139144 
    140145  public boolean isViewNone() { return VIEW_NONE.equals(stackFormat); } 
     
    168173    concatenate = Prefs.get(PREF_CONCATENATE, false); 
    169174    specifyRanges = Prefs.get(PREF_RANGE, false); 
     175    forceThumbnails = Prefs.get(PREF_THUMBNAIL, false);  
    170176  } 
    171177 
     
    441447      p[i].add(Box.createRigidArea(new Dimension(sx, sy))); 
    442448      gbc.gridy = i; 
     449      if (forceThumbnails) { 
     450        IJ.showStatus("Reading thumbnail for series #" + (i + 1)); 
     451        int z = r.getSizeZ() / 2; 
     452        int t = r.getSizeT() / 2; 
     453        int ndx = r.getIndex(z, 0, t); 
     454        try {  
     455          ImageIcon icon = new ImageIcon(r.openThumbImage(ndx)); 
     456          p[i].removeAll();  
     457          p[i].add(new JLabel(icon)); 
     458        } 
     459        catch (Exception e) { } 
     460      }  
    443461      gdl.setConstraints(p[i], gbc); 
    444462      gd.add(p[i]); 
    445463    } 
    446464    Util.addScrollBars(gd); 
    447     ThumbLoader loader = new ThumbLoader(r, p, gd); 
    448     gd.showDialog(); 
    449     loader.stop(); 
     465    if (forceThumbnails) gd.showDialog(); 
     466    else { 
     467      ThumbLoader loader = new ThumbLoader(r, p, gd); 
     468      gd.showDialog(); 
     469      loader.stop(); 
     470    }  
    450471    if (gd.wasCanceled()) return STATUS_CANCELED; 
    451472 
Note: See TracChangeset for help on using the changeset viewer.