| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,11 +22,11 @@ public About(Frame frame) { | |||
| 22 | 22 | super(frame); | |
| 23 | 23 | ||
| 24 | 24 | if (Toolkit.highResDisplay()) { | |
| 25 | - image = Toolkit.getLibImage("about-2x.jpg"); | ||
| 25 | + image = Toolkit.getLibImage("about-2x.jpg"); //$NON-NLS-1$ | ||
| 26 | 26 | width = image.getWidth(null) / 2; | |
| 27 | 27 | height = image.getHeight(null) / 2; | |
| 28 | 28 | } else { | |
| 29 | - image = Toolkit.getLibImage("about.jpg"); | ||
| 29 | + image = Toolkit.getLibImage("about.jpg"); //$NON-NLS-1$ | ||
| 30 | 30 | width = image.getWidth(null); | |
| 31 | 31 | height = image.getHeight(null); | |
| 32 | 32 | } | |
@@ -50,7 +50,7 @@ public void paint(Graphics g) { | |||
| 50 | 50 | g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, | |
| 51 | 51 | RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); | |
| 52 | 52 | ||
| 53 | - g.setFont(new Font("SansSerif", Font.PLAIN, 11)); | ||
| 53 | + g.setFont(new Font("SansSerif", Font.PLAIN, 11)); //$NON-NLS-1$ | ||
| 54 | 54 | g.setColor(Color.white); | |
| 55 | 55 | g.drawString(Base.VERSION_NAME, 50, 30); | |
| 56 | 56 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,7 @@ | |||
| 46 | 46 | public class Base { | |
| 47 | 47 | static public final int REVISION = 217; | |
| 48 | 48 | /** This might be replaced by main() if there's a lib/version.txt file. */ | |
| 49 | - static public String VERSION_NAME = "0217"; | ||
| 49 | + static public String VERSION_NAME = "0217"; //$NON-NLS-1$ | ||
| 50 | 50 | /** Set true if this a proper release rather than a numbered revision. */ | |
| 51 | 51 | static public boolean RELEASE = false; | |
| 52 | 52 | ||
@@ -57,31 +57,31 @@ public class Base { | |||
| 57 | 57 | static HashMap<Integer, String> platformNames = | |
| 58 | 58 | new HashMap<Integer, String>(); | |
| 59 | 59 | static { | |
| 60 | - platformNames.put(PConstants.WINDOWS, "windows"); | ||
| 61 | - platformNames.put(PConstants.MACOSX, "macosx"); | ||
| 62 | - platformNames.put(PConstants.LINUX, "linux"); | ||
| 60 | + platformNames.put(PConstants.WINDOWS, "windows"); //$NON-NLS-1$ | ||
| 61 | + platformNames.put(PConstants.MACOSX, "macosx"); //$NON-NLS-1$ | ||
| 62 | + platformNames.put(PConstants.LINUX, "linux"); //$NON-NLS-1$ | ||
| 63 | 63 | } | |
| 64 | 64 | ||
| 65 | 65 | static HashMap<String, Integer> platformIndices = new HashMap<String, Integer>(); | |
| 66 | 66 | static { | |
| 67 | - platformIndices.put("windows", PConstants.WINDOWS); | ||
| 68 | - platformIndices.put("macosx", PConstants.MACOSX); | ||
| 69 | - platformIndices.put("linux", PConstants.LINUX); | ||
| 67 | + platformIndices.put("windows", PConstants.WINDOWS); //$NON-NLS-1$ | ||
| 68 | + platformIndices.put("macosx", PConstants.MACOSX); //$NON-NLS-1$ | ||
| 69 | + platformIndices.put("linux", PConstants.LINUX); //$NON-NLS-1$ | ||
| 70 | 70 | } | |
| 71 | 71 | static Platform platform; | |
| 72 | 72 | ||
| 73 | 73 | /** How many bits this machine is */ | |
| 74 | 74 | static int nativeBits; | |
| 75 | 75 | static { | |
| 76 | 76 | nativeBits = 32; // perhaps start with 32 | |
| 77 | - String bits = System.getProperty("sun.arch.data.model"); | ||
| 77 | + String bits = System.getProperty("sun.arch.data.model"); //$NON-NLS-1$ | ||
| 78 | 78 | if (bits != null) { | |
| 79 | - if (bits.equals("64")) { | ||
| 79 | + if (bits.equals("64")) { //$NON-NLS-1$ | ||
| 80 | 80 | nativeBits = 64; | |
| 81 | 81 | } | |
| 82 | 82 | } else { | |
| 83 | 83 | // if some other strange vm, maybe try this instead | |
| 84 | - if (System.getProperty("java.vm.name").contains("64")) { | ||
| 84 | + if (System.getProperty("java.vm.name").contains("64")) { //$NON-NLS-1$ //$NON-NLS-2$ | ||
| 85 | 85 | nativeBits = 64; | |
| 86 | 86 | } | |
| 87 | 87 | } | |
@@ -142,7 +142,7 @@ public void run() { | |||
| 142 | 142 | ||
| 143 | 143 | static private void createAndShowGUI(String[] args) { | |
| 144 | 144 | try { | |
| 145 | - File versionFile = getContentFile("lib/version.txt"); | ||
| 145 | + File versionFile = getContentFile("lib/version.txt"); //$NON-NLS-1$ | ||
| 146 | 146 | if (versionFile.exists()) { | |
| 147 | 147 | String version = PApplet.loadStrings(versionFile)[0]; | |
| 148 | 148 | if (!version.equals(VERSION_NAME)) { | |
@@ -179,10 +179,10 @@ static private void createAndShowGUI(String[] args) { | |||
| 179 | 179 | try { | |
| 180 | 180 | platform.setLookAndFeel(); | |
| 181 | 181 | } catch (Exception e) { | |
| 182 | - String mess = e.getMessage(); | ||
| 183 | - if (!mess.contains("ch.randelshofer.quaqua.QuaquaLookAndFeel")) { | ||
| 184 | - log("Could not set the Look & Feel", e); | ||
| 185 | - } | ||
| 182 | + // String mess = e.getMessage(); | ||
| 183 | + // if (!mess.contains("ch.randelshofer.quaqua.QuaquaLookAndFeel")) { | ||
| 184 | + log("Could not set the Look & Feel", e); //$NON-NLS-1$ | ||
| 185 | + // } | ||
| 186 | 186 | } | |
| 187 | 187 | ||
| 188 | 188 | // Create a location for untitled sketches | |
@@ -195,11 +195,11 @@ static private void createAndShowGUI(String[] args) { | |||
| 195 | 195 | "That's gonna prevent us from continuing.", e); | |
| 196 | 196 | } | |
| 197 | 197 | ||
| 198 | - log("about to create base..."); | ||
| 198 | + log("about to create base..."); //$NON-NLS-1$ | ||
| 199 | 199 | Base base = new Base(args); | |
| 200 | 200 | // Prevent more than one copy of the PDE from running. | |
| 201 | 201 | SingleInstance.startServer(base); | |
| 202 | - log("done creating base..."); | ||
| 202 | + log("done creating base..."); //$NON-NLS-1$ | ||
| 203 | 203 | } | |
| 204 | 204 | } | |
| 205 | 205 | ||
@@ -216,13 +216,13 @@ static protected boolean isCommandLine() { | |||
| 216 | 216 | ||
| 217 | 217 | static public void initPlatform() { | |
| 218 | 218 | try { | |
| 219 | - Class<?> platformClass = Class.forName("processing.app.Platform"); | ||
| 219 | + Class<?> platformClass = Class.forName("processing.app.Platform"); //$NON-NLS-1$ | ||
| 220 | 220 | if (Base.isMacOS()) { | |
| 221 | - platformClass = Class.forName("processing.app.macosx.Platform"); | ||
| 221 | + platformClass = Class.forName("processing.app.macosx.Platform"); //$NON-NLS-1$ | ||
| 222 | 222 | } else if (Base.isWindows()) { | |
| 223 | - platformClass = Class.forName("processing.app.windows.Platform"); | ||
| 223 | + platformClass = Class.forName("processing.app.windows.Platform"); //$NON-NLS-1$ | ||
| 224 | 224 | } else if (Base.isLinux()) { | |
| 225 | - platformClass = Class.forName("processing.app.linux.Platform"); | ||
| 225 | + platformClass = Class.forName("processing.app.linux.Platform"); //$NON-NLS-1$ | ||
| 226 | 226 | } | |
| 227 | 227 | platform = (Platform) platformClass.newInstance(); | |
| 228 | 228 | } catch (Exception e) { | |
@@ -235,7 +235,7 @@ static public void initPlatform() { | |||
| 235 | 235 | ||
| 236 | 236 | public static void initRequirements() { | |
| 237 | 237 | try { | |
| 238 | - Class.forName("com.sun.jdi.VirtualMachine"); | ||
| 238 | + Class.forName("com.sun.jdi.VirtualMachine"); //$NON-NLS-1$ | ||
| 239 | 239 | } catch (ClassNotFoundException cnfe) { | |
| 240 | 240 | //String cp = System.getProperty("java.class.path").replace(File.pathSeparatorChar, '\n'); | |
| 241 | 241 | // String cp = System.getProperty("sun.boot.class.path").replace(File.pathSeparatorChar, '\n'); | |
@@ -268,8 +268,8 @@ private void buildCoreModes() { | |||
| 268 | 268 | // ModeContribution.getCoreMode(this, "processing.mode.javascript.JavaScriptMode", | |
| 269 | 269 | // getContentFile("modes/javascript")); | |
| 270 | 270 | Mode javaMode = | |
| 271 | - ModeContribution.load(this, getContentFile("modes/java"), | ||
| 272 | - "processing.mode.java.JavaMode").getMode(); | ||
| 271 | + ModeContribution.load(this, getContentFile("modes/java"), //$NON-NLS-1$ | ||
| 272 | + "processing.mode.java.JavaMode").getMode(); //$NON-NLS-1$ | ||
| 273 | 273 | // Mode androidMode = | |
| 274 | 274 | // ModeContribution.load(this, getContentFile("modes/android"), | |
| 275 | 275 | // "processing.mode.android.AndroidMode").getMode(); | |
@@ -284,8 +284,8 @@ private void buildCoreModes() { | |||
| 284 | 284 | // try { | |
| 285 | 285 | // Class.forName("processing.mode.java2.DebugMode"); | |
| 286 | 286 | ModeContribution experimentalContrib = | |
| 287 | - ModeContribution.load(this, getContentFile("modes/experimental"), | ||
| 288 | - "processing.mode.experimental.ExperimentalMode"); | ||
| 287 | + ModeContribution.load(this, getContentFile("modes/experimental"), //$NON-NLS-1$ | ||
| 288 | + "processing.mode.experimental.ExperimentalMode"); //$NON-NLS-1$ | ||
| 289 | 289 | if (experimentalContrib != null) { | |
| 290 | 290 | Mode experimentalMode = experimentalContrib.getMode(); | |
| 291 | 291 | //coreModes = new Mode[] { javaMode, androidMode, experimentalMode }; | |
@@ -345,20 +345,20 @@ public Base(String[] args) { | |||
| 345 | 345 | // marked as an example. | |
| 346 | 346 | recent = new Recent(this); | |
| 347 | 347 | ||
| 348 | - String lastModeIdentifier = Preferences.get("last.sketch.mode"); | ||
| 348 | + String lastModeIdentifier = Preferences.get("last.sketch.mode"); //$NON-NLS-1$ | ||
| 349 | 349 | if (lastModeIdentifier == null) { | |
| 350 | 350 | nextMode = coreModes[0]; | |
| 351 | - log("Nothing set for last.sketch.mode, using coreMode[0]."); | ||
| 351 | + log("Nothing set for last.sketch.mode, using coreMode[0]."); //$NON-NLS-1$ | ||
| 352 | 352 | } else { | |
| 353 | 353 | for (Mode m : getModeList()) { | |
| 354 | 354 | if (m.getIdentifier().equals(lastModeIdentifier)) { | |
| 355 | - log("Setting next mode to " + lastModeIdentifier); | ||
| 355 | + log("Setting next mode to " + lastModeIdentifier); //$NON-NLS-1$ | ||
| 356 | 356 | nextMode = m; | |
| 357 | 357 | } | |
| 358 | 358 | } | |
| 359 | 359 | if (nextMode == null) { | |
| 360 | 360 | nextMode = coreModes[0]; | |
| 361 | - log("Could not find mode " + lastModeIdentifier + ", using default."); | ||
| 361 | + logf("Could not find mode {0}, using default.", lastModeIdentifier); //$NON-NLS-1$ | ||
| 362 | 362 | } | |
| 363 | 363 | } | |
| 364 | 364 | ||
@@ -413,7 +413,7 @@ public Base(String[] args) { | |||
| 413 | 413 | } | |
| 414 | 414 | ||
| 415 | 415 | // check for updates | |
| 416 | - if (Preferences.getBoolean("update.check")) { | ||
| 416 | + if (Preferences.getBoolean("update.check")) { //$NON-NLS-1$ | ||
| 417 | 417 | new UpdateCheck(this); | |
| 418 | 418 | } | |
| 419 | 419 | } | |
@@ -601,13 +601,13 @@ protected void changeMode(Mode mode) { | |||
| 601 | 601 | boolean wasUntitled = sketch.isUntitled(); | |
| 602 | 602 | ||
| 603 | 603 | // save a mode file into this sketch folder | |
| 604 | - File sketchProps = new File(sketch.getFolder(), "sketch.properties"); | ||
| 604 | + File sketchProps = new File(sketch.getFolder(), "sketch.properties"); //$NON-NLS-1$ | ||
| 605 | 605 | try { | |
| 606 | 606 | Settings props = new Settings(sketchProps); | |
| 607 | 607 | // Include the pretty name for error messages to show the user | |
| 608 | - props.set("mode", mode.getTitle()); | ||
| 608 | + props.set("mode", mode.getTitle()); //$NON-NLS-1$ | ||
| 609 | 609 | // Actual identifier to be used to resurrect the mode | |
| 610 | - props.set("mode.id", mode.getIdentifier()); | ||
| 610 | + props.set("mode.id", mode.getIdentifier()); //$NON-NLS-1$ | ||
| 611 | 611 | props.save(); | |
| 612 | 612 | } catch (IOException e) { | |
| 613 | 613 | e.printStackTrace(); | |
@@ -661,7 +661,7 @@ protected void handleActivated(Editor whichEditor) { | |||
| 661 | 661 | ||
| 662 | 662 | // make this the next mode to be loaded | |
| 663 | 663 | nextMode = whichEditor.getMode(); | |
| 664 | - Preferences.set("last.sketch.mode", nextMode.getIdentifier()); | ||
| 664 | + Preferences.set("last.sketch.mode", nextMode.getIdentifier()); //$NON-NLS-1$ | ||
| 665 | 665 | } | |
| 666 | 666 | ||
| 667 | 667 | ||
@@ -735,7 +735,7 @@ public void handleNew() { | |||
| 735 | 735 | ||
| 736 | 736 | // Make an empty pde file | |
| 737 | 737 | File newbieFile = | |
| 738 | - new File(newbieDir, newbieName + "." + nextMode.getDefaultExtension()); | ||
| 738 | + new File(newbieDir, newbieName + "." + nextMode.getDefaultExtension()); //$NON-NLS-1$ | ||
| 739 | 739 | if (!newbieFile.createNewFile()) { | |
| 740 | 740 | throw new IOException(newbieFile + " already exists."); | |
| 741 | 741 | } | |
@@ -812,7 +812,7 @@ public void handleOpenPrompt() { | |||
| 812 | 812 | } | |
| 813 | 813 | ||
| 814 | 814 | final String prompt = "Open a Processing sketch..."; | |
| 815 | - if (Preferences.getBoolean("chooser.files.native")) { // don't use native dialogs on Linux | ||
| 815 | + if (Preferences.getBoolean("chooser.files.native")) { // don't use native dialogs on Linux //$NON-NLS-1$ | ||
| 816 | 816 | // get the front-most window frame for placing file dialog | |
| 817 | 817 | FileDialog fd = new FileDialog(activeEditor, prompt, FileDialog.LOAD); | |
| 818 | 818 | ||
@@ -821,7 +821,7 @@ public void handleOpenPrompt() { | |||
| 821 | 821 | public boolean accept(File dir, String name) { | |
| 822 | 822 | // confirmed to be working properly [fry 110128] | |
| 823 | 823 | for (String ext : extensions) { | |
| 824 | - if (name.toLowerCase().endsWith("." + ext)) { | ||
| 824 | + if (name.toLowerCase().endsWith("." + ext)) { //$NON-NLS-1$ | ||
| 825 | 825 | return true; | |
| 826 | 826 | } | |
| 827 | 827 | } | |
@@ -851,7 +851,7 @@ public boolean accept(File file) { | |||
| 851 | 851 | return true; | |
| 852 | 852 | } | |
| 853 | 853 | for (String ext : extensions) { | |
| 854 | - if (file.getName().toLowerCase().endsWith("." + ext)) { | ||
| 854 | + if (file.getName().toLowerCase().endsWith("." + ext)) { //$NON-NLS-1$ | ||
| 855 | 855 | return true; | |
| 856 | 856 | } | |
| 857 | 857 | } | |
@@ -932,11 +932,11 @@ protected Editor handleOpen(String path, boolean untitled, EditorState state) { | |||
| 932 | 932 | // Mode nextMode = nextEditorMode(); | |
| 933 | 933 | try { | |
| 934 | 934 | File sketchFolder = new File(path).getParentFile(); | |
| 935 | - File sketchProps = new File(sketchFolder, "sketch.properties"); | ||
| 935 | + File sketchProps = new File(sketchFolder, "sketch.properties"); //$NON-NLS-1$ | ||
| 936 | 936 | if (sketchProps.exists()) { | |
| 937 | 937 | Settings props = new Settings(sketchProps); | |
| 938 | - String modeTitle = props.get("mode"); | ||
| 939 | - String modeIdentifier = props.get("mode.id"); | ||
| 938 | + String modeTitle = props.get("mode"); //$NON-NLS-1$ | ||
| 939 | + String modeIdentifier = props.get("mode.id"); //$NON-NLS-1$ | ||
| 940 | 940 | if (modeTitle != null && modeIdentifier != null) { | |
| 941 | 941 | // nextMode = findMode(modeTitle); | |
| 942 | 942 | Mode mode = findMode(modeIdentifier); | |
@@ -1060,8 +1060,8 @@ public boolean handleClose(Editor editor, boolean modeSwitch) { | |||
| 1060 | 1060 | } | |
| 1061 | 1061 | } | |
| 1062 | 1062 | ||
| 1063 | - Preferences.unset("server.port"); | ||
| 1064 | - Preferences.unset("server.key"); | ||
| 1063 | + Preferences.unset("server.port"); //$NON-NLS-1$ | ||
| 1064 | + Preferences.unset("server.key"); //$NON-NLS-1$ | ||
| 1065 | 1065 | ||
| 1066 | 1066 | // This will store the sketch count as zero | |
| 1067 | 1067 | editors.remove(editor); | |
@@ -1471,7 +1471,7 @@ protected boolean addSketches(DefaultMutableTreeNode node, File folder) throws I | |||
| 1471 | 1471 | */ | |
| 1472 | 1472 | File checkSketchFolder(File subfolder, String item) { | |
| 1473 | 1473 | for (Mode mode : getModeList()) { | |
| 1474 | - File entry = new File(subfolder, item + "." + mode.getDefaultExtension()); | ||
| 1474 | + File entry = new File(subfolder, item + "." + mode.getDefaultExtension()); //$NON-NLS-1$ | ||
| 1475 | 1475 | // if a .pde file of the same prefix as the folder exists.. | |
| 1476 | 1476 | if (entry.exists()) { | |
| 1477 | 1477 | return entry; | |
@@ -1593,7 +1593,7 @@ static public String getPlatformName() { | |||
| 1593 | 1593 | */ | |
| 1594 | 1594 | static public int getNativeBits() { | |
| 1595 | 1595 | if (Base.isMacOS()) { | |
| 1596 | - return Preferences.getInteger("run.options.bits"); | ||
| 1596 | + return Preferences.getInteger("run.options.bits"); //$NON-NLS-1$ | ||
| 1597 | 1597 | } | |
| 1598 | 1598 | return nativeBits; | |
| 1599 | 1599 | } | |
@@ -1644,7 +1644,7 @@ static public int getPlatformIndex(String what) { | |||
| 1644 | 1644 | */ | |
| 1645 | 1645 | static public boolean isMacOS() { | |
| 1646 | 1646 | //return PApplet.platform == PConstants.MACOSX; | |
| 1647 | - return System.getProperty("os.name").indexOf("Mac") != -1; | ||
| 1647 | + return System.getProperty("os.name").indexOf("Mac") != -1; //$NON-NLS-1$ //$NON-NLS-2$ | ||
| 1648 | 1648 | } | |
| 1649 | 1649 | ||
| 1650 | 1650 | ||
@@ -1653,7 +1653,7 @@ static public boolean isMacOS() { | |||
| 1653 | 1653 | */ | |
| 1654 | 1654 | static public boolean isWindows() { | |
| 1655 | 1655 | //return PApplet.platform == PConstants.WINDOWS; | |
| 1656 | - return System.getProperty("os.name").indexOf("Windows") != -1; | ||
| 1656 | + return System.getProperty("os.name").indexOf("Windows") != -1; //$NON-NLS-1$ //$NON-NLS-2$ | ||
| 1657 | 1657 | } | |
| 1658 | 1658 | ||
| 1659 | 1659 | ||
@@ -1662,7 +1662,7 @@ static public boolean isWindows() { | |||
| 1662 | 1662 | */ | |
| 1663 | 1663 | static public boolean isLinux() { | |
| 1664 | 1664 | //return PApplet.platform == PConstants.LINUX; | |
| 1665 | - return System.getProperty("os.name").indexOf("Linux") != -1; | ||
| 1665 | + return System.getProperty("os.name").indexOf("Linux") != -1; //$NON-NLS-1$ //$NON-NLS-2$ | ||
| 1666 | 1666 | } | |
| 1667 | 1667 | ||
| 1668 | 1668 | ||
@@ -1672,7 +1672,7 @@ static public boolean isLinux() { | |||
| 1672 | 1672 | static public File getSettingsFolder() { | |
| 1673 | 1673 | File settingsFolder = null; | |
| 1674 | 1674 | ||
| 1675 | - String preferencesPath = Preferences.get("settings.path"); | ||
| 1675 | + String preferencesPath = Preferences.get("settings.path"); //$NON-NLS-1$ | ||
| 1676 | 1676 | if (preferencesPath != null) { | |
| 1677 | 1677 | settingsFolder = new File(preferencesPath); | |
| 1678 | 1678 | ||
@@ -1784,7 +1784,7 @@ static public File getToolsFolder() { | |||
| 1784 | 1784 | static public void locateSketchbookFolder() { | |
| 1785 | 1785 | // If a value is at least set, first check to see if the folder exists. | |
| 1786 | 1786 | // If it doesn't, warn the user that the sketchbook folder is being reset. | |
| 1787 | - String sketchbookPath = Preferences.get("sketchbook.path"); | ||
| 1787 | + String sketchbookPath = Preferences.get("sketchbook.path"); //$NON-NLS-1$ | ||
| 1788 | 1788 | if (sketchbookPath != null) { | |
| 1789 | 1789 | sketchbookFolder = new File(sketchbookPath); | |
| 1790 | 1790 | if (!sketchbookFolder.exists()) { | |
@@ -2914,6 +2914,13 @@ static public void log(String message) { | |||
| 2914 | 2914 | System.out.println(message); | |
| 2915 | 2915 | } | |
| 2916 | 2916 | } | |
| 2917 | + | ||
| 2918 | + | ||
| 2919 | + static public void logf(String message, Object... args) { | ||
| 2920 | + if (DEBUG) { | ||
| 2921 | + System.out.println(String.format(message, args)); | ||
| 2922 | + } | ||
| 2923 | + } | ||
| 2917 | 2924 | ||
| 2918 | 2925 | ||
| 2919 | 2926 | static public void log(String message, Exception e) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments