org.openbp.swing.components
Class JConsole.GUIMappedInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.openbp.swing.components.JConsole.GUIMappedInputStream
All Implemented Interfaces:
java.awt.event.KeyListener, java.io.Closeable, java.util.EventListener
Enclosing class:
JConsole

protected class JConsole.GUIMappedInputStream
extends java.io.InputStream
implements java.awt.event.KeyListener

This output stream reads all input data from a component. All KeyEvents will put in a stream and can be used as standard input stream.


Constructor Summary
JConsole.GUIMappedInputStream()
          Constructor.
 
Method Summary
 int available()
          Returns the number of bytes available.
 void keyPressed(java.awt.event.KeyEvent e)
          Invoked when a key has been pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          Invoked when a key has been released.
 void keyTyped(java.awt.event.KeyEvent e)
          Invoked when a key has been typed.
 boolean markSupported()
          Always returns false.
 int read()
          Reads a byte from the stream.
 
Methods inherited from class java.io.InputStream
close, mark, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JConsole.GUIMappedInputStream

public JConsole.GUIMappedInputStream()
Constructor.

Method Detail

available

public int available()
Returns the number of bytes available.

Overrides:
available in class java.io.InputStream

markSupported

public boolean markSupported()
Always returns false.

Overrides:
markSupported in class java.io.InputStream

read

public int read()
         throws java.io.IOException
Reads a byte from the stream. This InputStream is a blocking stream - so you have to wait until the user has pressed a key.

Specified by:
read in class java.io.InputStream
Returns:
The next byte
Throws:
java.io.IOException - Never

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. This event occurs when a key press is followed by a key release. Implementation of KeyListener.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. Implementation of KeyListener. Puts the pressed key into the input queue.

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released. Implementation of KeyListener.

Specified by:
keyReleased in interface java.awt.event.KeyListener


Copyright © 2011. All Rights Reserved.