From b278c19a2a32848cc72488ed47d75d7e6fa0a6b8 Mon Sep 17 00:00:00 2001 From: Claudio Indellicati Date: Fri, 22 Aug 2014 11:45:34 +0200 Subject: [PATCH] Removed dependency from Base in all Platform classes. --- app/src/processing/app/Base.java | 5 ++++- app/src/processing/app/Platform.java | 4 +--- app/src/processing/app/macosx/Platform.java | 4 +--- app/src/processing/app/macosx/ThinkDifferent.java | 2 +- app/src/processing/app/windows/Platform.java | 5 ++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 88665d57d..b0dba7119 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -43,6 +43,7 @@ import processing.app.helpers.filefilters.OnlyDirs; import processing.app.helpers.filefilters.OnlyFilesWithExtension; import processing.app.javax.swing.filechooser.FileNameExtensionFilter; import processing.app.legacy.PApplet; +import processing.app.macosx.ThinkDifferent; import processing.app.packages.Library; import processing.app.packages.LibraryList; import processing.app.tools.MenuScroller; @@ -223,7 +224,9 @@ public class Base { protected static enum ACTION { GUI, NOOP, VERIFY, UPLOAD, GET_PREF }; public Base(String[] args) throws Exception { - getPlatform().init(this); + getPlatform().init(); + if (OSUtils.isMacOS()) + ThinkDifferent.init(this); // Get the sketchbook path, and make sure it's set properly String sketchbookPath = Preferences.get("sketchbook.path"); diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index bf0f8ddd5..fde41c8f2 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -54,7 +54,6 @@ import processing.app.legacy.PConstants; * know if name is proper Java package syntax.) */ public class Platform { - Base base; /** @@ -74,8 +73,7 @@ public class Platform { } - public void init(Base base) { - this.base = base; + public void init() { } diff --git a/app/src/processing/app/macosx/Platform.java b/app/src/processing/app/macosx/Platform.java index 1d1a2305a..486a986ad 100644 --- a/app/src/processing/app/macosx/Platform.java +++ b/app/src/processing/app/macosx/Platform.java @@ -25,7 +25,6 @@ package processing.app.macosx; import com.apple.eio.FileManager; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.Executor; -import processing.app.Base; import processing.app.debug.TargetPackage; import processing.app.tools.ExternalProcessExecutor; import processing.app.legacy.PApplet; @@ -58,9 +57,8 @@ public class Platform extends processing.app.Platform { Toolkit.getDefaultToolkit(); } - public void init(Base base) { + public void init() { System.setProperty("apple.laf.useScreenMenuBar", "true"); - ThinkDifferent.init(base); /* try { String name = "processing.app.macosx.ThinkDifferent"; diff --git a/app/src/processing/app/macosx/ThinkDifferent.java b/app/src/processing/app/macosx/ThinkDifferent.java index 0f226dd71..e14770a9b 100644 --- a/app/src/processing/app/macosx/ThinkDifferent.java +++ b/app/src/processing/app/macosx/ThinkDifferent.java @@ -50,7 +50,7 @@ public class ThinkDifferent implements ApplicationListener { private Base base; - static protected void init(Base base) { + static public void init(Base base) { if (application == null) { //application = new com.apple.eawt.Application(); application = com.apple.eawt.Application.getApplication(); diff --git a/app/src/processing/app/windows/Platform.java b/app/src/processing/app/windows/Platform.java index dad118312..a35f7c195 100644 --- a/app/src/processing/app/windows/Platform.java +++ b/app/src/processing/app/windows/Platform.java @@ -28,7 +28,6 @@ import com.sun.jna.Native; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.Executor; -import processing.app.Base; import processing.app.PreferencesData; import processing.app.debug.TargetPackage; import processing.app.legacy.PApplet; @@ -56,8 +55,8 @@ public class Platform extends processing.app.Platform { "\\arduino.exe \"%1\""; static final String DOC = "Arduino.Document"; - public void init(Base base) { - super.init(base); + public void init() { + super.init(); checkAssociations(); checkQuickTime();