com.mindbright.terminal
public interface TerminalWindow
Modifier and Type | Method and Description |
---|---|
void |
addInputListener(TerminalInputListener listener)
Add a input listener which listens to data from the user.
|
void |
addOutputListener(TerminalOutputListener listener)
Add a output listener which listens to data from the server.
|
void |
attachPrinter(TerminalPrinter printer)
Attach a printer to this terminal.
|
void |
clearLine()
This shortcut method clears the current line.
|
void |
clearScreen()
This shortcut method clears the screen.
|
int |
cols()
Get the number of columns shown.
|
void |
detachPrinter()
Detach the previously attached printer.
|
TerminalOption[] |
getOptions()
Get the terminal options.
|
java.util.Properties |
getProperties()
Get the current terminal properties
|
java.lang.String |
getProperty(java.lang.String key)
Get the value of a single property.
|
boolean |
getPropsChanged()
Check if any properties have changed.
|
java.lang.String |
getTitle()
Get the title
|
int |
hpixels()
Get the number of horizontal pixels used to represent the terminal.
|
void |
printScreen()
Dump the current screen to the attached printer.
|
void |
removeInputListener(TerminalInputListener listener)
Removes a previously added input listener
|
void |
removeOutputListener(TerminalOutputListener listener)
Removes a previously added output listener
|
void |
reset()
Reset the terminal emulator to the default state.
|
void |
resetToDefaults()
Reset all properties to their default values.
|
void |
ringBell()
This shortcut method rings the terminal bell.
|
int |
rows()
Get the number of rows shown.
|
SearchContext |
search(SearchContext lastContext,
java.lang.String key,
boolean reverse,
boolean caseSens)
Search for a string in the terminal window
|
void |
sendBreak()
Send a break singal to the server.
|
void |
sendBytes(byte[] b)
May be called when the user pastes data.
|
void |
sendBytesDirect(byte[] b)
Send some bytes directly to the host.
|
void |
setAttributeBold(boolean set)
This shortcut menthod is used to enable/disable bold
characters.
|
void |
setCursorPos(int row,
int col)
This shortcut method moves the cursor to the given position.
|
void |
setProperties(java.util.Properties newProps,
boolean merge)
Set a bunch of terminal properties
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Set a single terminal property.
|
void |
setPropsChanged(boolean value)
Change the properties changed flag.
|
void |
setTitle(java.lang.String title)
Set title of terminal window.
|
void |
startPrinter()
Start dumping a log of everything which is printed on the
terminal to the attached printer.
|
void |
stopPrinter()
Stop printing.
|
java.lang.String |
terminalType()
Get the terminal type which the window currently emulates.
|
void |
typedChar(char c)
Called whn the user tpyes a character
|
int |
vpixels()
Get the number of vertical pixels used to represent the terminal.
|
void |
write(byte b)
Write a byte to the terminal.
|
void |
write(byte[] c,
int off,
int len)
Write a bunch of bytes to the terminal.
|
void |
write(char c)
Write a character to the terminal.
|
void |
write(char[] c,
int off,
int len)
Write a bunch of characters to the terminal.
|
void |
write(java.lang.String str)
Write a string to the terminal.
|
void setTitle(java.lang.String title)
title
- the titlejava.lang.String getTitle()
int rows()
int cols()
int vpixels()
int hpixels()
void write(byte b)
b
- byte to writevoid write(char c)
The character is assumed to be in the java internal encoding.
c
- character to writevoid write(char[] c, int off, int len)
The characters are assumed to be in the java internal encoding.
c
- array containg the characters to writeoff
- index in array of first character to writelen
- number of characters to writevoid write(byte[] c, int off, int len)
c
- array containg the characters to writeoff
- index in array of first character to writelen
- number of characters to writevoid write(java.lang.String str)
str
- string to writevoid addInputListener(TerminalInputListener listener)
listener
- input listener to addvoid removeInputListener(TerminalInputListener listener)
listener
- input listener to removevoid addOutputListener(TerminalOutputListener listener)
listener
- output listener to addvoid removeOutputListener(TerminalOutputListener listener)
listener
- output listener to removevoid attachPrinter(TerminalPrinter printer)
printer
- printer to attachvoid detachPrinter()
void typedChar(char c)
c
- typed charactervoid sendBytes(byte[] b)
b
- array of bytes representing characters to inputvoid sendBytesDirect(byte[] b)
b
- array of bytes representing characters to sendvoid sendBreak()
void reset()
void printScreen()
void startPrinter()
void stopPrinter()
java.lang.String terminalType()
void setProperties(java.util.Properties newProps, boolean merge) throws java.lang.IllegalArgumentException, java.util.NoSuchElementException
newProps
- new propertiesmerge
- if true the new properties are merged with any
previous properties. If false all old properties are deleted.java.lang.IllegalArgumentException
java.util.NoSuchElementException
void setProperty(java.lang.String key, java.lang.String value) throws java.lang.IllegalArgumentException, java.util.NoSuchElementException
key
- property to setvalue
- value to set it tojava.lang.IllegalArgumentException
java.util.NoSuchElementException
java.util.Properties getProperties()
java.lang.String getProperty(java.lang.String key)
key
- name of perty to get value ofvoid resetToDefaults()
boolean getPropsChanged()
void setPropsChanged(boolean value)
value
- new value.TerminalOption[] getOptions()
SearchContext search(SearchContext lastContext, java.lang.String key, boolean reverse, boolean caseSens)
lastContext
- used as a starying point, if not null, so
tha the search may continue from the last positionkey
- string to search forreverse
- if true the search is performed backwardscaseSens
- if true the key is case sensitivenull
if the key was not found.void setAttributeBold(boolean set)
The shortcut methods are used by local code to achieve certain effects without knowing which terminal emulation is active.
set
- if true turn on bold for subsequent characters.void clearScreen()
The shortcut methods are used by local code to achieve certain effects without knowing which terminal emulation is active.
void ringBell()
The shortcut methods are used by local code to achieve certain effects without knowing which terminal emulation is active.
void setCursorPos(int row, int col)
The shortcut methods are used by local code to achieve certain effects without knowing which terminal emulation is active.
row
- row to place cursor oncol
- column to place cursor onvoid clearLine()
The shortcut methods are used by local code to achieve certain effects without knowing which terminal emulation is active.