com.grahamedgecombe.jterminal.vt100
Class Vt100TerminalModel

java.lang.Object
  extended by com.grahamedgecombe.jterminal.AbstractTerminalModel
      extended by com.grahamedgecombe.jterminal.vt100.Vt100TerminalModel
All Implemented Interfaces:
TerminalModel

public class Vt100TerminalModel
extends AbstractTerminalModel

A VT100/ANSI-compatible terminal model.

Author:
Graham Edgecombe

Constructor Summary
Vt100TerminalModel()
          Creates the terminal model with the default number of columns and rows, and the default buffer size.
Vt100TerminalModel(int columns, int rows)
          Creates the terminal model with the specified number of columns and rows.
Vt100TerminalModel(int columns, int rows, int bufferSize)
          Creates the terminal model with the specified number of columns and rows and the specified buffer size.
 
Method Summary
 BellStrategy getBellStrategy()
          Gets the bell strategy.
 int getBufferSize()
          Gets the buffer size.
 TerminalCell getCell(int column, int row)
          Gets a cell.
 int getColumns()
          Gets the number of columns.
 int getCursorColumn()
          Gets the cursor column.
 int getCursorRow()
          Gets the cursor row.
 java.awt.Color getDefaultBackgroundColor()
          Gets the default background color.
 java.awt.Color getDefaultForegroundColor()
          Gets the default foreground color.
 int getRows()
          Gets the number of rows.
 void print(java.lang.String str)
          Prints the specified string to the terminal at the cursor position, interpreting any escape sequences/special ASCII codes the model may support.
 void setBellStrategy(BellStrategy strategy)
          Sets the bell strategy.
 void setCell(int column, int row, TerminalCell cell)
          Sets a cell.
 void setCursorColumn(int column)
          Sets the cursor column.
 void setCursorRow(int row)
          Sets the cursor row.
 
Methods inherited from class com.grahamedgecombe.jterminal.AbstractTerminalModel
clear, moveCursorBack, moveCursorDown, moveCursorForward, moveCursorUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vt100TerminalModel

public Vt100TerminalModel()
Creates the terminal model with the default number of columns and rows, and the default buffer size.


Vt100TerminalModel

public Vt100TerminalModel(int columns,
                          int rows)
Creates the terminal model with the specified number of columns and rows. The buffer size is set to the number of rows.

Parameters:
columns - The number of columns.
rows - The number of rows.
Throws:
java.lang.IllegalArgumentException - if the number of rows or columns is negative.

Vt100TerminalModel

public Vt100TerminalModel(int columns,
                          int rows,
                          int bufferSize)
Creates the terminal model with the specified number of columns and rows and the specified buffer size.

Parameters:
columns - The number of columns.
rows - The number of rows.
bufferSize - The buffer size.
Throws:
java.lang.IllegalArgumentException - if the number of rows or columns is negative, or if the buffer size is less than the number of rows.
Method Detail

getCursorRow

public int getCursorRow()
Description copied from interface: TerminalModel
Gets the cursor row.

Returns:
The cursor row.

setCursorRow

public void setCursorRow(int row)
Description copied from interface: TerminalModel
Sets the cursor row.

Parameters:
row - The cursor row.

getCursorColumn

public int getCursorColumn()
Description copied from interface: TerminalModel
Gets the cursor column.

Returns:
The cursor column.

setCursorColumn

public void setCursorColumn(int column)
Description copied from interface: TerminalModel
Sets the cursor column.

Parameters:
column - The cursor column.

getCell

public TerminalCell getCell(int column,
                            int row)
Description copied from interface: TerminalModel
Gets a cell.

Parameters:
column - The column.
row - The row.
Returns:
The cell.

setCell

public void setCell(int column,
                    int row,
                    TerminalCell cell)
Description copied from interface: TerminalModel
Sets a cell.

Parameters:
column - The column.
row - The row.
cell - The cell.

print

public void print(java.lang.String str)
Description copied from interface: TerminalModel
Prints the specified string to the terminal at the cursor position, interpreting any escape sequences/special ASCII codes the model may support. Lines will be wrapped if necessary.

Parameters:
str - The string to print.

getColumns

public int getColumns()
Description copied from interface: TerminalModel
Gets the number of columns.

Returns:
The number of columns.

getRows

public int getRows()
Description copied from interface: TerminalModel
Gets the number of rows.

Returns:
The number of rows.

getBufferSize

public int getBufferSize()
Description copied from interface: TerminalModel
Gets the buffer size.

Returns:
The buffer size.

getBellStrategy

public BellStrategy getBellStrategy()
Description copied from interface: TerminalModel
Gets the bell strategy.

Returns:
The bell strategy.

setBellStrategy

public void setBellStrategy(BellStrategy strategy)
Description copied from interface: TerminalModel
Sets the bell strategy.

Parameters:
strategy - The bell strategy.

getDefaultBackgroundColor

public java.awt.Color getDefaultBackgroundColor()
Description copied from interface: TerminalModel
Gets the default background color.

Returns:
The default background color.

getDefaultForegroundColor

public java.awt.Color getDefaultForegroundColor()
Description copied from interface: TerminalModel
Gets the default foreground color.

Returns:
The default foreground color.


Copyright © 2009-2012. All Rights Reserved.