MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / saveAsText

Method saveAsText

ij/src/main/java/ij/gui/PlotWindow.java:840–860  ·  view source on GitHub ↗

Saves the data of the plot in a text file

()

Source from the content-addressed store, hash-verified

838
839 /** Saves the data of the plot in a text file */
840 void saveAsText() {
841 if (plot.getXValues() == null) {
842 IJ.error("Plot has no data");
843 return;
844 }
845 SaveDialog sd = new SaveDialog("Save as Text", "Values", Prefs.defaultResultsExtension());
846 String name = sd.getFileName();
847 if (name==null) return;
848 String directory = sd.getDirectory();
849 IJ.wait(250); // give system time to redraw ImageJ window
850 IJ.showStatus("Saving plot values...");
851 ResultsTable rt = plot.getResultsTable(/*writeFirstXColumn=*/saveXValues, /*useLabels=*/true);
852 try {
853 rt.saveAs(directory+name);
854 } catch (IOException e) {
855 IJ.error("" + e);
856 return;
857 }
858 if (autoClose)
859 {imp.changes=false; close();}
860 }
861
862 /** Copy the first dataset or all values to the clipboard */
863 @AstroImageJ(reason = "Enhanced Plot Copy", modified = true)

Callers 1

actionPerformedMethod · 0.95

Calls 10

errorMethod · 0.95
getFileNameMethod · 0.95
getDirectoryMethod · 0.95
waitMethod · 0.95
showStatusMethod · 0.95
saveAsMethod · 0.95
closeMethod · 0.65
getXValuesMethod · 0.45
getResultsTableMethod · 0.45

Tested by

no test coverage detected