From 95d4e144c576fc33939e9656d37c0e725051ee66 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 28 Feb 2005 21:49:29 +0000 Subject: [PATCH] die() throws ex, kUserDomain for find docs folder on osx --- processing/app/PdeBase.java | 16 ++++++++++++---- processing/core/PApplet.java | 3 +++ processing/core/todo.txt | 19 +++++++++---------- processing/todo.txt | 5 ++++- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index 521c332b0..5261a240a 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -323,11 +323,19 @@ public class PdeBase { // not clear if i can write to this folder tho.. try { MRJOSType domainDocuments = new MRJOSType("docs"); - File libraryFolder = MRJFileUtils.findFolder(domainDocuments); - //MRJFileUtils.findFolder(kUserDomain, domainDocuments); - sketchbookFolder = new File(libraryFolder, "Processing"); + //File libraryFolder = MRJFileUtils.findFolder(domainDocuments); - } catch (FileNotFoundException e) { + // for 77, try switching this to the user domain, just to be sure + Method findFolderMethod = + MRJFileUtils.class.getMethod("findFolder", + new Class[] { Short.TYPE, + MRJOSType.class }); + File documentsFolder = (File) + findFolderMethod.invoke(null, new Object[] { new Short(kUserDomain), + domainDocuments }); + sketchbookFolder = new File(documentsFolder, "Processing"); + + } catch (Exception e) { showError("sketch folder problem", "Could not locate default sketch folder location.", e); } diff --git a/processing/core/PApplet.java b/processing/core/PApplet.java index 8a97e79d9..7f7b2cbf3 100644 --- a/processing/core/PApplet.java +++ b/processing/core/PApplet.java @@ -1266,6 +1266,8 @@ public class PApplet extends Applet public void die(String what) { stop(); + throw new RuntimeException("died: " + what); + /* if (online) { System.err.println("i'm dead.. " + what); @@ -1273,6 +1275,7 @@ public class PApplet extends Applet System.err.println(what); System.exit(1); } + */ } diff --git a/processing/core/todo.txt b/processing/core/todo.txt index 87ec6071f..6dd02f220 100644 --- a/processing/core/todo.txt +++ b/processing/core/todo.txt @@ -9,6 +9,7 @@ X may need a 'wedge' function to draw a stroke around the whole thing X only allocate stencil and zbuffer on first call to depth() X this will require changes to PTriangle and PLine inside their loops X try running javadoc +X die() may need to throw a RuntimeException covered in previous X before graphics engine change, attach jogl stuff @@ -107,15 +108,7 @@ X make light() functions actually do something in PGraphicsGL X box() and sphere() working again X make opengl work in draw mode X set initial size using --size= - -api todos -_ sphere x,y,z,r or box w,h,d.. need to make them consistent -_ look at curve functions more closely -_ should we switch to curveVertex(1,2,3) (ala curveto) -_ because some confusion with mixing types of curves -_ how to force PGraphics() instead of PGraphics2() - -_ color channels seem to be swapped on windows in displaying image example +X color channels seem to be swapped on windows in image example X check on the mac to see what it looks like _ get text working again @@ -131,10 +124,16 @@ _ default to single byte input from serial port _ and add serial.setBuffer() for message length as alternative _ or serial.setDelimiter() to fire message on delim -_ die() may need to throw a RuntimeException // +api todos +_ sphere x,y,z,r or box w,h,d.. need to make them consistent +_ look at curve functions more closely +_ should we switch to curveVertex(1,2,3) (ala curveto) +_ because some confusion with mixing types of curves +_ how to force PGraphics() instead of PGraphics2() + _ also have a simple way to hook in triangle leeches to PGraphics3 _ implement PGraphics2.curveVertex() diff --git a/processing/todo.txt b/processing/todo.txt index 4afeefde8..c639298c0 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -12,7 +12,10 @@ X (same as applet exporter function) o when using core graphics, don't show applet frame until first frame o (in opengl, open frame early, make sure this isn't inhibited) X probably can't do this, since don't know at runtime if it's gl -X RuntimeException +X RuntimeException errors are a little prettier +X updated windows icon +X make macosx use kUserDomain to grab Documents folder +X this is just-in-case, who knows what they're up to over in cupertino create a new sketch create a new tab named "a"