Plot.useTemplate with 't', Plot.addFromPlot with 'a'
(Plot plot, char type)
| 2727 | |
| 2728 | /** Plot.useTemplate with 't', Plot.addFromPlot with 'a' */ |
| 2729 | double fromPlot(Plot plot, char type) { |
| 2730 | ImagePlus sourceImp = null; |
| 2731 | interp.getLeftParen(); |
| 2732 | if (isStringArg()) { |
| 2733 | String title = getString(); |
| 2734 | sourceImp = WindowManager.getImage(title); |
| 2735 | if (sourceImp==null) |
| 2736 | interp.error("Image \""+title+"\" not found"); |
| 2737 | } else { |
| 2738 | int id = (int)interp.getExpression(); |
| 2739 | sourceImp = WindowManager.getImage(id); |
| 2740 | if (sourceImp==null) |
| 2741 | interp.error("Image ID="+id+" not found"); |
| 2742 | } |
| 2743 | Plot sourcePlot = (Plot)(sourceImp.getProperty(Plot.PROPERTY_KEY)); |
| 2744 | if (sourcePlot==null) |
| 2745 | interp.error("No plot: "+sourceImp.getTitle()); |
| 2746 | if (type == 'a') { |
| 2747 | int objectIndex = (int)getNextArg(); |
| 2748 | if (objectIndex < 0 || objectIndex > plot.getNumPlotObjects()) |
| 2749 | interp.error("Plot "+sourceImp.getTitle()+" has "+plot.getNumPlotObjects()+"items, no number "+objectIndex); |
| 2750 | plot.addObjectFromPlot(sourcePlot, objectIndex); |
| 2751 | plot.updateImage(); |
| 2752 | } else |
| 2753 | plot.useTemplate(sourcePlot); |
| 2754 | interp.getRightParen(); |
| 2755 | return Double.NaN; |
| 2756 | } |
| 2757 | |
| 2758 | double addPlotLegend(Plot plot) { |
| 2759 | String labels = getFirstString(); |
no test coverage detected