TelnetD at SF

net.wimpi.telnetd.io
Interface BasicTerminalIO

All Known Implementing Classes:
TerminalIO

public interface BasicTerminalIO

Interface that represents the supported * terminal oriented low-level I/O capabilities. * * @author Dieter Wimberger * @version 2.0 (14/03/2005)


Field Summary
static int BACKSPACE
          Backspace (defining the backspace key)
static int BLACK
          Black
static int BLUE
          Blue
static int COLORINIT
          Color init (defining ctrl-a atm)
static java.lang.String CRLF
          CRLF (defining carriage+linebreak which is obligation)
static int CYAN
          Cyan
static int DELETE
          Delete (defining the del key)
static int DOWN
          Right (defining a direction on the terminal)
static int ENTER
          Enter (defining the return or enter key)
static int GREEN
          Green
static int LEFT
          Down (defining a direction on the terminal)
static int LOGOUTREQUEST
          Logout request (defining ctrl-d atm)
static int MAGENTA
          Magenta
static int RED
          Red
static int RIGHT
          Up (defining a direction on the terminal)
static int TABULATOR
          Tabulator (defining the tab key)
static int UP
          Left (defining a direction on the terminal)
static int WHITE
          White
static int YELLOW
          Yellow
 
Method Summary
 void bell()
          Method that sends a signal to the user.
 void close()
          Closes this BasicTerminalIO.
 boolean defineScrollRegion(int topmargin, int bottommargin)
          Allows to define a scroll region
 void eraseLine()
          Method that erases the entire actual line.
 void eraseScreen()
          Method that erases the entire screen
 void eraseToBeginOfLine()
          Method that erases in the actual line * from the actual cursor position to the beginning of the line.
 void eraseToBeginOfScreen()
          Method that erases in the terminal screen * from the actual cursor postition to the beginning of the screen.
 void eraseToEndOfLine()
          Method that erases in the line from the actual cursor position * to the end of the line.
 void eraseToEndOfScreen()
          Method that erases in the terminal screen * from the actual cursor position to the end of the screen.
 void flush()
          Method that ensures all written bytes to be send over the * network.
 void forceBold(boolean b)
          Method that forces bold as attribute for writing on the terminal
 int getColumns()
          Method to retrieve the actual columns on the clients temrinal * screen
 int getRows()
          Method to retrieve the actual rows on the clients terminal * screen
 void homeCursor()
          Method that places the cursor at "home", which is defining * first Row,first Column
 boolean isAutoflushing()
          Accessor method for the autoflushing mechanism
 boolean isLineWrapping()
          Tests if terminal is in linewrapping mode
 boolean isSignalling()
          Accessor method for checking signalling attribute
 void moveCursor(int direction, int times)
          Method that moves the cursor relative from the actual * position given times into a given direction
 void moveDown(int times)
          Convenience method to move the cursor down
 void moveLeft(int times)
          Convenience method to move cursor to the left
 void moveRight(int times)
          Convenience method to move cursor to the right
 void moveUp(int times)
          Convenience method to move the cursor up
 int read()
          Method that retrieves Input from the underlying * Stream, translating Terminal specific escape * sequences and returning a (constant defined) key, * or a character
 void resetAttributes()
          Method that resets all graphic rendition attributes for writing on the * terminal.
 void resetTerminal()
          Resets the terminal device.
 void restoreCursor()
          Method that restores the last Cursor position, either client-side, * or if not possible server-side
 void setAutoflushing(boolean b)
          Mutator method for the autoflushing mechanism
 void setBackgroundColor(int color)
          Method that sets the background color for writing on the terminal
 void setBlink(boolean b)
          Method that sets blink attribute for writing on the terminal
 void setBold(boolean b)
          Method that sets bold as attribute for writing on the terminal
 void setCursor(int row, int col)
          Method that places the cursor on the terminal * on the given absolute position
 void setDefaultTerminal()
          Sets the default terminal
 void setForegroundColor(int color)
          Method that sets the foreground color for writing to the terminal
 void setItalic(boolean b)
          Method that sets italic as attribute for writing on the terminal
 void setLinewrapping(boolean b)
          Sets the linewrapping mode
 void setSignalling(boolean b)
          Mutator method for the signalling attribute
 void setTerminal(java.lang.String terminalname)
          Sets the terminal to be used for this BasicTerminalIO
 void setUnderlined(boolean b)
          Method that sets underlined as attribute for writing on the terminal
 void storeCursor()
          Method that stores the actual Cursor position, either client-side, * or if not possible server-side
 void write(byte b)
          Method that writes a raw byte to the terminal
 void write(char ch)
          Method that writes a character to the terminal
 void write(java.lang.String str)
          Method that writes a String to the terminal, * * @param str String that should be written to the terminal.
 

