org.fraid.io.gui
Class DialogOutpStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.fraid.io.gui.DialogOutpStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class DialogOutpStream
extends java.io.OutputStream

A stream which writes to a dialog.


Field Summary
protected  java.lang.StringBuffer mBuffer
           
protected  javax.swing.JDialog mDialog
           
protected  javax.swing.JTextArea mDialogText
           
protected  javax.swing.JButton mDlgClearButton
           
protected  javax.swing.JButton mDlgOKButton
           
protected  boolean mIsIncremental
           
protected  boolean mIsPanelVisible
           
 int mMaxSize
          The maximum size of the buffer, when exceeded the first 20% are deleted.
protected  javax.swing.JPanel mStreamPanel
           
protected  javax.swing.JScrollPane mTextScroller
           
protected  java.lang.String mTitle
           
 
Constructor Summary
DialogOutpStream(java.lang.String aTitle, boolean aIsIncremental, boolean aShowButtons)
          Creates a new DialogOutpStream instance.
 
Method Summary
 void close()
          The close method of the stream.
 void flush()
          The flush method of the stream.
 javax.swing.JPanel getPanel()
           
 javax.swing.JScrollPane getScrollPane()
           
 javax.swing.JTextArea getTextArea()
          Returns the current text area.
 void showDialog()
          Shows the dialog if it is invisible.
 void write(int c)
          The write method of the stream.
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mStreamPanel

protected javax.swing.JPanel mStreamPanel

mBuffer

protected java.lang.StringBuffer mBuffer

mDlgOKButton

protected javax.swing.JButton mDlgOKButton

mDlgClearButton

protected javax.swing.JButton mDlgClearButton

mDialogText

protected javax.swing.JTextArea mDialogText

mDialog

protected javax.swing.JDialog mDialog

mIsIncremental

protected boolean mIsIncremental

mIsPanelVisible

protected boolean mIsPanelVisible

mTitle

protected java.lang.String mTitle

mTextScroller

protected javax.swing.JScrollPane mTextScroller

mMaxSize

public int mMaxSize
The maximum size of the buffer, when exceeded the first 20% are deleted.

Constructor Detail

DialogOutpStream

public DialogOutpStream(java.lang.String aTitle,
                        boolean aIsIncremental,
                        boolean aShowButtons)
Creates a new DialogOutpStream instance.

Parameters:
aTitle - a String value
aIsIncremental - true for info stream, false for err.
Method Detail

getTextArea

public javax.swing.JTextArea getTextArea()
Returns the current text area.

Returns:
a JTextArea value

getScrollPane

public javax.swing.JScrollPane getScrollPane()

getPanel

public javax.swing.JPanel getPanel()

showDialog

public void showDialog()
Shows the dialog if it is invisible. Used constantly by err.


write

public void write(int c)
The write method of the stream.

Specified by:
write in class java.io.OutputStream
Parameters:
c - an int value

close

public void close()
The close method of the stream. Doesn't do anything.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream

flush

public void flush()
The flush method of the stream.

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream


Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.