Skip to content

Commit a019e67

Browse files
committed
cleanups and formatting
1 parent ceadef5 commit a019e67

2 files changed

Lines changed: 30 additions & 23 deletions

File tree

app/src/processing/app/Platform.java

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,20 @@ public class Platform {
5353
Base base;
5454

5555

56+
public void init(Base base) {
57+
this.base = base;
58+
}
59+
60+
5661
/**
5762
* Set the default L & F. While I enjoy the bounty of the sixteen possible
5863
* exception types that this UIManager method might throw, I feel that in
5964
* just this one particular case, I'm being spoiled by those engineers
60-
* at Sun, those Masters of the Abstractionverse. It leaves me feeling sad
61-
* and overweight. So instead, I'll pretend that I'm not offered eleven dozen
62-
* ways to report to the user exactly what went wrong, and I'll bundle them
63-
* all into a single catch-all "Exception". Because in the end, all I really
64-
* care about is whether things worked or not. And even then, I don't care.
65-
*
65+
* at Sun, those Masters of the Abstractionverse. So instead, I'll pretend
66+
* that I'm not offered eleven dozen ways to report to the user exactly what
67+
* went wrong, and I'll bundle them all into a single catch-all "Exception".
68+
* Because in the end, all I really care about is whether things worked or
69+
* not. And even then, I don't care.
6670
* @throws Exception Just like I said.
6771
*/
6872
public void setLookAndFeel() throws Exception {
@@ -74,17 +78,20 @@ public void setLookAndFeel() throws Exception {
7478
}
7579
}
7680

77-
public void saveLanguage(String languageCode) {}
7881

79-
public void init(Base base) {
80-
this.base = base;
81-
}
82+
/**
83+
* Handle any platform-specific languages saving. This is necessary on OS X
84+
* because of how bundles are handled, but perhaps your platform would like
85+
* to Think Different too?
86+
* @param languageCode 2-digit lowercase ISO language code
87+
*/
88+
public void saveLanguage(String languageCode) { }
8289

8390

84-
/**
85-
* This function should throw an exception or return a value.
86-
* Do not return null.
87-
*/
91+
/**
92+
* This function should throw an exception or return a value.
93+
* Do not return null.
94+
*/
8895
public File getSettingsFolder() throws Exception {
8996
// otherwise make a .processing directory int the user's home dir
9097
File home = new File(System.getProperty("user.home"));
@@ -149,26 +156,26 @@ public void openFolder(File file) throws Exception {
149156
}
150157
*/
151158
}
152-
159+
153160

154161
/**
155-
* Attempts to move to the Trash on OS X, or the Recycle Bin on Windows.
156-
* Also tries to find a suitable Trash location on Linux.
157-
* If not possible, just deletes the file or folder instead.
162+
* Attempts to move to the Trash on OS X, or the Recycle Bin on Windows.
163+
* Also tries to find a suitable Trash location on Linux.
164+
* If not possible, just deletes the file or folder instead.
158165
* @param file the folder or file to be removed/deleted
159166
* @return true if the folder was successfully removed
160-
* @throws IOException
167+
* @throws IOException
161168
*/
162169
final public boolean deleteFile(File file) throws IOException {
163170
FileUtils fu = FileUtils.getInstance();
164171
if (fu.hasTrash()) {
165172
fu.moveToTrash(new File[] { file });
166173
return true;
167-
174+
168175
} else if (file.isDirectory()) {
169176
Base.removeDir(file);
170177
return true;
171-
178+
172179
} else {
173180
return file.delete();
174181
}

app/src/processing/app/Preferences.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static public void init() {
145145
// http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
146146
String proxyHost = get("proxy.host");
147147
String proxyPort = get("proxy.port");
148-
if (proxyHost != null && proxyHost.trim().length() != 0 &&
149-
proxyPort != null && proxyPort.trim().length() != 0) {
148+
if (proxyHost != null && proxyHost.length() != 0 &&
149+
proxyPort != null && proxyPort.length() != 0) {
150150
System.setProperty("http.proxyHost", proxyHost);
151151
System.setProperty("http.proxyPort", proxyPort);
152152
}

0 commit comments

Comments
 (0)