(String[] args)
| 149 | |
| 150 | |
| 151 | static private void createAndShowGUI(String[] args) { |
| 152 | try { |
| 153 | File versionFile = Platform.getContentFile("lib/version.txt"); |
| 154 | if (versionFile.exists()) { |
| 155 | String version = PApplet.loadStrings(versionFile)[0]; |
| 156 | if (!version.equals(VERSION_NAME)) { |
| 157 | VERSION_NAME = version; |
| 158 | } |
| 159 | } |
| 160 | } catch (Exception e) { |
| 161 | e.printStackTrace(); |
| 162 | } |
| 163 | |
| 164 | Platform.init(); |
| 165 | // call after Platform.init() because we need the settings folder |
| 166 | Console.startup(); |
| 167 | |
| 168 | // Set the debug flag based on a file being present in the settings folder |
| 169 | File debugFile = getSettingsFile("debug.txt"); |
| 170 | /* |
| 171 | if (debugFile.isDirectory()) { |
| 172 | // if it's a directory, it's a leftover from older releases, clear it |
| 173 | Util.removeDir(debugFile); |
| 174 | } else*/ |
| 175 | if (debugFile.exists()) { |
| 176 | DEBUG = true; |
| 177 | } |
| 178 | |
| 179 | // Use native popups so they don't look so crappy on OS X |
| 180 | JPopupMenu.setDefaultLightWeightPopupEnabled(false); |
| 181 | |
| 182 | // Don't put anything above this line that might make GUI, |
| 183 | // because the platform has to be inited properly first. |
| 184 | |
| 185 | // Make sure a full JDK is installed |
| 186 | //initRequirements(); |
| 187 | |
| 188 | // Load the languages |
| 189 | Language.init(); |
| 190 | |
| 191 | // run static initialization that grabs all the prefs |
| 192 | Preferences.init(); |
| 193 | |
| 194 | if (!SingleInstance.alreadyRunning(args)) { |
| 195 | // Set the look and feel before opening the window |
| 196 | try { |
| 197 | Platform.setLookAndFeel(); |
| 198 | } catch (Exception e) { |
| 199 | Messages.loge("Could not set the Look & Feel", e); //$NON-NLS-1$ |
| 200 | } |
| 201 | |
| 202 | boolean sketchbookPrompt = false; |
| 203 | if (Preferences.getBoolean("welcome.show")) { |
| 204 | // only ask once about split sketchbooks |
| 205 | if (!Preferences.getBoolean("welcome.seen")) { |
| 206 | // Check if there's a 2.0 sketchbook present |
| 207 | String oldPath = Preferences.getOldSketchbookPath(); |
| 208 | if (oldPath != null) { |
no test coverage detected