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

Method Base

app/src/processing/app/Base.java:353–434  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

351
352
353 public Base(String[] args) throws Exception {
354 ContributionManager.init(this);
355
356 buildCoreModes();
357 rebuildContribModes();
358 rebuildContribExamples();
359
360 // Needs to happen after the sketchbook folder has been located.
361 // Also relies on the modes to be loaded so it knows what can be
362 // marked as an example.
363// recent = new Recent(this);
364 Recent.init(this);
365
366 String lastModeIdentifier = Preferences.get("mode.last"); //$NON-NLS-1$
367 if (lastModeIdentifier == null) {
368 nextMode = getDefaultMode();
369 Messages.log("Nothing set for last.sketch.mode, using default."); //$NON-NLS-1$
370 } else {
371 for (Mode m : getModeList()) {
372 if (m.getIdentifier().equals(lastModeIdentifier)) {
373 Messages.logf("Setting next mode to %s.", lastModeIdentifier); //$NON-NLS-1$
374 nextMode = m;
375 }
376 }
377 if (nextMode == null) {
378 nextMode = getDefaultMode();
379 Messages.logf("Could not find mode %s, using default.", lastModeIdentifier); //$NON-NLS-1$
380 }
381 }
382
383 //contributionManagerFrame = new ContributionManagerDialog();
384
385 // Make sure ThinkDifferent has library examples too
386 nextMode.rebuildLibraryList();
387
388 // Put this after loading the examples, so that building the default file
389 // menu works on Mac OS X (since it needs examplesFolder to be set).
390 Platform.initBase(this);
391
392// toolsFolder = getContentFile("tools");
393
394// // Check if there were previously opened sketches to be restored
395// boolean opened = restoreSketches();
396 boolean opened = false;
397
398 // Check if any files were passed in on the command line
399 for (int i = 0; i < args.length; i++) {
400 Messages.logf("Parsing command line... args[%d] = '%s'", i, args[i]);
401
402 String path = args[i];
403 // Fix a problem with systems that use a non-ASCII languages. Paths are
404 // being passed in with 8.3 syntax, which makes the sketch loader code
405 // unhappy, since the sketch folder naming doesn't match up correctly.
406 // http://dev.processing.org/bugs/show_bug.cgi?id=1089
407 if (Platform.isWindows()) {
408 try {
409 File file = new File(args[i]);
410 path = file.getCanonicalPath();

Callers

nothing calls this directly

Calls 15

initMethod · 0.95
buildCoreModesMethod · 0.95
rebuildContribModesMethod · 0.95
initMethod · 0.95
getMethod · 0.95
getDefaultModeMethod · 0.95
logMethod · 0.95
getModeListMethod · 0.95
logfMethod · 0.95
initBaseMethod · 0.95
isWindowsMethod · 0.95

Tested by

no test coverage detected