/** Releases the resources used by this PlotWindow */ public void dispose() { if (plot!=null) plot.dispose(); disableLivePlot(); plot = null; plotMaker = null; srcImp = null; super.dispose(); }
/** Releases the resources used by this PlotWindow */ public void dispose() { if (plot!=null) plot.dispose(); disableLivePlot(); plot = null; plotMaker = null; srcImp = null; super.dispose(); }
/** Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. * <code>title</code> may be null, then a default title is used. */ public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) { Plot hiresPlot = null; try { hiresPlot = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned } catch (Exception e) {return null;} hiresPlot.ip = null; hiresPlot.imp = null; hiresPlot.pp = pp.clone(); if (!plotDrawn) hiresPlot.getInitialMinAndMax(); hiresPlot.setScale(scale); hiresPlot.setAntialiasedText(antialiasedText); hiresPlot.defaultMinMax = currentMinMax.clone(); ImageProcessor hiresIp = hiresPlot.getProcessor(); if (title == null || title.length() == 0) title = getTitle()+"_HiRes"; title = WindowManager.makeUniqueName(title); ImagePlus hiresImp = new ImagePlus(title, hiresIp); Calibration cal = hiresImp.getCalibration(); hiresPlot.adjustCalibration(cal); if (showIt) { hiresImp.setIgnoreGlobalCalibration(true); hiresImp.show(); } hiresPlot.dispose(); //after drawing, we don't need the plot of the high-resolution image any more return hiresImp; }
/** Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. * <code>title</code> may be null, then a default title is used. */ public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) { Plot hiresPlot = null; try { hiresPlot = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned } catch (Exception e) {return null;} hiresPlot.ip = null; hiresPlot.imp = null; hiresPlot.pp = pp.clone(); if (!plotDrawn) hiresPlot.getInitialMinAndMax(); hiresPlot.setScale(scale); hiresPlot.setAntialiasedText(antialiasedText); hiresPlot.defaultMinMax = currentMinMax.clone(); ImageProcessor hiresIp = hiresPlot.getProcessor(); if (title == null || title.length() == 0) title = getTitle()+"_HiRes"; title = WindowManager.makeUniqueName(title); ImagePlus hiresImp = new ImagePlus(title, hiresIp); Calibration cal = hiresImp.getCalibration(); hiresPlot.adjustCalibration(cal); if (showIt) { hiresImp.setIgnoreGlobalCalibration(true); hiresImp.show(); } hiresPlot.dispose(); //after drawing, we don't need the plot of the high-resolution image any more return hiresImp; }