From e805b5d6daeea160b0962655080ea850ca55d1f0 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 7 Oct 2001 15:48:05 +0000 Subject: [PATCH] much improved bagelpublic, minor fix in editor, applet updated for new bagel --- processing/app/PdeEditor.java | 5 +-- processing/app/ProcessingApplet.java | 46 +++++++++++++++------------- processing/app/bagelpublic.pl | 9 ++++-- processing/todo.txt | 27 ++++++++++------ 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index ed93e25ef..54f7c3ab7 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -287,11 +287,12 @@ public class PdeEditor extends Panel implements PdeEnvironment { lastDirectory = directory; lastFile = filename; - message("Done saving file."); + message("Done saving " + filename + "."); } catch (IOException e) { e.printStackTrace(); - message("Did not write file."); + //message("Did not write file."); + message("Could not write " + filename + "."); } buttons.clear(); } diff --git a/processing/app/ProcessingApplet.java b/processing/app/ProcessingApplet.java index f39352cf8..85381dce7 100644 --- a/processing/app/ProcessingApplet.java +++ b/processing/app/ProcessingApplet.java @@ -664,24 +664,18 @@ public class ProcessingApplet extends Applet } + public void ellipse(float x, float y, float hradius, float vradius) { + g.ellipse(x, y, hradius, vradius); + } + + public void cube(float size) { g.cube(size); } - public void box(float x1, float y1, float z1, - float x2, float y2, float z2) { - g.box(x1, y1, z1, x2, y2, z2); - } - - - public void circle(float x, float y, float radius) { - g.circle(x, y, radius); - } - - - public void oval(float x, float y, float hradius, float vradius) { - g.oval(x, y, hradius, vradius); + public void box(float w, float h, float d) { + g.box(w, h, d); } @@ -695,6 +689,11 @@ public class ProcessingApplet extends Applet } + public Image loadImage(String filename) { + return g.loadImage(filename); + } + + public void image(BagelImage image, float x1, float y1) { g.image(image, x1, y1); } @@ -713,23 +712,23 @@ public class ProcessingApplet extends Applet } - public void loadFont(String s) { - g.loadFont(s); + public int loadFont(String name) { + return g.loadFont(name); } - public void setFont(String s) { - g.setFont(s); + public void setFont(int which) { + g.setFont(which); } - public void text(char c) { - g.text(c); + public void text(char c, float x, float y) { + g.text(c, x, y); } - public void text(String s) { - g.text(s); + public void text(String s, float x, float y) { + g.text(s, x, y); } @@ -938,4 +937,9 @@ public class ProcessingApplet extends Applet public void message(int level, String message, Exception e) { g.message(level, message, e); } + + + public InputStream getStream(String filename) throws IOException { + return g.getStream(filename); + } } diff --git a/processing/app/bagelpublic.pl b/processing/app/bagelpublic.pl index 52faffd1e..892ec9008 100644 --- a/processing/app/bagelpublic.pl +++ b/processing/app/bagelpublic.pl @@ -34,9 +34,14 @@ while ($line = shift(@contents)) { } next if ($comments > 0); - if ($line =~ /^\s*(public \w+ [a-zA-z_]+\(.*$)/) { + if ($line =~ /^\s*public (\w+) [a-zA-z_]+\(.*$/) { #print "$1\n"; #$decl .= $line; + if ($1 ne 'void') { + $returns = 'return'; + } else { + $returns = ''; + } print "\n\n$line"; $decl .= $line; while (!($line =~ /\)/)) { @@ -49,7 +54,7 @@ while ($line = shift(@contents)) { $decl =~ /\s(\S+)\(/; $decl_name = $1; #print "dec $decl_name\n"; - print " g.${decl_name}("; + print " $returns g.${decl_name}("; $decl =~ s/\s+/ /g; # smush onto a single line $decl =~ s/^.*\(//; diff --git a/processing/todo.txt b/processing/todo.txt index 1fcae3f22..c713ed8d8 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -66,6 +66,7 @@ _ using them in your app will break things (i.e. init()) PROCESSING - MEDIUM +_ comprehensive list of reserved keywords _ better handling on portinuse exception _ or general exception handling--could go through some interface _ compile from the sketchbook if there are changes @@ -108,13 +109,16 @@ _ how to use ssh identity file to maintain auth for brancusi BAGEL X got rid of colorscale and using colormode for all instead +_ make changes in documentation +X 'ellipse' instead of 'oval'? _ make note in documentation -_ catmullrom is broken +X catmullrom is broken +_ write documentation for new curve functions + +_ get web documentation back into cvs _ have to get rid of static i/o stuff before porting to c - +_ may also need to get rid of floating point constants _ current acu fonts are broken - -_ 'ellipse' instead of 'oval'? _ area copying function: copy(x1, y1, w, h, xto, yto); _ should math functions be moved in? @@ -132,9 +136,11 @@ _ or x, y, diameter _ make note in docs about removal of LINE from LINES _ build in second matrix type: 2d affine _ add convex polygon type -_ make note in documentation about convex polygons +_ make note in documentation about convex polygons + _ sketch in antialiasing functions _ how does color depth work on ipaq? 4-4-4? 5-6-5? + _ font usage/substition solution _ java freetype? jni freetype to build texmap fonts? _ look at flash file format? (does it have kerning?) @@ -143,22 +149,25 @@ _ screen grabbing code _ simpler bitmap fonts w/o smoothing, just 2D _ alpha blending (easier) _ antialiasing -_ bresenham (flat) oval function _ setting origins _ should shapes draw from center or from upper left? _ should ovals use radius or diameter? _ should shapes use x1, y1 - x2, y2 or x, y, w, h? -BAGEL - SHOULD DO + +BAGEL - SHOULD +_ bresenham (flat) oval function +_ setting accuracy of circles/sphere +_ setting accuracy of curve segments _ write shearing function _ optimize rotation functions _ test winding polygons in different directions _ test lighting to see how it compares with gl - -BAGEL - FEATURES _ non-homogenous colors for beginShape() _ currently disabled b/c homogenousColors not set false for vertices _ and code not written for curve vertices +_ better lockout inside beginShape() to keep other things from happening +_ when stroke in use, stroke letters (currently stroke doesn't affect BUG WATCH