MCPcopy Index your code
hub / github.com/benfry/processing4 / initBase

Method initBase

app/src/processing/app/platform/MacPlatform.java:60–104  ·  view source on GitHub ↗
(Base base)

Source from the content-addressed store, hash-verified

58
59
60 public void initBase(Base base) {
61 super.initBase(base);
62
63 final Desktop desktop = Desktop.getDesktop();
64
65 System.setProperty("apple.laf.useScreenMenuBar", "true");
66
67 // Set the menu bar to be used when nothing else is open.
68 JMenuBar defaultMenuBar = new JMenuBar();
69 JMenu fileMenu = base.initDefaultFileMenu();
70 defaultMenuBar.add(fileMenu);
71 desktop.setDefaultMenuBar(defaultMenuBar);
72
73 desktop.setAboutHandler((event) -> new About(null));
74
75 desktop.setPreferencesHandler((event) -> base.handlePrefs());
76
77 desktop.setOpenFileHandler((event) -> {
78 for (File file : event.getFiles()) {
79 base.handleOpen(file.getAbsolutePath());
80 }
81 });
82
83 desktop.setPrintFileHandler((event) -> {
84 // TODO not yet implemented
85 });
86
87 desktop.setQuitHandler((event, quitResponse) -> {
88 if (base.handleQuit()) {
89 quitResponse.performQuit();
90 } else {
91 quitResponse.cancelQuit();
92 }
93 });
94
95 desktop.setOpenURIHandler((event) -> {
96 // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/URI.html
97// URI uri = event.getURI();
98 base.handleScheme(event.getURI().toString());
99// String location = uri.toString().substring(6);
100// if (location.length() > 0) {
101// base.handleLocation(location);
102// }
103 });
104 }
105
106
107 public File getSettingsFolder() throws Exception {

Callers

nothing calls this directly

Calls 9

getDesktopMethod · 0.80
initDefaultFileMenuMethod · 0.80
handlePrefsMethod · 0.80
handleOpenMethod · 0.80
handleQuitMethod · 0.80
handleSchemeMethod · 0.80
setPropertyMethod · 0.65
addMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected