MCPcopy Create free account
hub / github.com/benfry/processing4 / Runner

Method Runner

java/src/processing/mode/java/runner/Runner.java:86–118  ·  view source on GitHub ↗
(JavaBuild build, RunnerListener listener)

Source from the content-addressed store, hash-verified

84
85
86 public Runner(JavaBuild build, RunnerListener listener) throws SketchException {
87 this.listener = listener;
88 this.build = build;
89
90 checkLocalHost();
91
92 if (listener instanceof RunnerListenerEdtAdapter) {
93 // RunnerListener gets wrapped so that it behaves on the EDT.
94 // Need to extract the wrapped Object and see if it's a Java Editor,
95 // in which case we'll be passing additional parameters to the PApplet.
96 // https://github.com/processing/processing/issues/5843
97 RunnerListener wrapped = ((RunnerListenerEdtAdapter) listener).getWrapped();
98 if (wrapped instanceof JavaEditor) {
99 editor = (JavaEditor) wrapped;
100 sketchErr = editor.getConsole().getErr();
101 sketchOut = editor.getConsole().getOut();
102 }
103 }
104 // If it's not a JavaEditor, then we don't redirect to a console.
105 if (editor == null) {
106 sketchErr = System.err;
107 sketchOut = System.out;
108 }
109
110 // Make sure all the imported libraries will actually run with this setup.
111// int bits = Platform.getNativeBits();
112 String variant = Platform.getVariant();
113 for (Library library : build.getImportedLibraries()) {
114 if (library.isUnsupported(variant)) {
115 sketchErr.println(library.getName() + " does not run on this architecture: " + variant);
116 }
117 }
118 }
119
120
121 /**

Callers

nothing calls this directly

Calls 10

checkLocalHostMethod · 0.95
getVariantMethod · 0.95
getWrappedMethod · 0.80
getErrMethod · 0.80
getConsoleMethod · 0.80
getOutMethod · 0.80
getImportedLibrariesMethod · 0.80
isUnsupportedMethod · 0.80
printlnMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected