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

Method setupGUI

app/src/processing/app/Mode.java:199–229  ·  view source on GitHub ↗

Setup additional elements that are only required when running with a GUI, rather than from the command-line. Note that this will not be called when the Mode is used from the command line (because Base will be null).

()

Source from the content-addressed store, hash-verified

197 * the Mode is used from the command line (because Base will be null).
198 */
199 public void setupGUI() {
200 try {
201 // First load the default theme data for the whole PDE.
202 theme = new Settings(Platform.getContentFile("lib/theme.txt"));
203
204 // The mode-specific theme.txt file should only contain additions,
205 // and in extremely rare cases, it might override entries from the
206 // main theme. Do not override for style changes unless they are
207 // objectively necessary for your Mode.
208 File modeTheme = new File(folder, "theme/theme.txt");
209 if (modeTheme.exists()) {
210 // Override the built-in settings with what the theme provides
211 theme.load(modeTheme);
212 }
213
214 // Against my better judgment, adding the ability to override themes
215 // https://github.com/processing/processing/issues/5445
216 File sketchbookTheme =
217 new File(Base.getSketchbookFolder(), "theme.txt");
218 if (sketchbookTheme.exists()) {
219 theme.load(sketchbookTheme);
220 }
221
222 // other things that have to be set explicitly for the defaults
223 theme.setColor("run.window.bgcolor", SystemColor.control);
224
225 } catch (IOException e) {
226 Messages.showError("Problem loading theme.txt",
227 "Could not load theme.txt, please re-install Processing", e);
228 }
229 }
230
231
232 public File getContentFile(String path) {

Callers 1

ModeContributionMethod · 0.80

Calls 5

getContentFileMethod · 0.95
getSketchbookFolderMethod · 0.95
showErrorMethod · 0.95
loadMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected