MCPcopy
hub / github.com/arduino/Arduino / Base

Method Base

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

Source from the content-addressed store, hash-verified

199 }
200
201 public Base(String[] args) throws Exception {
202 Thread deleteFilesOnShutdownThread = new Thread(DeleteFilesOnShutdown.INSTANCE);
203 deleteFilesOnShutdownThread.setName("DeleteFilesOnShutdown");
204 Runtime.getRuntime().addShutdownHook(deleteFilesOnShutdownThread);
205
206 BaseNoGui.initLogger();
207
208 initLogger();
209
210 BaseNoGui.initPlatform();
211
212 BaseNoGui.getPlatform().init();
213
214 BaseNoGui.initPortableFolder();
215
216 // Look for a possible "--preferences-file" parameter and load preferences
217 BaseNoGui.initParameters(args);
218
219 CommandlineParser parser = new CommandlineParser(args);
220 parser.parseArgumentsPhase1();
221 commandLine = !parser.isGuiMode();
222
223 BaseNoGui.checkInstallationFolder();
224
225 // If no path is set, get the default sketchbook folder for this platform
226 if (BaseNoGui.getSketchbookPath() == null) {
227 File defaultFolder = getDefaultSketchbookFolderOrPromptForIt();
228 if (BaseNoGui.getPortableFolder() != null)
229 PreferencesData.set("sketchbook.path", BaseNoGui.getPortableSketchbookFolder());
230 else
231 PreferencesData.set("sketchbook.path", defaultFolder.getAbsolutePath());
232 if (!defaultFolder.exists()) {
233 defaultFolder.mkdirs();
234 }
235 }
236
237 SplashScreenHelper splash;
238 if (parser.isGuiMode()) {
239 // Setup all notification widgets
240 splash = new SplashScreenHelper(SplashScreen.getSplashScreen());
241 BaseNoGui.notifier = new GUIUserNotifier(this);
242
243 // Setup the theme coloring fun
244 Theme.init();
245 System.setProperty("swing.aatext", PreferencesData.get("editor.antialias", "true"));
246
247 // Set the look and feel before opening the window
248 try {
249 BaseNoGui.getPlatform().setLookAndFeel();
250 } catch (Exception e) {
251 // ignore
252 }
253
254 // Use native popups so they don't look so crappy on osx
255 JPopupMenu.setDefaultLightWeightPopupEnabled(false);
256 } else {
257 splash = new SplashScreenHelper(null);
258 }

Callers

nothing calls this directly

Calls 15

initLoggerMethod · 0.95
initLoggerMethod · 0.95
initPlatformMethod · 0.95
getPlatformMethod · 0.95
initPortableFolderMethod · 0.95
initParametersMethod · 0.95
parseArgumentsPhase1Method · 0.95
isGuiModeMethod · 0.95
getSketchbookPathMethod · 0.95
getPortableFolderMethod · 0.95

Tested by

no test coverage detected