|
|
@ -143,7 +143,7 @@ public class JodeWindow |
|
|
|
startButton.addActionListener(this); |
|
|
|
startButton.addActionListener(this); |
|
|
|
saveButton.addActionListener(this); |
|
|
|
saveButton.addActionListener(this); |
|
|
|
///#endif
|
|
|
|
///#endif
|
|
|
|
GlobalOptions.err = new PrintStream(new AreaOutputStream(errorArea)); |
|
|
|
GlobalOptions.err = new PrintWriter(new AreaWriter(errorArea)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setClasspath(String cp) { |
|
|
|
public void setClasspath(String cp) { |
|
|
@ -200,36 +200,30 @@ public class JodeWindow |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class AreaOutputStream extends OutputStream { |
|
|
|
public class AreaWriter extends Writer { |
|
|
|
boolean initialized = false; |
|
|
|
boolean initialized = false; |
|
|
|
private TextArea area; |
|
|
|
private TextArea area; |
|
|
|
|
|
|
|
|
|
|
|
public AreaOutputStream(TextArea a) { |
|
|
|
public AreaWriter(TextArea a) { |
|
|
|
area = a; |
|
|
|
area = a; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void write(int b) throws IOException { |
|
|
|
public void write(char[] b, int off, int len) throws IOException { |
|
|
|
if (!initialized) { |
|
|
|
if (!initialized) { |
|
|
|
area.setText(""); |
|
|
|
area.setText(""); |
|
|
|
initialized = true; |
|
|
|
initialized = true; |
|
|
|
} |
|
|
|
} |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|
/// area.appendText(String.valueOf((char)b));
|
|
|
|
/// area.appendText(new String(b, off, len));
|
|
|
|
///#else
|
|
|
|
///#else
|
|
|
|
area.append(String.valueOf((char)b)); |
|
|
|
area.append(new String(b, off, len)); |
|
|
|
///#endif
|
|
|
|
///#endif
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void write(byte[] b, int off, int len) throws IOException { |
|
|
|
public void flush() { |
|
|
|
if (!initialized) { |
|
|
|
|
|
|
|
area.setText(""); |
|
|
|
|
|
|
|
initialized = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
///#ifdef AWT10
|
|
|
|
|
|
|
|
/// area.appendText(new String(b, off, len));
|
|
|
|
public void close() { |
|
|
|
///#else
|
|
|
|
|
|
|
|
area.append(new String(b, off, len)); |
|
|
|
|
|
|
|
///#endif
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -266,8 +260,7 @@ public class JodeWindow |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TabbedPrintWriter writer = |
|
|
|
TabbedPrintWriter writer = |
|
|
|
new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea) |
|
|
|
new TabbedPrintWriter(new AreaWriter(sourcecodeArea), imports); |
|
|
|
, imports); |
|
|
|
|
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); |
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); |
|
|
|
clazzAna.dumpJavaFile(writer); |
|
|
|
clazzAna.dumpJavaFile(writer); |
|
|
|
|
|
|
|
|
|
|
|