From 7e618de688eeec508c5439ea7c61e681bef9e307 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 29 Sep 2003 20:17:42 +0000 Subject: [PATCH] re-enable thick line code, safari paste bug fix, remove cancel on save changes --- app/PdeEditor.java | 83 +++++++++++++++++++++++++++++--------- app/PdeFontBuilder.java | 3 ++ build/shared/bugs.txt | 5 ++- build/shared/revisions.txt | 36 +++++++++++++++++ todo.txt | 11 ++++- 5 files changed, 116 insertions(+), 22 deletions(-) diff --git a/app/PdeEditor.java b/app/PdeEditor.java index 2e738dd73..b15aee7ce 100644 --- a/app/PdeEditor.java +++ b/app/PdeEditor.java @@ -589,13 +589,52 @@ public class PdeEditor extends JPanel { preprocessor.writeJava(className, imports, extendsNormal, false); - } catch (antlr.RecognitionException ae) { + } catch (antlr.RecognitionException re) { // this even returns a column - throw new PdeException(ae.getMessage(), - ae.getLine() - 1, ae.getColumn()); + throw new PdeException(re.getMessage(), + re.getLine() - 1, re.getColumn()); + + } catch (antlr.TokenStreamRecognitionException tsre) { + // while this seems to store line and column internally, + // there doesn't seem to be a method to grab it.. + // so instead it's done using a regexp + + //try { + PatternMatcher matcher = new Perl5Matcher(); + PatternCompiler compiler = new Perl5Compiler(); + // line 3:1: unexpected char: 0xA0 + String mess = "^line (\\d+):(\\d+):\\s"; + Pattern pattern = compiler.compile(mess); + + PatternMatcherInput input = + new PatternMatcherInput(tsre.toString()); + if (matcher.contains(input, pattern)) { + MatchResult result = matcher.getMatch(); + //try { + int line = Integer.parseInt(result.group(1).toString()); + int column = Integer.parseInt(result.group(2).toString()); + throw new PdeException(tsre.getMessage(), line-1, column); + + //} catch (NumberFormatException e) { + //} + } else { + //System.out.println("didn't match input"); + throw new PdeException(tsre.toString()); + } + + /* + } catch (MalformedPatternException mpe){ + mpe.printStackTrace(); + + } catch (Exception e) { // not understood + e.printStackTrace(); + throw new PdeException(tsre.toString()); + } + */ } catch (PdeException pe) { throw pe; + } catch (Exception ex) { System.err.println("Uncaught exception type:" + ex.getClass()); ex.printStackTrace(); @@ -909,21 +948,27 @@ public class PdeEditor extends JPanel { int result = 0; - if (PdeBase.platform == PdeBase.MACOSX) { - // macosx java kills the app even though cancel might get hit - // so the cancel button is (temporarily) left off - // this may be treated differently in macosx java 1.4, - // but 1.4 isn't currently stable enough to use. - Object[] options = { "Yes", "No" }; - result = JOptionPane.showOptionDialog(this, - prompt, - "Quit", - JOptionPane.YES_NO_OPTION, - JOptionPane.QUESTION_MESSAGE, - null, - options, - options[0]); // default to save + //if (PdeBase.platform == PdeBase.MACOSX) { + // macosx java kills the app even though cancel might get hit + // so the cancel button is (temporarily) left off + // this may be treated differently in macosx java 1.4, + // but 1.4 isn't currently stable enough to use. + + // turns out windows has the same problem (sometimes) + // disable cancel for now until a fix can be found. + + Object[] options = { "Yes", "No" }; + result = JOptionPane.showOptionDialog(this, + prompt, + "Quit", + JOptionPane.YES_NO_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, + options, + options[0]); // default to save + + /* } else { Object[] options = { "Yes", "No", "Cancel" }; result = JOptionPane.showOptionDialog(this, @@ -934,7 +979,7 @@ public class PdeEditor extends JPanel { null, options, options[2]); - } + */ if (result == JOptionPane.YES_OPTION) { //System.out.println("yes"); @@ -952,7 +997,7 @@ public class PdeEditor extends JPanel { // does nothing } - } else { + } else { // not quitting status.prompt(prompt); } diff --git a/app/PdeFontBuilder.java b/app/PdeFontBuilder.java index 4eceb8e84..64455fb83 100644 --- a/app/PdeFontBuilder.java +++ b/app/PdeFontBuilder.java @@ -141,6 +141,9 @@ public class PdeFontBuilder extends JFrame { font = new Font(list[selection], Font.PLAIN, fontsize); //System.out.println("setting font to " + font); sample.setFont(font); + + String filenameSuggestion = list[selection].replace(' ', '_'); + filenameField.setText(filenameSuggestion); } } }); diff --git a/build/shared/bugs.txt b/build/shared/bugs.txt index 2230f7ef4..9b51cae6e 100644 --- a/build/shared/bugs.txt +++ b/build/shared/bugs.txt @@ -59,9 +59,10 @@ the real deal, keeping us awake at night up. we're working on a fix. http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1064182823 -- macosx doesn't provide an option to 'cancel' when it so politely asks +- the app doesn't provide an option to 'cancel' when it so politely asks if you want to "save changes before quitting?". this is because of - weirdness in apple's java that we're trying to straighten out. + java weirdness that we're trying to straighten out. the vm seems to + be force quitting itself, even if cancel is selected. - lines with stroke weights that aren't 1 are probably broken. diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 51a5d7006..cd0ff9fe0 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -4,6 +4,42 @@ for older releases will be super crusty. caution: the beverage you're about to enjoy is extremely hot. +ABOUT REV 0064 - 29 september 2003 + +this release fixes three bugs, any of which might be major for you, or +in total may seem like nothing at all. they're all specific fixes for +people that piped up about something + +this is another mini-release like 61, 62, and 63. it's a suggested +download, but not as huge as revision 60. + + +[ bug fixes ] + +- thick lines, which disappeared in rev 60, have returned triumphant + due to a nudge from ed. + +- fixed a bug on macosx, especially with safari, that caused the + environment to complain about an "unexpected char" when pasting code + copied from a safari web page. (reported by flight404 many moons + ago, but was causing me trouble today so i fixed it.. ah selfishness) + http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1055381110;start=0 + +- removed the 'cancel' option from "save changes before quitting?" on + windows, since it seems to not always work, causing destruction of + code and sadness. specifically, it ate bijeoma's code: + http://proce55ing.net/discourse/yabb/YaBB.cgi?board=BugFixes;action=display;num=1064865914;start=0 + + +[ additions ] + +- the font builder now sets a default filename when selecting a font, + since axel was annoyed that it didn't have a default. + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + ABOUT REV 0063 - 27 september 2003 revision 63 includes some major new features and semi-major bug fixes, diff --git a/todo.txt b/todo.txt index c1a0d589c..318c28177 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,13 @@ 0064 +X re-enable (bad) thick line code since it was completely shut off +X set default filename for the font +X line 6:1: unexpected char: 0xA0 +X clicking cancel on 'save changes' doesn't cancel, but still quits +X removed the cancel button + + +_ figure out how to cancel 'save changes' on macosx and windows +_ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1064732330;start=0 _ set PATH to include java (!) _ history could be gzipped and appended to history.dat _ along with another file that is actually a table of offsets @@ -11,7 +20,7 @@ _ network/shared_canvas, network/value has old code _ write script to remove .DS_Store and CVS folders from dist _ include version number in the about box _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1064220242 -_ set default filename for the font +_ change run.bat, run-expert.bat to use 128m MEDIUM