Skip to content

Commit efa529e

Browse files
committed
starting platform move
1 parent cca2696 commit efa529e

File tree

5 files changed

+17
-61
lines changed

5 files changed

+17
-61
lines changed

app/src/processing/app/Base.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class Base {
7979
platformIndices.put("macosx", PConstants.MACOSX); //$NON-NLS-1$
8080
platformIndices.put("linux", PConstants.LINUX); //$NON-NLS-1$
8181
}
82-
static Platform platform;
82+
// static Platform platform;
8383

8484
/** How many bits this machine is */
8585
static int nativeBits;
@@ -192,7 +192,7 @@ static private void createAndShowGUI(String[] args) {
192192
if (!SingleInstance.alreadyRunning(args)) {
193193
// Set the look and feel before opening the window
194194
try {
195-
platform.setLookAndFeel();
195+
Platform.setLookAndFeel();
196196
} catch (Exception e) {
197197
loge("Could not set the Look & Feel", e); //$NON-NLS-1$
198198
}

app/src/processing/app/platform/LinuxPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import java.awt.Toolkit;
2727

2828
import processing.app.Base;
29-
import processing.app.Platform;
3029
import processing.app.Preferences;
30+
import processing.app.platform.Platform;
3131

3232

3333
public class LinuxPlatform extends Platform {

app/src/processing/app/platform/MacPlatform.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import com.apple.eio.FileManager;
3030

3131
import processing.app.Base;
32-
import processing.app.Platform;
32+
import processing.app.platform.Platform;
3333

3434

3535
/**
@@ -93,8 +93,8 @@ public void init(Base base) {
9393
}
9494
*/
9595
}
96-
97-
96+
97+
9898
public File getSettingsFolder() throws Exception {
9999
return new File(getLibraryFolder(), "Processing");
100100
}
@@ -115,10 +115,10 @@ public File getDefaultSketchbookFolder() throws Exception {
115115
}
116116
*/
117117
}
118-
119118

120-
// /**
121-
// * Moves the specified File object (which might be a file or folder)
119+
120+
// /**
121+
// * Moves the specified File object (which might be a file or folder)
122122
// * to the trash.
123123
// */
124124
// public boolean deleteFile(File file) throws IOException {

app/src/processing/app/Platform.java renamed to app/src/processing/app/platform/Platform.java

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
/*
44
Part of the Processing project - http://processing.org
55
6-
Copyright (c) 2008 Ben Fry and Casey Reas
6+
Copyright (c) 2012-15 The Processing Foundation
7+
Copyright (c) 2008-12 Ben Fry and Casey Reas
78
89
This program is free software; you can redistribute it and/or modify
910
it under the terms of the GNU General Public License as published by
@@ -20,7 +21,7 @@
2021
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2122
*/
2223

23-
package processing.app;
24+
package processing.app.platform;
2425

2526
import java.awt.Desktop;
2627
import java.io.File;
@@ -29,6 +30,10 @@
2930

3031
import javax.swing.UIManager;
3132

33+
import processing.app.Base;
34+
import processing.app.Preferences;
35+
import processing.app.Util;
36+
3237
import com.sun.jna.Library;
3338
import com.sun.jna.Native;
3439
import com.sun.jna.platform.FileUtils;
@@ -96,21 +101,6 @@ public File getSettingsFolder() throws Exception {
96101
// otherwise make a .processing directory int the user's home dir
97102
File home = new File(System.getProperty("user.home"));
98103
return new File(home, ".processing");
99-
100-
/*
101-
try {
102-
Class clazz = Class.forName("processing.app.macosx.ThinkDifferent");
103-
Method m = clazz.getMethod("getLibraryFolder", new Class[] { });
104-
String libraryPath = (String) m.invoke(null, new Object[] { });
105-
//String libraryPath = BaseMacOS.getLibraryFolder();
106-
File libraryFolder = new File(libraryPath);
107-
dataFolder = new File(libraryFolder, "Processing");
108-
109-
} catch (Exception e) {
110-
showError("Problem getting data folder",
111-
"Error getting the Processing data folder.", e);
112-
}
113-
*/
114104
}
115105

116106

@@ -125,36 +115,16 @@ public File getDefaultSketchbookFolder() throws Exception {
125115

126116
public void openURL(String url) throws Exception {
127117
Desktop.getDesktop().browse(new URI(url));
128-
/*
129-
String launcher = Preferences.get("launcher");
130-
if (launcher != null) {
131-
Runtime.getRuntime().exec(new String[] { launcher, url });
132-
} else {
133-
showLauncherWarning();
134-
}
135-
*/
136118
}
137119

138120

139121
public boolean openFolderAvailable() {
140122
return Desktop.isDesktopSupported();
141-
/*
142-
return Preferences.get("launcher") != null;
143-
*/
144123
}
145124

146125

147126
public void openFolder(File file) throws Exception {
148127
Desktop.getDesktop().open(file);
149-
/*
150-
String launcher = Preferences.get("launcher");
151-
if (launcher != null) {
152-
String folder = file.getAbsolutePath();
153-
Runtime.getRuntime().exec(new String[] { launcher, folder });
154-
} else {
155-
showLauncherWarning();
156-
}
157-
*/
158128
}
159129

160130

@@ -210,18 +180,4 @@ public int unsetenv(String variable) {
210180
CLibrary clib = CLibrary.INSTANCE;
211181
return clib.unsetenv(variable);
212182
}
213-
214-
215-
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
216-
217-
218-
/*
219-
protected void showLauncherWarning() {
220-
Base.showWarning("No launcher available",
221-
"Unspecified platform, no launcher available.\n" +
222-
"To enable opening URLs or folders, add a \n" +
223-
"\"launcher=/path/to/app\" line to preferences.txt",
224-
null);
225-
}
226-
*/
227183
}

app/src/processing/app/platform/WindowsPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import com.sun.jna.platform.win32.WinNT.HRESULT;
3737

3838
import processing.app.Base;
39-
import processing.app.Platform;
4039
import processing.app.Preferences;
40+
import processing.app.platform.Platform;
4141
import processing.app.platform.WindowsRegistry.REGISTRY_ROOT_KEY;
4242
import processing.core.PApplet;
4343

0 commit comments

Comments
 (0)