From 2b3345061fafae96cd03b11dcbd646bbf02318fc Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 21 Jul 2013 12:27:55 -0400 Subject: [PATCH] Moving platform classes to new names/packages --- .../{Platform.java => LinuxPlatform.java} | 2 +- .../MacPlatform.java} | 4 ++-- .../{macosx => platform}/ThinkDifferent.java | 2 +- .../{Platform.java => WindowsPlatform.java} | 22 +++++++++---------- .../{Registry.java => WindowsRegistry.java} | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) rename app/src/processing/app/linux/{Platform.java => LinuxPlatform.java} (98%) rename app/src/processing/app/{macosx/Platform.java => platform/MacPlatform.java} (98%) rename app/src/processing/app/{macosx => platform}/ThinkDifferent.java (99%) rename app/src/processing/app/windows/{Platform.java => WindowsPlatform.java} (96%) rename app/src/processing/app/windows/{Registry.java => WindowsRegistry.java} (99%) diff --git a/app/src/processing/app/linux/Platform.java b/app/src/processing/app/linux/LinuxPlatform.java similarity index 98% rename from app/src/processing/app/linux/Platform.java rename to app/src/processing/app/linux/LinuxPlatform.java index 2a5415b82..b484f69e7 100644 --- a/app/src/processing/app/linux/Platform.java +++ b/app/src/processing/app/linux/LinuxPlatform.java @@ -28,7 +28,7 @@ import processing.app.Base; import processing.app.Preferences; -public class Platform extends processing.app.Platform { +public class LinuxPlatform extends processing.app.Platform { public void init(Base base) { super.init(base); diff --git a/app/src/processing/app/macosx/Platform.java b/app/src/processing/app/platform/MacPlatform.java similarity index 98% rename from app/src/processing/app/macosx/Platform.java rename to app/src/processing/app/platform/MacPlatform.java index c09f2b55a..b8038290e 100644 --- a/app/src/processing/app/macosx/Platform.java +++ b/app/src/processing/app/platform/MacPlatform.java @@ -20,7 +20,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package processing.app.macosx; +package processing.app.platform; import java.io.File; import java.io.FileNotFoundException; @@ -33,7 +33,7 @@ import processing.app.Base; /** * Platform handler for Mac OS X. */ -public class Platform extends processing.app.Platform { +public class MacPlatform extends processing.app.Platform { // Removing for 2.0b8 because Quaqua doesn't have OS X 10.8 version. /* diff --git a/app/src/processing/app/macosx/ThinkDifferent.java b/app/src/processing/app/platform/ThinkDifferent.java similarity index 99% rename from app/src/processing/app/macosx/ThinkDifferent.java rename to app/src/processing/app/platform/ThinkDifferent.java index f65038279..bc7a8808f 100644 --- a/app/src/processing/app/macosx/ThinkDifferent.java +++ b/app/src/processing/app/platform/ThinkDifferent.java @@ -19,7 +19,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package processing.app.macosx; +package processing.app.platform; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/app/src/processing/app/windows/Platform.java b/app/src/processing/app/windows/WindowsPlatform.java similarity index 96% rename from app/src/processing/app/windows/Platform.java rename to app/src/processing/app/windows/WindowsPlatform.java index 4405d008f..059c7833a 100755 --- a/app/src/processing/app/windows/Platform.java +++ b/app/src/processing/app/windows/WindowsPlatform.java @@ -36,7 +36,7 @@ import com.sun.jna.platform.win32.WinNT.HRESULT; import processing.app.Base; import processing.app.Preferences; -import processing.app.windows.Registry.REGISTRY_ROOT_KEY; +import processing.app.windows.WindowsRegistry.REGISTRY_ROOT_KEY; import processing.core.PApplet; @@ -44,7 +44,7 @@ import processing.core.PApplet; * Platform-specific glue for Windows. * */ -public class Platform extends processing.app.Platform { +public class WindowsPlatform extends processing.app.Platform { static final String APP_NAME = "Processing"; static final String REG_OPEN_COMMAND = @@ -136,7 +136,7 @@ public class Platform extends processing.app.Platform { if (Preferences.getBoolean("platform.auto_file_type_associations")) { // Check the key that should be set by a previous run of Processing String knownCommand = - Registry.getStringValue(REGISTRY_ROOT_KEY.CURRENT_USER, + WindowsRegistry.getStringValue(REGISTRY_ROOT_KEY.CURRENT_USER, "Software\\Classes\\" + REG_DOC + "\\shell\\open\\command", ""); // If the association hasn't been set, or it's not correct, set it. if (knownCommand == null || !knownCommand.equals(REG_OPEN_COMMAND)) { @@ -197,18 +197,18 @@ public class Platform extends processing.app.Platform { final String docPrefix = "Software\\Classes\\" + REG_DOC; // First create the .pde association - if (Registry.createKey(rootKey, "Software\\Classes", ".pde") && - Registry.setStringValue(rootKey, "Software\\Classes\\.pde", "", REG_DOC) && + if (WindowsRegistry.createKey(rootKey, "Software\\Classes", ".pde") && + WindowsRegistry.setStringValue(rootKey, "Software\\Classes\\.pde", "", REG_DOC) && // Now give files with a .pde extension a name for the explorer - Registry.createKey(rootKey, "Software\\Classes", REG_DOC) && - Registry.setStringValue(rootKey, docPrefix, "", APP_NAME + " Source Code") && + WindowsRegistry.createKey(rootKey, "Software\\Classes", REG_DOC) && + WindowsRegistry.setStringValue(rootKey, docPrefix, "", APP_NAME + " Source Code") && // Now associate the 'open' command with the current processing.exe - Registry.createKey(rootKey, docPrefix, "shell") && - Registry.createKey(rootKey, docPrefix + "\\shell", "open") && - Registry.createKey(rootKey, docPrefix + "\\shell\\open", "command") && - Registry.setStringValue(rootKey, docPrefix + "\\shell\\open\\command", "", REG_OPEN_COMMAND)) { + WindowsRegistry.createKey(rootKey, docPrefix, "shell") && + WindowsRegistry.createKey(rootKey, docPrefix + "\\shell", "open") && + WindowsRegistry.createKey(rootKey, docPrefix + "\\shell\\open", "command") && + WindowsRegistry.setStringValue(rootKey, docPrefix + "\\shell\\open\\command", "", REG_OPEN_COMMAND)) { // everything ok // hooray! diff --git a/app/src/processing/app/windows/Registry.java b/app/src/processing/app/windows/WindowsRegistry.java similarity index 99% rename from app/src/processing/app/windows/Registry.java rename to app/src/processing/app/windows/WindowsRegistry.java index 11f78980a..49c614eed 100644 --- a/app/src/processing/app/windows/Registry.java +++ b/app/src/processing/app/windows/WindowsRegistry.java @@ -22,7 +22,7 @@ import com.sun.jna.ptr.IntByReference; * Not sure of where this code came from originally, but it was hacked on * 20 July 2013 to make updates for use with JNA 3.5.2's platform classes. */ -public class Registry { +public class WindowsRegistry { static public enum REGISTRY_ROOT_KEY { CLASSES_ROOT, CURRENT_USER, LOCAL_MACHINE, USERS };