@param Base the current Processing Base @param oldSketchbook true if the user has a Processing 2 sketchbook @throws IOException if resources cannot be found
(Base base, boolean oldSketchbook)
| 69 | * @throws IOException if resources cannot be found |
| 70 | */ |
| 71 | public Welcome2(Base base, boolean oldSketchbook) throws IOException { |
| 72 | this.base = base; |
| 73 | |
| 74 | // strings used in the GUI |
| 75 | // should be moved to external files to make tranlsation easier |
| 76 | final String welcomeText = "Welcome to Processing 3"; |
| 77 | final String whatsNewText = "Read about what's new in 3.0 \u2192"; |
| 78 | final String compatibleText = "Note that some sketches from Processing 2 " + |
| 79 | "may not be compatible."; |
| 80 | final String whatHasChangedText = "What has changed?"; |
| 81 | final String newSketchbookText = "Since older sketches may " + |
| 82 | "not be compatible, we recommend creating a new sketchbook folder, " + |
| 83 | "so Processing 2 and 3 can happily coexist. This is a one-time " + |
| 84 | "process."; |
| 85 | final String readMoreText = "Read more about it"; |
| 86 | final String createNewSketchbookText = "Create a new sketchbook " + |
| 87 | "folder for use with Processing 3 sketches (recommended!)"; |
| 88 | final String useOldSketchbookText = "Use the existing sketchbook " + |
| 89 | "for both old and new sketches (may cause conflicts with installed " + |
| 90 | "libraries)"; |
| 91 | final String showEachTimeText = "Show this welcome message each time"; |
| 92 | |
| 93 | // color used for boxes with special information |
| 94 | final Color insetColor = new Color(224, 253, 251); |
| 95 | // color used in hyperlinks |
| 96 | final Color linkColor = new Color(44, 123, 181); |
| 97 | |
| 98 | final String whatsNewUrl = "https://github.com/processing/processing/wiki/Changes-in-3.0"; |
| 99 | |
| 100 | // Font processingSemibold; |
| 101 | // Font processingSansPro; |
| 102 | |
| 103 | // load fonts |
| 104 | // try { |
| 105 | // processingSemibold = Font.createFont(Font.TRUETYPE_FONT, |
| 106 | // Base.getLibFile("/fonts/ProcessingSansPro-Semibold.ttf")); |
| 107 | // processingSansPro = Font.createFont(Font.TRUETYPE_FONT, |
| 108 | // Base.getLibFile("/fonts/ProcessingSansPro-Regular.ttf")); |
| 109 | // } catch (FontFormatException e) { |
| 110 | // processingSemibold = UIManager.getDefaults().getFont("Label.font"); |
| 111 | // processingSansPro = UIManager.getDefaults().getFont("Label.font"); |
| 112 | // } |
| 113 | // |
| 114 | // headerFont = processingSemibold.deriveFont(20f); |
| 115 | // bodyFont = processingSansPro.deriveFont(12f); |
| 116 | |
| 117 | Font headerFont = Toolkit.getSansFont(20, Font.BOLD); |
| 118 | Font bodyFont = Toolkit.getSansFont(12, Font.PLAIN); |
| 119 | |
| 120 | //Set welcome window title |
| 121 | setTitle(welcomeText); |
| 122 | |
| 123 | // release frame resources on close |
| 124 | setDefaultCloseOperation(DISPOSE_ON_CLOSE); |
| 125 | |
| 126 | //Main content panel |
| 127 | JPanel panel = new JPanel(new GridBagLayout()); |
| 128 | Toolkit.setBorder(panel, 20, 20, 20, 20); |
nothing calls this directly
no test coverage detected