Skip to content

Commit 2a1fae8

Browse files
committed
turning off vaqua bits, no longer need override
1 parent f49138a commit 2a1fae8

File tree

1 file changed

+81
-74
lines changed

1 file changed

+81
-74
lines changed

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

+81-74
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@
2828
import java.io.IOException;
2929
import java.net.URI;
3030

31-
import javax.swing.Icon;
3231
import javax.swing.JMenu;
3332
import javax.swing.JMenuBar;
34-
import javax.swing.UIManager;
35-
import javax.swing.plaf.FontUIResource;
3633

3734
import processing.app.Base;
3835
import processing.app.Messages;
@@ -95,6 +92,7 @@ public void initBase(Base base) {
9592
}
9693

9794

95+
/*
9896
@Override
9997
public void setLookAndFeel() throws Exception {
10098
super.setLookAndFeel();
@@ -118,6 +116,7 @@ public void setLookAndFeel() throws Exception {
118116
UIManager.put("Tree.leafIcon", leaf);
119117
}
120118
}
119+
*/
121120

122121

123122
public File getSettingsFolder() throws Exception {
@@ -151,13 +150,21 @@ public void openURL(String url) throws Exception {
151150
// TODO I suspect this won't work much longer, since access to the user's
152151
// home directory seems verboten on more recent macOS versions [fry 191008]
153152
protected String getLibraryFolder() throws FileNotFoundException {
154-
return System.getProperty("user.home") + "/Library";
153+
File folder = new File(System.getProperty("user.home"), "Library");
154+
if (!folder.exists()) {
155+
throw new FileNotFoundException("Folder missing: " + folder);
156+
}
157+
return folder.getAbsolutePath();
155158
}
156159

157160

158161
// TODO see note on getLibraryFolder()
159162
protected String getDocumentsFolder() throws FileNotFoundException {
160-
return System.getProperty("user.home") + "/Documents";
163+
File folder = new File(System.getProperty("user.home"), "Documents");
164+
if (!folder.exists()) {
165+
throw new FileNotFoundException("Folder missing: " + folder);
166+
}
167+
return folder.getAbsolutePath();
161168
}
162169

163170

@@ -204,73 +211,73 @@ protected String getDocumentsFolder() throws FileNotFoundException {
204211
// VAQUA WORKAROUNDS FROM SAM
205212

206213

207-
/**
208-
* Spacer icon for macOS when using Vaqua.
209-
210-
* Due to potential rendering issues, this small spacer is used
211-
* to ensure that rendering is stable while using Vaqua with non-standard
212-
* Swing components. Without this, some sizing calculations non-standard
213-
* components may fail or become unreliable.
214-
*/
215-
static class VAquaEmptyIcon implements Icon {
216-
private final int SIZE = 1;
217-
218-
@Override
219-
public int getIconWidth() {
220-
return SIZE;
221-
}
222-
223-
@Override
224-
public int getIconHeight() {
225-
return SIZE;
226-
}
227-
228-
@Override
229-
public void paintIcon(Component c, Graphics g, int x, int y) { }
230-
}
231-
232-
233-
/**
234-
* Replacement tree icon for macOS when using Vaqua.
235-
*
236-
* Due to potential rendering issues with the regular tree icon set,
237-
* this replacement tree icon for macOS ensures stable rendering when using
238-
* Vaqua with non-standard swing components. Without this, some sizing
239-
* calculations within non-standard components may fail or become unreliable.
240-
*/
241-
static private class VAquaTreeIcon implements Icon {
242-
private final int SIZE = 12;
243-
private final boolean isOpen;
244-
245-
/**
246-
* Create a new tree icon.
247-
*
248-
* @param newIsOpen Flag indicating if the icon should be in the open or closed state at
249-
* construction. True if open false otherwise.
250-
*/
251-
public VAquaTreeIcon(boolean newIsOpen) {
252-
isOpen = newIsOpen;
253-
}
254-
255-
@Override
256-
public int getIconWidth() {
257-
return SIZE;
258-
}
259-
260-
@Override
261-
public int getIconHeight() {
262-
return SIZE;
263-
}
264-
265-
@Override
266-
public void paintIcon(Component c, Graphics g, int x, int y) {
267-
g.setColor(Color.GRAY);
268-
269-
g.drawLine(x + SIZE / 2 - 3, y + SIZE / 2, x + SIZE / 2 + 3, y + SIZE / 2);
270-
271-
if (!isOpen) {
272-
g.drawLine(x + SIZE / 2, y + SIZE / 2 - 3, x + SIZE / 2, y + SIZE / 2 + 3);
273-
}
274-
}
275-
}
214+
// /**
215+
// * Spacer icon for macOS when using Vaqua.
216+
//
217+
// * Due to potential rendering issues, this small spacer is used
218+
// * to ensure that rendering is stable while using Vaqua with non-standard
219+
// * Swing components. Without this, some sizing calculations non-standard
220+
// * components may fail or become unreliable.
221+
// */
222+
// static class VAquaEmptyIcon implements Icon {
223+
// private final int SIZE = 1;
224+
//
225+
// @Override
226+
// public int getIconWidth() {
227+
// return SIZE;
228+
// }
229+
//
230+
// @Override
231+
// public int getIconHeight() {
232+
// return SIZE;
233+
// }
234+
//
235+
// @Override
236+
// public void paintIcon(Component c, Graphics g, int x, int y) { }
237+
// }
238+
//
239+
//
240+
// /**
241+
// * Replacement tree icon for macOS when using Vaqua.
242+
// *
243+
// * Due to potential rendering issues with the regular tree icon set,
244+
// * this replacement tree icon for macOS ensures stable rendering when using
245+
// * Vaqua with non-standard swing components. Without this, some sizing
246+
// * calculations within non-standard components may fail or become unreliable.
247+
// */
248+
// static private class VAquaTreeIcon implements Icon {
249+
// private final int SIZE = 12;
250+
// private final boolean isOpen;
251+
//
252+
// /**
253+
// * Create a new tree icon.
254+
// *
255+
// * @param newIsOpen Flag indicating if the icon should be in the open or closed state at
256+
// * construction. True if open false otherwise.
257+
// */
258+
// public VAquaTreeIcon(boolean newIsOpen) {
259+
// isOpen = newIsOpen;
260+
// }
261+
//
262+
// @Override
263+
// public int getIconWidth() {
264+
// return SIZE;
265+
// }
266+
//
267+
// @Override
268+
// public int getIconHeight() {
269+
// return SIZE;
270+
// }
271+
//
272+
// @Override
273+
// public void paintIcon(Component c, Graphics g, int x, int y) {
274+
// g.setColor(Color.GRAY);
275+
//
276+
// g.drawLine(x + SIZE / 2 - 3, y + SIZE / 2, x + SIZE / 2 + 3, y + SIZE / 2);
277+
//
278+
// if (!isOpen) {
279+
// g.drawLine(x + SIZE / 2, y + SIZE / 2 - 3, x + SIZE / 2, y + SIZE / 2 + 3);
280+
// }
281+
// }
282+
// }
276283
}

0 commit comments

Comments
 (0)