Field Detail

UP

public static final int UP
Left (defining a direction on the terminal)

See Also:
Constant Field Values

DOWN

public static final int DOWN
Right (defining a direction on the terminal)

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Up (defining a direction on the terminal)

See Also:
Constant Field Values

LEFT

public static final int LEFT
Down (defining a direction on the terminal)

See Also:
Constant Field Values

TABULATOR

public static final int TABULATOR
Tabulator (defining the tab key)

See Also:
Constant Field Values

DELETE

public static final int DELETE
Delete (defining the del key)

See Also:
Constant Field Values

BACKSPACE

public static final int BACKSPACE
Backspace (defining the backspace key)

See Also:
Constant Field Values

ENTER

public static final int ENTER
Enter (defining the return or enter key)

See Also:
Constant Field Values

COLORINIT

public static final int COLORINIT
Color init (defining ctrl-a atm)

See Also:
Constant Field Values

LOGOUTREQUEST

public static final int LOGOUTREQUEST
Logout request (defining ctrl-d atm)

See Also:
Constant Field Values

BLACK

public static final int BLACK
Black

See Also:
Constant Field Values

RED

public static final int RED
Red

See Also:
Constant Field Values

GREEN

public static final int GREEN
Green

See Also:
Constant Field Values

YELLOW

public static final int YELLOW
Yellow

See Also:
Constant Field Values

BLUE

public static final int BLUE
Blue

See Also:
Constant Field Values

MAGENTA

public static final int MAGENTA
Magenta

See Also:
Constant Field Values

CYAN

public static final int CYAN
Cyan

See Also:
Constant Field Values

WHITE

public static final int WHITE
White

See Also:
Constant Field Values

CRLF

public static final java.lang.String CRLF
CRLF (defining carriage+linebreak which is obligation)

See Also:
Constant Field Values
Method Detail

read

public int read()
         throws java.io.IOException
Method that retrieves Input from the underlying * Stream, translating Terminal specific escape * sequences and returning a (constant defined) key, * or a character. * * @return int that represents a constant defined key.

Throws:
java.io.IOException

write

public void write(byte b)
           throws java.io.IOException
Method that writes a raw byte to the terminal. * @param b a byte value to be written.

Throws:
java.io.IOException

write

public void write(char ch)
           throws java.io.IOException
Method that writes a character to the terminal. * * @param ch Character that should be written on the screen

Throws:
java.io.IOException

write

public void write(java.lang.String str)
           throws java.io.IOException
Method that writes a String to the terminal, * * @param str String that should be written to the terminal.

Throws:
java.io.IOException

setCursor

public void setCursor(int row,
                      int col)
               throws java.io.IOException
Method that places the cursor on the terminal * on the given absolute position. * * @param row Integer that represents the desired row coord. * @param col Integer that represents the desired column coord.

Throws:
java.io.IOException

moveCursor

public void moveCursor(int direction,
                       int times)
                throws java.io.IOException
Method that moves the cursor relative from the actual * position given times into a given direction. * * @param direction Constant defined integer. * @param times Integer that represents the desired column coord.

