From 28a90a13fb561c131d7a9229d100e7a19f5bdf5a Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 5 May 1999 20:47:41 +0000 Subject: [PATCH] use clazzAna.dumpJavaFile git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@757 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/JodeWindow.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/jode/jode/JodeWindow.java b/jode/jode/JodeWindow.java index 197a026..a2434c3 100644 --- a/jode/jode/JodeWindow.java +++ b/jode/jode/JodeWindow.java @@ -200,7 +200,8 @@ public class JodeWindow } } - public class AreaOutputStream extends OutputStream { + public class AreaOutputStream extends OutputStream { + boolean initialized = false; private TextArea area; public AreaOutputStream(TextArea a) { @@ -208,6 +209,10 @@ public class JodeWindow } public void write(int b) throws IOException { + if (!initialized) { + area.setText(""); + initialized = true; + } ///#ifdef AWT10 /// area.appendText(String.valueOf((char)b)); ///#else @@ -216,6 +221,10 @@ public class JodeWindow } public void write(byte[] b, int off, int len) throws IOException { + if (!initialized) { + area.setText(""); + initialized = true; + } ///#ifdef AWT10 /// area.appendText(new String(b, off, len)); ///#else @@ -255,17 +264,12 @@ public class JodeWindow +"and without .class ending"); return; } - imports.init(lastClassName); - ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); - clazzAna.analyze(); - - sourcecodeArea.setText(""); TabbedPrintWriter writer = new TabbedPrintWriter(new AreaOutputStream(sourcecodeArea) , imports); - imports.dumpHeader(writer); - clazzAna.dumpSource(writer); + ClassAnalyzer clazzAna = new ClassAnalyzer(null, clazz, imports); + clazzAna.dumpJavaFile(writer); ///#ifdef AWT10 /// saveButton.enable();