MCPcopy Index your code
hub / github.com/processing/processing / prepareRun

Method prepareRun

app/src/processing/app/ui/Editor.java:2808–2840  ·  view source on GitHub ↗

Grab current contents of the sketch window, advance the console, stop any other running sketches... not in that order. It's essential that this function be called by any Mode subclass, otherwise current edits may not be stored for getProgram().

()

Source from the content-addressed store, hash-verified

2806 * otherwise current edits may not be stored for getProgram().
2807 */
2808 public void prepareRun() {
2809 internalCloseRunner();
2810 statusEmpty();
2811
2812 // do this to advance/clear the terminal window / dos prompt / etc
2813 for (int i = 0; i < 10; i++) System.out.println();
2814
2815 // clear the console on each run, unless the user doesn't want to
2816 if (Preferences.getBoolean("console.auto_clear")) {
2817 console.clear();
2818 }
2819
2820 // make sure the user didn't hide the sketch folder
2821 sketch.ensureExistence();
2822
2823 // make sure any edits have been stored
2824 //current.setProgram(editor.getText());
2825 // Go through all tabs; Replace All, Rename or Undo could have changed them
2826 for (SketchCode sc : sketch.getCode()) {
2827 if (sc.getDocument() != null) {
2828 try {
2829 sc.setProgram(sc.getDocumentText());
2830 } catch (BadLocationException e) {
2831 }
2832 }
2833 }
2834
2835// // if an external editor is being used, need to grab the
2836// // latest version of the code from the file.
2837// if (Preferences.getBoolean("editor.external")) {
2838// sketch.reload();
2839// }
2840 }
2841
2842
2843 /**

Callers

nothing calls this directly

Calls 10

internalCloseRunnerMethod · 0.95
statusEmptyMethod · 0.95
getBooleanMethod · 0.95
ensureExistenceMethod · 0.80
getCodeMethod · 0.80
setProgramMethod · 0.80
getDocumentTextMethod · 0.80
printlnMethod · 0.45
clearMethod · 0.45
getDocumentMethod · 0.45

Tested by

no test coverage detected