|
|
@ -201,6 +201,7 @@ public class JodeWindow |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class AreaOutputStream extends OutputStream { |
|
|
|
public class AreaOutputStream extends OutputStream { |
|
|
|
|
|
|
|
boolean initialized = false; |
|
|
|
private TextArea area; |
|
|
|
private TextArea area; |
|
|
|
|
|
|
|
|
|
|
|
public AreaOutputStream(TextArea a) { |
|
|
|
public AreaOutputStream(TextArea a) { |
|
|
@ -208,6 +209,10 @@ public class JodeWindow |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void write(int b) throws IOException { |
|
|
|
public void write(int b) throws IOException { |
|
|
|
|
|
|
|
if (!initialized) { |
|
|
|
|
|
|
|
area.setText(""); |
|
|
|
|
|
|
|
initialized = true; |
|
|
|
|
|
|
|
} |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|
/// area.appendText(String.valueOf((char)b));
|
|
|
|
/// area.appendText(String.valueOf((char)b));
|
|
|
|
///#else
|
|
|
|
///#else
|
|
|
@ -216,6 +221,10 @@ public class JodeWindow |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void write(byte[] b, int off, int len) throws IOException { |
|
|
|
public void write(byte[] b, int off, int len) throws IOException { |
|
|
|
|
|
|
|
if (!initialized) { |
|
|
|
|
|
|
|
area.setText(""); |
|
|
|
|
|
|
|
initialized = true; |
|
|
|
|
|
|
|
} |
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|
/// area.appendText(new String(b, off, len));
|
|
|
|
/// area.appendText(new String(b, off, len));
|
|
|
|
///#else
|
|
|
|
///#else
|
|
|
@ -255,17 +264,12 @@ public class JodeWindow |
|
|
|
+"and without .class ending"); |
|
|
|
+"and without .class ending"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
imports.init(lastClassName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); |
|
|
|
|
|
|
|
clazzAna.analyze(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sourcecodeArea.setText(""); |
|
|
|
|
|
|
|
TabbedPrintWriter writer = |
|
|
|
TabbedPrintWriter writer = |
|
|
|
new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea) |
|
|
|
new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea) |
|
|
|
, imports); |
|
|
|
, imports); |
|
|
|
imports.dumpHeader(writer); |
|
|
|
ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); |
|
|
|
clazzAna.dumpSource(writer); |
|
|
|
clazzAna.dumpJavaFile(writer); |
|
|
|
|
|
|
|
|
|
|
|
///#ifdef AWT10
|
|
|
|
///#ifdef AWT10
|
|
|
|
/// saveButton.enable();
|
|
|
|
/// saveButton.enable();
|
|
|
|