Throws:
java.io.IOException

moveRight

public void moveRight(int times)
               throws java.io.IOException
Convenience method to move cursor to the right. * Wraps moveCursor method. * * @param times Integer that represents the times the cursor should be moved. * @see BasicTerminalIO#moveCursor

Throws:
java.io.IOException

moveLeft

public void moveLeft(int times)
              throws java.io.IOException
Convenience method to move cursor to the left. * Wraps moveCursor method. * * @param times Integer that represents the times the cursor should be moved. * @see BasicTerminalIO#moveCursor

Throws:
java.io.IOException

moveUp

public void moveUp(int times)
            throws java.io.IOException
Convenience method to move the cursor up. * Wraps moveCursor method. * * @param times Integer that represents the times the cursor should be moved. * @see BasicTerminalIO#moveCursor

Throws:
java.io.IOException

moveDown

public void moveDown(int times)
              throws java.io.IOException
Convenience method to move the cursor down. * Wraps moveCursor method. * * @param times Integer that represents the times the cursor should be moved. * @see BasicTerminalIO#moveCursor

Throws:
java.io.IOException

homeCursor

public void homeCursor()
                throws java.io.IOException
Method that places the cursor at "home", which is defining * first Row,first Column. * Note that it might be wrapping moveCursor, or be a specific * Escape Sequence.

Throws:
java.io.IOException

storeCursor

public void storeCursor()
                 throws java.io.IOException
Method that stores the actual Cursor position, either client-side, * or if not possible server-side. * Note: *

Throws:
java.io.IOException

restoreCursor

public void restoreCursor()
                   throws java.io.IOException
Method that restores the last Cursor position, either client-side, * or if not possible server-side. * Note: *

Throws:
java.io.IOException

eraseToEndOfLine

public void eraseToEndOfLine()
                      throws java.io.IOException
Method that erases in the line from the actual cursor position * to the end of the line.

Throws:
java.io.IOException

eraseToBeginOfLine

public void eraseToBeginOfLine()
                        throws java.io.IOException
Method that erases in the actual line * from the actual cursor position to the beginning of the line.

Throws:
java.io.IOException

eraseLine

public void eraseLine()
               throws java.io.IOException
Method that erases the entire actual line.

Throws:
java.io.IOException

eraseToEndOfScreen

public void eraseToEndOfScreen()
                        throws java.io.IOException
Method that erases in the terminal screen * from the actual cursor position to the end of the screen.

Throws:
java.io.IOException

eraseToBeginOfScreen

public void eraseToBeginOfScreen()
                          throws java.io.IOException
Method that erases in the terminal screen * from the actual cursor postition to the beginning of the screen.

Throws:
java.io.IOException

eraseScreen

public void eraseScreen()
                 throws java.io.IOException
Method that erases the entire screen. * Note: *

Throws:
java.io.IOException

setForegroundColor

public void setForegroundColor(int color)
                        throws java.io.IOException
Method that sets the foreground color for writing to the terminal. * * @param color Integer that represents one of the constant defined colors.

Throws:
java.io.IOException

setBackgroundColor

public void setBackgroundColor(int color)
                        throws java.io.IOException
Method that sets the background color for writing on the terminal. * * @param color Integer that represents one of the constant defined colors.

Throws:
java.io.IOException

setBold

public void setBold(boolean b)
             throws java.io.IOException
Method that sets bold as attribute for writing on the terminal. * The final representation on the terminal might differ by the * terminal type. Most likely it will be represented by extra bright characters. * * @param b Boolean that flags on/off

Throws:
java.io.IOException

forceBold

public void forceBold(boolean b)
Method that forces bold as attribute for writing on the terminal. * The final representation on the terminal might differ by the * terminal type. Most likely it will be represented by extra bright characters. *

* This will not be affected by an attribute reset, and will be transmitted * more effectively for mixed style output. * * @param b Boolean that flags on/off


setItalic

