mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
fix two amoeba bugs.. System.out/System.err crossed; size() regexp error
This commit is contained in:
@@ -1402,7 +1402,10 @@ public class PdeEditor extends JPanel {
|
||||
|
||||
Pattern pattern = compiler.compile(sizing);
|
||||
|
||||
PatternMatcherInput input = new PatternMatcherInput(program);
|
||||
// adds a space at the beginning, in case size() is the very first
|
||||
// thing in the program (very common), since the regexp needs to check
|
||||
// for things in front of it.
|
||||
PatternMatcherInput input = new PatternMatcherInput(" " + program);
|
||||
if (matcher.contains(input, pattern)) {
|
||||
MatchResult result = matcher.getMatch();
|
||||
try {
|
||||
@@ -1422,12 +1425,7 @@ public class PdeEditor extends JPanel {
|
||||
"Could not find applet size",
|
||||
JOptionPane.WARNING_MESSAGE);
|
||||
}
|
||||
}
|
||||
//} else {
|
||||
// no size() defined, make it default
|
||||
//sizeInfo = "size(" + BApplet.DEFAULT_WIDTH + ", " +
|
||||
//BApplet.DEFAULT_HEIGHT + "); ";
|
||||
//}
|
||||
} // else no size() command found
|
||||
|
||||
} catch (MalformedPatternException e){
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -63,6 +63,32 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
}
|
||||
|
||||
|
||||
class SystemOutSiphon implements Runnable {
|
||||
InputStream input;
|
||||
Thread thread;
|
||||
|
||||
|
||||
public SystemOutSiphon(InputStream input) {
|
||||
this.input = input;
|
||||
|
||||
thread = new Thread(this);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
int c;
|
||||
while ((c = input.read()) != -1) {
|
||||
System.out.print((char) c);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("PdeSystemOutSiphon error " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void start(Point windowLocation, PrintStream leechErr)
|
||||
throws PdeException {
|
||||
|
||||
@@ -90,7 +116,8 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
};
|
||||
|
||||
process = Runtime.getRuntime().exec(command);
|
||||
new PdeMessageSiphon(process.getInputStream(), this);
|
||||
//new PdeMessageSiphon(process.getInputStream(), this);
|
||||
new SystemOutSiphon(process.getInputStream());
|
||||
new PdeMessageSiphon(process.getErrorStream(), this);
|
||||
processOutput = process.getOutputStream();
|
||||
|
||||
|
||||
32
todo.txt
32
todo.txt
@@ -12,6 +12,22 @@ X wrote script to force me to fix them
|
||||
X http://proce55ing.net/discourse/yabb/YaBB.cgi?board=BugFixes;action=display;num=1067135202;start=0
|
||||
X apple has update qtjava for quicktime 6.4, thank god
|
||||
X http://proce55ing.net/discourse/yabb/YaBB.cgi?board=BugFixes;action=display;num=1067135162;start=0
|
||||
X size not properly detected when "size()" was the first thing
|
||||
X http://proce55ing.net/discourse/yabb/YaBB.cgi?board=BugFixes;action=display;num=1067217366;start=0
|
||||
X nasty but where System.out was being piped to System.err
|
||||
X http://proce55ing.net/discourse/yabb/YaBB.cgi?board=BugFixes;action=display;num=1067218548;start=0
|
||||
|
||||
console
|
||||
dh b _ clear console each time 'run' gets hit
|
||||
dh b _ don't actually clear, just advance by the number of lines visible
|
||||
dh b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1051540041;start=0
|
||||
bf b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1065732731
|
||||
dh b _ can't copy text from console directly (winxp and macosx)
|
||||
bf 1 _ console -> should be using JEditTextArea not TextPane
|
||||
bf b _ set decent fonts (probably same as editor above), looks bad on mac
|
||||
bf b _ console runs really really slow with a lot of println() calls
|
||||
bf b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1064182823
|
||||
|
||||
|
||||
_ new html code for eolas patent case
|
||||
_ move html to external file in the lib folder
|
||||
@@ -51,6 +67,10 @@ _ dll and jnilib files have to be in the p5 folder (confirmed by amit)
|
||||
_ there should be other places that they work..
|
||||
_ could even copy the dll to the p5 folder from the code folder
|
||||
|
||||
_ add something to font editor to enable/disable smoothing
|
||||
_ mac -> vlw (or sbit?) font converter
|
||||
_ need to add font metrics code
|
||||
|
||||
|
||||
................
|
||||
|
||||
@@ -181,18 +201,6 @@ dh b _ put screenshots into sketch folder
|
||||
dh b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Syntax;action=display;num=1046185738;start=0
|
||||
|
||||
|
||||
console
|
||||
dh b _ clear console each time 'run' gets hit
|
||||
dh b _ don't actually clear, just advance by the number of lines visible
|
||||
dh b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1051540041;start=0
|
||||
bf b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1065732731
|
||||
dh b _ can't copy text from console directly (winxp and macosx)
|
||||
bf 1 _ console -> should be using JEditTextArea not TextPane
|
||||
bf b _ set decent fonts (probably same as editor above), looks bad on mac
|
||||
bf b _ console runs really really slow with a lot of println() calls
|
||||
bf b _ http://proce55ing.net/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1064182823
|
||||
|
||||
|
||||
history
|
||||
_ history causing trouble - super slow with a huge sketch
|
||||
_ could instead be gzipped and appended to history.dat
|
||||
|
||||
Reference in New Issue
Block a user