()
| 43 | static Settings theme; |
| 44 | |
| 45 | static public void init() { |
| 46 | try { |
| 47 | File inputFile = getDefaultFile(); |
| 48 | if (!inputFile.exists()) { |
| 49 | System.err.println("Missing required file (theme.txt), please reinstall Processing."); |
| 50 | } |
| 51 | // First load the default theme data, in case new parameters were added |
| 52 | // that may not be covered with a custom version found in the sketchbook. |
| 53 | theme = new Settings(inputFile); |
| 54 | |
| 55 | // other things that have to be set explicitly for the defaults |
| 56 | theme.setColor("run.window.bgcolor", SystemColor.control); |
| 57 | |
| 58 | if (Preferences.get("theme") == null) { |
| 59 | // This is not being set in defaults.txt so that we have a way |
| 60 | // to reset the theme after the major changes in 4.0 beta 9. |
| 61 | // This does a one-time archival of the theme.txt file in the |
| 62 | // sketchbook folder, because most people have not customized |
| 63 | // their theme, but they probably made a selection. |
| 64 | // If they customized the theme, they can bring it back by |
| 65 | // renaming the file from theme.001 to theme.txt. |
| 66 | // If they were using a built-in theme, they will need to |
| 67 | // re-select it using the Theme Selector. |
| 68 | Preferences.set("theme", DEFAULT_PATH); |
| 69 | |
| 70 | if (getSketchbookFile().exists()) { |
| 71 | archiveCurrent(); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // load sketchbook theme or the one specified in preferences |
| 76 | reload(); |
| 77 | |
| 78 | } catch (IOException e) { |
| 79 | Messages.showError("Problem loading theme.txt", |
| 80 | "Could not load theme.txt, please re-install Processing", e); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | |
| 85 | /** |
no test coverage detected