Changeset 6279


Ignore:
Timestamp:
05/11/10 16:28:57 (10 years ago)
Author:
curtis
Message:

Fix a bunch of warnings.

Location:
trunk/components
Files:
14 edited

Legend:

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

    r6141 r6279  
    507507      } 
    508508      try { 
    509         childCopy = (IFormatReader) c.newInstance(); 
     509        childCopy = c.newInstance(); 
    510510      } 
    511511      catch (IllegalAccessException exc) { throw new FormatException(exc); } 
  • trunk/components/loci-plugins/src/loci/plugins/LociExporter.java

    r6229 r6279  
    7171    LibraryChecker.checkLibrary(LibraryChecker.Library.OME_JAVA_XML, missing); 
    7272    if (!LibraryChecker.checkMissing(missing)) return; 
    73     if (exporter != null) exporter.run(ip); 
     73    if (exporter != null) exporter.run(); 
    7474  } 
    7575 
  • trunk/components/loci-plugins/src/loci/plugins/in/SeriesDialog.java

    r6278 r6279  
    4040import java.awt.event.ActionListener; 
    4141import java.awt.image.BufferedImage; 
     42import java.io.IOException; 
    4243import java.util.StringTokenizer; 
    4344 
     
    4647import javax.swing.JLabel; 
    4748 
     49import loci.formats.FormatException; 
    4850import loci.formats.FormatTools; 
    4951import loci.formats.gui.AWTImageTools; 
     
    144146          p[i].add(new JLabel(icon)); 
    145147        } 
    146         catch (Exception e) { } 
     148        catch (FormatException exc) { } 
     149        catch (IOException exc) { } 
    147150      } 
    148151    } 
  • trunk/components/loci-plugins/src/loci/plugins/out/Exporter.java

    r6278 r6279  
    101101 
    102102  /** Executes the plugin. */ 
    103   public void run(ImageProcessor ip) { 
     103  public void run() { 
    104104    String outfile = null; 
    105105 
  • trunk/components/loci-plugins/src/loci/plugins/shortcut/ShortcutPanel.java

    r6007 r6279  
    4242import javax.swing.JFrame; 
    4343import javax.swing.JPanel; 
     44import javax.swing.WindowConstants; 
    4445import javax.swing.border.EmptyBorder; 
    4546 
     
    207208  public void run(String arg) { 
    208209    JFrame frame = new JFrame("LOCI Plugins Shortcut Window"); 
    209     frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 
     210    frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 
    210211    frame.setContentPane(new ShortcutPanel()); 
    211212    frame.pack(); 
  • trunk/components/loci-plugins/src/loci/plugins/shortcut/ShortcutTransferHandler.java

    r6128 r6279  
    7474      for (int i=0; i<flavors.length; i++) { 
    7575        if (fileIndex >= 0 && stringIndex >= 0 && listIndex >= 0) break; 
    76         Class c = flavors[i].getRepresentationClass(); 
     76        Class<?> c = flavors[i].getRepresentationClass(); 
    7777        if (fileIndex < 0 && c == File.class) fileIndex = i; 
    7878        if (stringIndex < 0 && c == String.class) stringIndex = i; 
     
    8080      } 
    8181      // convert data into list of objects 
    82       List list = null; 
     82      List<?> list = null; 
    8383      if (listIndex >= 0) { 
    84         list = (List) t.getTransferData(flavors[listIndex]); 
     84        list = (List<?>) t.getTransferData(flavors[listIndex]); 
    8585      } 
    8686      else if (fileIndex >= 0) { 
  • trunk/components/loci-plugins/src/loci/plugins/util/BFVirtualStack.java

    r6130 r6279  
    3131import java.awt.image.IndexColorModel; 
    3232import java.io.IOException; 
    33 import java.util.Vector; 
     33import java.util.ArrayList; 
     34import java.util.List; 
    3435 
    3536import loci.formats.ChannelMerger; 
     
    4142import loci.formats.cache.CacheStrategy; 
    4243import loci.formats.cache.CrosshairStrategy; 
     44import loci.plugins.util.RecordedImageProcessor.MethodEntry; 
    4345 
    4446/** 
     
    5961  protected Cache cache; 
    6062 
    61   private Vector[] methodStacks; 
     63  private List<List<MethodEntry>> methodStacks; 
    6264  private int currentSlice = -1; 
    6365  private RecordedImageProcessor currentProcessor; 
     
    114116    cache = new Cache(strategy, new ImageProcessorSource(r), true); 
    115117 
    116     methodStacks = new Vector[r.getImageCount()]; 
    117     for (int i=0; i<methodStacks.length; i++) { 
    118       methodStacks[i] = new Vector(); 
     118    methodStacks = new ArrayList<List<MethodEntry>>(); 
     119    for (int i=0; i<r.getImageCount(); i++) { 
     120      methodStacks.add(new ArrayList<MethodEntry>()); 
    119121    } 
    120122  } 
     
    132134  } 
    133135 
    134   public Vector getMethodStack() { 
    135     if (currentSlice >= 0) return methodStacks[currentSlice]; 
     136  public List<MethodEntry> getMethodStack() { 
     137    if (currentSlice >= 0) return methodStacks.get(currentSlice); 
    136138    return null; 
    137139  } 
     
    144146    // check cache first 
    145147    if (currentSlice >= 0 && currentProcessor != null) { 
    146       Vector currentStack = currentProcessor.getMethodStack(); 
     148      List<MethodEntry> currentStack = currentProcessor.getMethodStack(); 
    147149      if (currentStack.size() > 1) { 
    148         methodStacks[currentSlice].addAll(currentStack); 
     150        methodStacks.get(currentSlice).addAll(currentStack); 
    149151      } 
    150152    } 
     
    219221        } 
    220222      } 
    221       currentProcessor = new RecordedImageProcessor(ip, currentSlice, pos[1], 
    222         otherChannels); 
     223      currentProcessor = new RecordedImageProcessor(ip, pos[1], otherChannels); 
    223224      currentProcessor.setDoRecording(record); 
    224225      return currentProcessor; 
     
    227228    if (ip != null) { 
    228229      currentSlice = n - 1; 
    229       currentProcessor = new RecordedImageProcessor(ip, currentSlice); 
     230      currentProcessor = new RecordedImageProcessor(ip); 
    230231      currentProcessor.setDoRecording(record); 
    231232      return currentProcessor; 
  • trunk/components/loci-plugins/src/loci/plugins/util/DataBrowser.java

    r6131 r6279  
    4444import java.awt.Scrollbar; 
    4545import java.awt.event.ActionEvent; 
    46 import java.awt.event.ActionListener; 
    4746import java.awt.event.AdjustmentEvent; 
    4847import java.io.IOException; 
     
    7069 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/loci-plugins/src/loci/plugins/util/DataBrowser.java">SVN</a></dd></dl> 
    7170 */ 
    72 public class DataBrowser extends StackWindow implements ActionListener { 
     71public class DataBrowser extends StackWindow { 
    7372 
    7473  // -- Constants -- 
     
    183182      sliceSelector.addAdjustmentListener(this); 
    184183      sliceSelector.setFocusable(false); 
    185       int blockIncrement = (int) Math.max(z / 10, 1); 
     184      int blockIncrement = Math.max(z / 10, 1); 
    186185      sliceSelector.setUnitIncrement(1); 
    187186      sliceSelector.setBlockIncrement(blockIncrement); 
     
    193192      frameSelector.addAdjustmentListener(this); 
    194193      frameSelector.setFocusable(false); 
    195       int blockIncrement = (int) Math.max(t / 10, 1); 
     194      int blockIncrement = Math.max(t / 10, 1); 
    196195      frameSelector.setUnitIncrement(1); 
    197196      frameSelector.setBlockIncrement(blockIncrement); 
     
    388387    Rectangle r = getBounds(); 
    389388    Dimension w = optionsWindow.getSize(); 
    390     int x = (int) Math.max(5, r.x + (r.width - w.width) / 2); 
    391     int y = (int) Math.max(5, r.y + (r.height - w.height) / 2); 
     389    int x = Math.max(5, r.x + (r.width - w.width) / 2); 
     390    int y = Math.max(5, r.y + (r.height - w.height) / 2); 
    392391    optionsWindow.setLocation(x, y); 
    393392    optionsWindow.setVisible(true); 
  • trunk/components/loci-plugins/src/loci/plugins/util/ImagePlusTools.java

    r6246 r6279  
    138138    if (td != null) tcal = td.floatValue(); 
    139139 
    140     if (xcal == xcal || ycal == ycal || zcal == zcal || tcal == tcal) { 
     140    boolean xcalMissing = Double.isNaN(xcal); 
     141    boolean ycalMissing = Double.isNaN(ycal); 
     142    boolean zcalMissing = Double.isNaN(zcal); 
     143    boolean tcalMissing = Double.isNaN(tcal); 
     144    if (xcalMissing || ycalMissing || zcalMissing || tcalMissing) { 
    141145      // if the physical width or physical height are missing, assume that 
    142146      // the width and height are equal 
    143       if (xcal != xcal) xcal = ycal; 
    144       if (ycal != ycal) ycal = xcal; 
     147      if (!xcalMissing) xcal = ycal; 
     148      if (!ycalMissing) ycal = xcal; 
    145149 
    146150      Calibration cal = new Calibration(); 
  • trunk/components/loci-plugins/src/loci/plugins/util/LibraryChecker.java

    r6083 r6279  
    177177    sb.append(num == 1 ? "y was" : "ies were"); 
    178178    sb.append(" not found:"); 
    179     Iterator iter = missing.iterator(); 
     179    Iterator<String> iter = missing.iterator(); 
    180180    for (int i=0; i<num; i++) sb.append("\n    " + iter.next()); 
    181181    String them = num == 1 ? "it" : "them"; 
  • trunk/components/loci-plugins/src/loci/plugins/util/ROIHandler.java

    r6230 r6279  
    132132 
    133133  /** Save ROIs in the ROI manager to the given MetadataStore. */ 
    134   public static void saveROIs(MetadataStore store, int imageIndex) { 
     134  public static void saveROIs(MetadataStore store) { 
    135135    RoiManager manager = RoiManager.getInstance(); 
    136136    if (manager == null) return; 
     
    139139    for (int i=0; i<rois.length; i++) { 
    140140      if (rois[i] instanceof Line) { 
    141         storeLine((Line) rois[i], store, imageIndex, i, 0); 
     141        storeLine((Line) rois[i], store, i, 0); 
    142142      } 
    143143      else if (rois[i] instanceof PolygonRoi) { 
    144         storePolygon((PolygonRoi) rois[i], store, imageIndex, i, 0); 
     144        storePolygon((PolygonRoi) rois[i], store, i, 0); 
    145145      } 
    146146      else if (rois[i] instanceof ShapeRoi) { 
     
    148148        for (int q=0; q<subRois.length; q++) { 
    149149          if (subRois[q] instanceof Line) { 
    150             storeLine((Line) subRois[q], store, imageIndex, i, q); 
     150            storeLine((Line) subRois[q], store, i, q); 
    151151          } 
    152152          else if (subRois[q] instanceof PolygonRoi) { 
    153             storePolygon((PolygonRoi) subRois[q], store, imageIndex, i, q); 
     153            storePolygon((PolygonRoi) subRois[q], store, i, q); 
    154154          } 
    155155          else if (subRois[q] instanceof OvalRoi) { 
    156             storeOval((OvalRoi) subRois[q], store, imageIndex, i, q); 
    157           } 
    158           else storeRectangle(subRois[q], store, imageIndex, i, q); 
     156            storeOval((OvalRoi) subRois[q], store, i, q); 
     157          } 
     158          else storeRectangle(subRois[q], store, i, q); 
    159159        } 
    160160      } 
    161161      else if (rois[i] instanceof OvalRoi) { 
    162         storeOval((OvalRoi) rois[i], store, imageIndex, i, 0); 
    163       } 
    164       else storeRectangle(rois[i], store, imageIndex, i, 0); 
     162        storeOval((OvalRoi) rois[i], store, i, 0); 
     163      } 
     164      else storeRectangle(rois[i], store, i, 0); 
    165165    } 
    166166  } 
     
    169169 
    170170  /** Store a Line ROI in the given MetadataStore. */ 
    171   private static void storeLine(Line roi, MetadataStore store, int image, 
     171  private static void storeLine(Line roi, MetadataStore store, 
    172172    int roiNum, int shape) 
    173173  { 
     
    179179 
    180180  /** Store an Roi (rectangle) in the given MetadataStore. */ 
    181   private static void storeRectangle(Roi roi, MetadataStore store, int image, 
     181  private static void storeRectangle(Roi roi, MetadataStore store, 
    182182    int roiNum, int shape) 
    183183  { 
     
    191191  /** Store a Polygon ROI in the given MetadataStore. */ 
    192192  private static void storePolygon(PolygonRoi roi, MetadataStore store, 
    193     int image, int roiNum, int shape) 
     193    int roiNum, int shape) 
    194194  { 
    195195    Rectangle bounds = roi.getBounds(); 
     
    208208 
    209209  /** Store an Oval ROI in the given MetadataStore. */ 
    210   private static void storeOval(OvalRoi roi, MetadataStore store, int image, 
    211     int roiNum, int shape) 
     210  @SuppressWarnings("unused") 
     211  private static void storeOval(OvalRoi roi, 
     212    MetadataStore store, int roiNum, int shape) 
    212213  { 
    213214    // TODO: storeOval 
  • trunk/components/loci-plugins/src/loci/plugins/util/RecordedImageProcessor.java

    r6229 r6279  
    4747import java.lang.reflect.InvocationTargetException; 
    4848import java.lang.reflect.Method; 
    49 import java.util.Vector; 
     49import java.util.ArrayList; 
     50import java.util.List; 
    5051 
    5152/** 
     
    6667  private ImageProcessor proc; 
    6768  private boolean doRecording; 
    68   private Vector<MethodEntry> methodStack; 
    69   private int sliceNumber; 
     69  private List<MethodEntry> methodStack; 
    7070 
    7171  private int channelNumber; 
     
    7474  // -- Constructor -- 
    7575 
    76   public RecordedImageProcessor(ImageProcessor proc, int num) { 
     76  public RecordedImageProcessor(ImageProcessor proc) { 
    7777    this.proc = proc; 
    78     methodStack = new Vector<MethodEntry>(); 
     78    methodStack = new ArrayList<MethodEntry>(); 
    7979    doRecording = true; 
    80     sliceNumber = num; 
    81   } 
    82  
    83   public RecordedImageProcessor(ImageProcessor proc, int num, int channelNum, 
     80  } 
     81 
     82  public RecordedImageProcessor(ImageProcessor proc, int channelNum, 
    8483    ImageProcessor[] otherChannels) 
    8584  { 
    8685    this.proc = proc; 
    87     methodStack = new Vector<MethodEntry>(); 
     86    methodStack = new ArrayList<MethodEntry>(); 
    8887    doRecording = true; 
    89     sliceNumber = num; 
    9088    this.channelNumber = channelNum; 
    9189    this.otherChannels = otherChannels; 
     
    9896  } 
    9997 
    100   public Vector<MethodEntry> getMethodStack() { 
     98  public List<MethodEntry> getMethodStack() { 
    10199    return methodStack; 
    102100  } 
    103101 
    104   public void applyMethodStack(Vector<MethodEntry> stack) { 
     102  public void applyMethodStack(List<MethodEntry> stack) { 
    105103    for (int i=0; i<stack.size(); i++) { 
    106       MethodEntry m = (MethodEntry) stack.get(i); 
     104      MethodEntry m = stack.get(i); 
    107105      try { 
    108106        m.method.invoke(proc, m.args); 
  • trunk/components/loci-plugins/src/loci/plugins/util/SearchableWindow.java

    r5093 r6279  
    5656 * <a href="https://skyking.microscopy.wisc.edu/svn/java/trunk/components/loci-plugins/src/loci/plugins/util/SearchableWindow.java">SVN</a></dd></dl> 
    5757 */ 
    58 public class SearchableWindow extends TextWindow implements ActionListener { 
     58public class SearchableWindow extends TextWindow { 
    5959 
    6060  protected TextPanel panel; 
     
    9090 
    9191  public void selectLine(int index) { 
    92     int ys = panel.getFontMetrics(getFont()).getHeight() + 2; 
    93     int y = ys * (index + 1) + 2;  // absolute y coordinate 
    94     int totalHeight = ys * panel.getLineCount(); 
     92    //int ys = panel.getFontMetrics(getFont()).getHeight() + 2; 
     93    //int y = ys * (index + 1) + 2;  // absolute y coordinate 
     94    //int totalHeight = ys * panel.getLineCount(); 
    9595 
    9696    Scrollbar ss = null; 
     
    105105    } 
    106106 
    107     int height = panel.getHeight(); 
     107    //int height = panel.getHeight(); 
    108108 
    109109    // convert absolute y value to scrollbar and relative y coordinates 
  • trunk/components/loci-plugins/src/loci/plugins/util/VirtualImagePlus.java

    r5434 r6279  
    3131 
    3232import java.io.IOException; 
    33 import java.util.Vector; 
     33import java.util.List; 
    3434 
    3535import loci.formats.IFormatReader; 
     36import loci.plugins.util.RecordedImageProcessor.MethodEntry; 
    3637 
    3738/** 
     
    7576      stack = (BFVirtualStack) getStack(); 
    7677      RecordedImageProcessor proc = stack.getRecordedProcessor(); 
    77       Vector methods = stack.getMethodStack(); 
     78      List<MethodEntry> methods = stack.getMethodStack(); 
    7879      if (methods != null) { 
    7980        proc.applyMethodStack(methods); 
Note: See TracChangeset for help on using the changeset viewer.