1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Removed dependency from Base in all Platform classes.

This commit is contained in:
Claudio Indellicati
2014-08-22 11:45:34 +02:00
committed by Cristian Maglie
parent eb284804f5
commit b278c19a2a
5 changed files with 9 additions and 11 deletions

View File

@ -43,6 +43,7 @@ import processing.app.helpers.filefilters.OnlyDirs;
import processing.app.helpers.filefilters.OnlyFilesWithExtension; import processing.app.helpers.filefilters.OnlyFilesWithExtension;
import processing.app.javax.swing.filechooser.FileNameExtensionFilter; import processing.app.javax.swing.filechooser.FileNameExtensionFilter;
import processing.app.legacy.PApplet; import processing.app.legacy.PApplet;
import processing.app.macosx.ThinkDifferent;
import processing.app.packages.Library; import processing.app.packages.Library;
import processing.app.packages.LibraryList; import processing.app.packages.LibraryList;
import processing.app.tools.MenuScroller; import processing.app.tools.MenuScroller;
@ -223,7 +224,9 @@ public class Base {
protected static enum ACTION { GUI, NOOP, VERIFY, UPLOAD, GET_PREF }; protected static enum ACTION { GUI, NOOP, VERIFY, UPLOAD, GET_PREF };
public Base(String[] args) throws Exception { 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 // Get the sketchbook path, and make sure it's set properly
String sketchbookPath = Preferences.get("sketchbook.path"); String sketchbookPath = Preferences.get("sketchbook.path");

View File

@ -54,7 +54,6 @@ import processing.app.legacy.PConstants;
* know if name is proper Java package syntax.) * know if name is proper Java package syntax.)
*/ */
public class Platform { public class Platform {
Base base;
/** /**
@ -74,8 +73,7 @@ public class Platform {
} }
public void init(Base base) { public void init() {
this.base = base;
} }

View File

@ -25,7 +25,6 @@ package processing.app.macosx;
import com.apple.eio.FileManager; import com.apple.eio.FileManager;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.Executor; import org.apache.commons.exec.Executor;
import processing.app.Base;
import processing.app.debug.TargetPackage; import processing.app.debug.TargetPackage;
import processing.app.tools.ExternalProcessExecutor; import processing.app.tools.ExternalProcessExecutor;
import processing.app.legacy.PApplet; import processing.app.legacy.PApplet;
@ -58,9 +57,8 @@ public class Platform extends processing.app.Platform {
Toolkit.getDefaultToolkit(); Toolkit.getDefaultToolkit();
} }
public void init(Base base) { public void init() {
System.setProperty("apple.laf.useScreenMenuBar", "true"); System.setProperty("apple.laf.useScreenMenuBar", "true");
ThinkDifferent.init(base);
/* /*
try { try {
String name = "processing.app.macosx.ThinkDifferent"; String name = "processing.app.macosx.ThinkDifferent";

View File

@ -50,7 +50,7 @@ public class ThinkDifferent implements ApplicationListener {
private Base base; private Base base;
static protected void init(Base base) { static public void init(Base base) {
if (application == null) { if (application == null) {
//application = new com.apple.eawt.Application(); //application = new com.apple.eawt.Application();
application = com.apple.eawt.Application.getApplication(); application = com.apple.eawt.Application.getApplication();

View File

@ -28,7 +28,6 @@ import com.sun.jna.Native;
import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.Executor; import org.apache.commons.exec.Executor;
import processing.app.Base;
import processing.app.PreferencesData; import processing.app.PreferencesData;
import processing.app.debug.TargetPackage; import processing.app.debug.TargetPackage;
import processing.app.legacy.PApplet; import processing.app.legacy.PApplet;
@ -56,8 +55,8 @@ public class Platform extends processing.app.Platform {
"\\arduino.exe \"%1\""; "\\arduino.exe \"%1\"";
static final String DOC = "Arduino.Document"; static final String DOC = "Arduino.Document";
public void init(Base base) { public void init() {
super.init(base); super.init();
checkAssociations(); checkAssociations();
checkQuickTime(); checkQuickTime();