bsh.util

Class JConsole

Implemented Interfaces:
ActionListener, ConsoleInterface, GUIConsoleInterface, KeyListener, MouseListener, PropertyChangeListener, Runnable

public class JConsole
extends JScrollPane
implements GUIConsoleInterface, Runnable, KeyListener, MouseListener, ActionListener, PropertyChangeListener

A JFC/Swing based console for the BeanShell desktop. This is a descendant of the old AWTConsole. Improvements by: Mark Donszelmann <Mark.Donszelmann@cern.ch> including Cut & Paste Improvements by: Daniel Leuck including Color and Image support, key press bug workaround

Nested Class Summary

static class
JConsole.BlockingPipedInputStream
The overridden read method in this class will not throw "Broken pipe" IOExceptions; It will simply wait for new writers and data.

Constructor Summary

JConsole()
JConsole(InputStream cin, OutputStream cout)

Method Summary

void
actionPerformed(ActionEvent event)
void
error(String s)
PrintStream
getErr()
Reader
getIn()
InputStream
getInputStream()
PrintStream
getOut()
AttributeSet
getStyle()
void
keyPressed(KeyEvent e)
void
keyReleased(KeyEvent e)
void
keyTyped(KeyEvent e)
void
mouseClicked(MouseEvent event)
void
mouseEntered(MouseEvent event)
void
mouseExited(MouseEvent event)
void
mousePressed(MouseEvent event)
void
mouseReleased(MouseEvent event)
void
print(Icon icon)
void
print(Object object)
Prints the primitive type "float" (needed because of float->double coercion weirdness) public void println(float f) { println(String.valueOf(f)); }
void
print(Object s, Color color)
void
print(Object s, Font font)
Prints the primitive type "float" (needed because of float->double coercion weirdness) public void print(float f) { print(String.valueOf(f)); }
void
print(Object s, Font font, Color color)
void
print(Object s, String fontFamilyName, int size, Color color)
void
print(Object s, String fontFamilyName, int size, Color color, boolean bold, boolean italic, boolean underline)
void
print(String string)
void
print(String s, Color color)
void
println()
Prints "\\n" (i.e.
void
println(Icon icon)
void
println(Object object)
void
println(String string)
void
propertyChange(PropertyChangeEvent event)
void
requestFocus()
void
run()
void
setFont(Font font)
void
setNameCompletion(NameCompletion nc)
void
setStyle(AttributeSet attributes)
void
setStyle(AttributeSet attributes, boolean overWrite)
AttributeSet
setStyle(Color color)
AttributeSet
setStyle(Font font)
AttributeSet
setStyle(Font font, Color color)
AttributeSet
setStyle(String fontFamilyName, int size, Color color)
AttributeSet
setStyle(String fontFamilyName, int size, Color color, boolean bold, boolean italic, boolean underline)
void
setWaitFeedback(boolean on)
e.g.
String
toString()

Constructor Details

JConsole

public JConsole()


JConsole

public JConsole(InputStream cin,
                OutputStream cout)

Method Details

actionPerformed

public void actionPerformed(ActionEvent event)


error

public void error(String s)
Specified by:
error in interface ConsoleInterface


getErr

public PrintStream getErr()
Specified by:
getErr in interface ConsoleInterface


getIn

public Reader getIn()
Specified by:
getIn in interface ConsoleInterface


getInputStream

public InputStream getInputStream()


getOut

public PrintStream getOut()
Specified by:
getOut in interface ConsoleInterface


getStyle

public AttributeSet getStyle()


keyPressed

public void keyPressed(KeyEvent e)


keyReleased

public void keyReleased(KeyEvent e)


keyTyped

public void keyTyped(KeyEvent e)


mouseClicked

public void mouseClicked(MouseEvent event)


mouseEntered

public void mouseEntered(MouseEvent event)


mouseExited

public void mouseExited(MouseEvent event)


mousePressed

public void mousePressed(MouseEvent event)


mouseReleased

public void mouseReleased(MouseEvent event)


print

public void print(Icon icon)


print

public void print(Object object)
Prints the primitive type "float" (needed because of float->double coercion weirdness) public void println(float f) { println(String.valueOf(f)); }


print

public void print(Object s,
                  Color color)


print

public void print(Object s,
                  Font font)
Prints the primitive type "float" (needed because of float->double coercion weirdness) public void print(float f) { print(String.valueOf(f)); }


print

public void print(Object s,
                  Font font,
                  Color color)


print

public void print(Object s,
                  String fontFamilyName,
                  int size,
                  Color color)


print

public void print(Object s,
                  String fontFamilyName,
                  int size,
                  Color color,
                  boolean bold,
                  boolean italic,
                  boolean underline)


print

public void print(String string)
Specified by:
print in interface ConsoleInterface


print

public void print(String s,
                  Color color)
Specified by:
print in interface GUIConsoleInterface


println

public void println()
Prints "\\n" (i.e. newline)


println

public void println(Icon icon)


println

public void println(Object object)


println

public void println(String string)
Specified by:
println in interface ConsoleInterface


propertyChange

public void propertyChange(PropertyChangeEvent event)


requestFocus

public void requestFocus()


run

public void run()


setFont

public void setFont(Font font)


setNameCompletion

public void setNameCompletion(NameCompletion nc)
Specified by:
setNameCompletion in interface GUIConsoleInterface


setStyle

public void setStyle(AttributeSet attributes)


setStyle

public void setStyle(AttributeSet attributes,
                     boolean overWrite)


setStyle

public AttributeSet setStyle(Color color)


setStyle

public AttributeSet setStyle(Font font)


setStyle

public AttributeSet setStyle(Font font,
                             Color color)


setStyle

public AttributeSet setStyle(String fontFamilyName,
                             int size,
                             Color color)


setStyle

public AttributeSet setStyle(String fontFamilyName,
                             int size,
                             Color color,
                             boolean bold,
                             boolean italic,
                             boolean underline)


setWaitFeedback

public void setWaitFeedback(boolean on)
e.g. the wait cursor
Specified by:
setWaitFeedback in interface GUIConsoleInterface


toString

public String toString()


B) 2000 pat@pat.net :-)