cleaning up bugs and making more

This commit is contained in:
benfry
2004-05-16 20:54:32 +00:00
parent 8f2db4862a
commit 332a675641
3 changed files with 40 additions and 14 deletions

View File

@@ -97,6 +97,8 @@ public class PdeEditorConsole extends JScrollPane {
// add the jtextpane to this scrollpane
this.setViewportView(consoleTextPane);
System.out.println("BLRHUHG");
// calculate height of a line of text in pixels
// and size window accordingly
FontMetrics metrics = this.getFontMetrics(font);
@@ -106,6 +108,8 @@ public class PdeEditorConsole extends JScrollPane {
setPreferredSize(new Dimension(1024, (height * lines) + sizeFudge));
setMinimumSize(new Dimension(1024, (height * 4) + sizeFudge));
System.out.println("BLRHUHG 2");
if (systemOut == null) {
systemOut = System.out;
systemErr = System.err;
@@ -126,22 +130,35 @@ public class PdeEditorConsole extends JScrollPane {
"files used to store the console output.", e);
}
System.out.println("BLRHUHG 2b ");
consoleOut =
new PrintStream(new PdeEditorConsoleStream(this, false, stdoutFile));
System.out.println("BLRHUHG 2c " + consoleOut);
consoleErr =
new PrintStream(new PdeEditorConsoleStream(this, true, stderrFile));
System.out.println("BLRHUHG 2d " + consoleErr);
if (PdePreferences.getBoolean("console")) {
System.setOut(consoleOut);
System.setErr(consoleErr);
System.out.println("BLRHUHG 2e " + consoleOut);
try {
System.setOut(consoleOut);
System.out.println("BLRHUHG 2f " + consoleErr);
System.setErr(consoleErr);
System.out.println("BLRHUHG 2g " + consoleErr);
} catch (Exception e) {
e.printStackTrace();
}
}
}
System.out.println("BLRHUHG 3");
// to fix ugliness.. normally macosx java 1.3 puts an
// ugly white border around this object, so turn it off.
if (PdeBase.platform == PdeBase.MACOSX) {
setBorder(null);
}
System.out.println("BLRHUHG 4");
}
@@ -194,6 +211,8 @@ public class PdeEditorConsole extends JScrollPane {
private void appendText(String text, boolean err) {
if (true) return;
try {
// check how many lines have been used so far
// if too many, shave off a few lines from the beginning
@@ -203,6 +222,7 @@ public class PdeEditorConsole extends JScrollPane {
if (overage > 0) {
// if 1200 lines, and 1000 lines is max,
// find the position of the end of the 200th line
System.out.println("overage is " + overage);
Element lineElement = element.getElement(overage);
int endOffset = lineElement.getEndOffset();
// remove to the end of the 200th line