public void setItalic(boolean b)
               throws java.io.IOException
Method that sets italic as attribute for writing on the terminal. * The final representation on the terminal might differ by the * terminal type. * * @param b Boolean that flags on/off

Throws:
java.io.IOException

setUnderlined

public void setUnderlined(boolean b)
                   throws java.io.IOException
Method that sets underlined as attribute for writing on the terminal. * The final representation on the terminal might differ by the * terminal type. * * @param b Boolean that flags on/off

Throws:
java.io.IOException

setBlink

public void setBlink(boolean b)
              throws java.io.IOException
Method that sets blink attribute for writing on the terminal. * The final representation on the terminal might differ by the * terminal type. * * @param b Boolean that flags on/off

Throws:
java.io.IOException

resetAttributes

public void resetAttributes()
                     throws java.io.IOException
Method that resets all graphic rendition attributes for writing on the * terminal.

* Note:
* This will affect all attributes. Although these selective resets are defined * in ECMA 048 (the successor of the ANSI X3.64 standard) they are obviously not * implemented for all attributes in standard terminal emulations. *

Throws:
java.io.IOException

bell

public void bell()
          throws java.io.IOException
Method that sends a signal to the user. This is defined for * ANY NVT which is part of the internet protocol standard. * The effect on the terminal might differ by the terminal type or * telnet client/terminal emulator implementation.

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Method that ensures all written bytes to be send over the * network. If autoflushing is off, this will be necessary to * flush buffered data already written.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes this BasicTerminalIO.

Throws:
java.io.IOException

setTerminal

public void setTerminal(java.lang.String terminalname)
                 throws java.io.IOException
Sets the terminal to be used for this BasicTerminalIO. * * @param terminalname the name of the terminal. * @see net.wimpi.telnetd.io.terminal.TerminalManager

Throws:
java.io.IOException

setDefaultTerminal

public void setDefaultTerminal()
                        throws java.io.IOException
Sets the default terminal. * * @see net.wimpi.telnetd.io.terminal.TerminalManager

Throws:
java.io.IOException

getRows

public int getRows()
Method to retrieve the actual rows on the clients terminal * screen. * * @return int that represents the number of rows.


getColumns

public int getColumns()
Method to retrieve the actual columns on the clients temrinal * screen. * * @return int that represents the number of columns.


setSignalling

public void setSignalling(boolean b)
Mutator method for the signalling attribute. * * @param b Boolean that flags on(true) or off(false)


isSignalling

public boolean isSignalling()
Accessor method for checking signalling attribute. * * @return Boolean that represents if signalling is either * turned on(true) or off(false).


setAutoflushing

public void setAutoflushing(boolean b)
Mutator method for the autoflushing mechanism. * * @param b Boolean that flags on(true) or off(false)


isAutoflushing

public boolean isAutoflushing()
Accessor method for the autoflushing mechanism. * * @return Boolean that represents if autoflushing is either * turned on(true) or off(false).


resetTerminal

public void resetTerminal()
                   throws java.io.IOException
Resets the terminal device.

Throws:
java.io.IOException

setLinewrapping

public void setLinewrapping(boolean b)
                     throws java.io.IOException
Sets the linewrapping mode. * * @param b true if linewrapping on, false otherwise.

Throws:
java.io.IOException

isLineWrapping

public boolean isLineWrapping()
                       throws java.io.IOException
Tests if terminal is in linewrapping mode. * * @return true if linewrapping, false otherwise.

Throws:
java.io.IOException

defineScrollRegion

public boolean defineScrollRegion(int topmargin,
                                  int bottommargin)
                           throws java.io.IOException
Allows to define a scroll region. * EXPERIMENTAL * * @param topmargin the top margin in rows. * @param bottommargin the bottom margin in rows. * @return true if scrolling supported, false otherwise. * @throws IOException if an I/O error occurs.

Throws:
java.io.IOException

TelnetD at SF

Copyright © 2000-2005 Dieter Wimberger.