+ }
+ while (Thread.currentThread() == textAppender)
+ {
+ if (updateConsole)
+ {
+ // check string buffer - if greater than console, clear console and
+ // replace with last segment of content, otherwise, append all to
+ // content.
+ long count;
+ while (displayPipe.length() > 0)
+ {
+ count = 0;
+ StringBuffer tmp = new StringBuffer(), replace;
+ synchronized (displayPipe)
+ {
+ replace = displayPipe;
+ displayPipe = tmp;
+ }
+ // simply append whole buffer
+ textArea.append(replace.toString());
+ count += replace.length();
+ if (count > byteslim)
+ {
+ trimBuffer(false);
+ }
+ }
+ if (displayPipe.length() == 0)
+ {
+ try
+ {
+ this.wait(100);
+ if (displayPipe.length() == 0)
+ {
+ trimBuffer(false);
+ }
+ } catch (InterruptedException e)
+ {
+ }
+ ;
+ }
+ }
+ else
+ {
+ try
+ {
+ this.wait(100);
+ } catch (InterruptedException e)
+ {
+
+ }
+ }
+ if (quit)
+ {
+ return;
+ }
+