()
| 1898 | } |
| 1899 | |
| 1900 | @AstroImageJ(reason = "Support scalable plots") |
| 1901 | public Plot duplicate() { |
| 1902 | try { |
| 1903 | var p = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned, but they will be used only now |
| 1904 | p.ip = null; |
| 1905 | p.imp = null; |
| 1906 | p.pp = pp.clone(); |
| 1907 | if (p.isAijPlot() && !VectorPlotDrawing.SCALED_PLOT.orElse(true)) { |
| 1908 | p.pp.width = (int)(pp.width / Prefs.getGuiScale()); |
| 1909 | p.pp.height = (int)(pp.height / Prefs.getGuiScale()); |
| 1910 | } |
| 1911 | if (!plotDrawn) p.getInitialMinAndMax(); |
| 1912 | //scaledPlot.setScale(scale); |
| 1913 | //scaledPlot.setAntialiasedText(antialiasedText); |
| 1914 | p.defaultMinMax = currentMinMax.clone(); |
| 1915 | p.plotDrawn = false; |
| 1916 | |
| 1917 | return p; |
| 1918 | } catch (Exception e) { |
| 1919 | return null; |
| 1920 | } |
| 1921 | } |
| 1922 | |
| 1923 | /** Releases the ImageProcessor and ImagePlus associated with the plot. |
| 1924 | * May help garbage collection because some garbage collectors |
no test coverage detected