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
2021 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2122*/
2223
23- package processing .app ;
24+ package processing .app . platform ;
2425
2526import java .awt .Desktop ;
2627import java .io .File ;
2930
3031import javax .swing .UIManager ;
3132
33+ import processing .app .Base ;
34+ import processing .app .Preferences ;
35+ import processing .app .Util ;
36+
3237import com .sun .jna .Library ;
3338import com .sun .jna .Native ;
3439import 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}
0 commit comments