( int rows, int cols, InputStream cin, OutputStream cout )
| 96 | private int histLine = 0; |
| 97 | |
| 98 | public AWTConsole( int rows, int cols, InputStream cin, OutputStream cout ) { |
| 99 | super(rows, cols); |
| 100 | setFont( new Font("Monospaced",Font.PLAIN,14) ); |
| 101 | setEditable(false); |
| 102 | addKeyListener ( this ); |
| 103 | |
| 104 | outPipe = cout; |
| 105 | if ( outPipe == null ) { |
| 106 | outPipe = new PipedOutputStream(); |
| 107 | try { |
| 108 | in = new PipedInputStream((PipedOutputStream)outPipe); |
| 109 | } catch ( IOException e ) { |
| 110 | print("Console internal error..."); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // start the inpipe watcher |
| 115 | inPipe = cin; |
| 116 | new Thread( this ).start(); |
| 117 | |
| 118 | requestFocus(); |
| 119 | } |
| 120 | |
| 121 | public void keyPressed( KeyEvent e ) { |
| 122 | type( e.getKeyCode(), e.getKeyChar(), e.getModifiers() ); |
nothing calls this directly
no test coverage detected