public class ECMA48Terminal extends LogicalScreen implements TerminalReader, java.lang.Runnable
cursorVisible, cursorX, cursorY, height, logical, physical, reallyCleared, width
Constructor and Description |
---|
ECMA48Terminal(java.lang.Object listener,
java.io.InputStream input,
java.io.OutputStream output)
Constructor sets up state for getEvent().
|
ECMA48Terminal(java.lang.Object listener,
java.io.InputStream input,
java.io.OutputStream output,
int windowWidth,
int windowHeight)
Constructor sets up state for getEvent().
|
ECMA48Terminal(java.lang.Object listener,
java.io.InputStream input,
java.io.Reader reader,
java.io.PrintWriter writer)
Constructor sets up state for getEvent().
|
ECMA48Terminal(java.lang.Object listener,
java.io.InputStream input,
java.io.Reader reader,
java.io.PrintWriter writer,
boolean setRawMode)
Constructor sets up state for getEvent().
|
Modifier and Type | Method and Description |
---|---|
void |
closeTerminal()
Restore terminal to normal state.
|
void |
flush()
Flush output.
|
void |
flushPhysical()
Push the logical screen to the physical device.
|
void |
getEvents(java.util.List<TInputEvent> queue)
Return any events in the IO queue.
|
java.io.PrintWriter |
getOutput()
Get the output writer.
|
SessionInfo |
getSessionInfo()
Getter for sessionInfo.
|
int |
getSixelPaletteSize()
Get the number of colors in the sixel palette.
|
int |
getTextHeight()
Get the height of a character cell in pixels.
|
int |
getTextWidth()
Get the width of a character cell in pixels.
|
boolean |
hasEvents()
Check if there are events in the queue.
|
boolean |
hasSixel()
Get the sixel support flag.
|
void |
reloadOptions()
Reload options from System properties.
|
void |
resizeToScreen()
Resize the physical screen to match the logical screen dimensions.
|
void |
run()
Read function runs on a separate thread.
|
void |
setListener(java.lang.Object listener)
Set listener to a different Object.
|
void |
setSixelPaletteSize(int paletteSize)
Set the number of colors in the sixel palette.
|
void |
setTitle(java.lang.String title)
Set the window title.
|
clear, clearPhysical, drawBox, drawBox, drawBoxShadow, getAttrXY, getCharXY, getClipBottom, getClipLeft, getClipRight, getClipTop, getCursorX, getCursorY, getHeight, getWidth, hideCursor, hLineXY, isCursorVisible, isDirty, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putCursor, putFullwidthCharXY, putFullwidthCharXY, putFullwidthCharXY, putStringXY, putStringXY, reset, resetClipping, setClipBottom, setClipLeft, setClipRight, setClipTop, setDimensions, setHeight, setOffsetX, setOffsetY, setWidth, unsetImageRow, vLineXY
public ECMA48Terminal(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output, int windowWidth, int windowHeight) throws java.io.UnsupportedEncodingException
listener
- the object this backend needs to wake up when new
input comes ininput
- an InputStream connected to the remote user, or null for
System.in. If System.in is used, then on non-Windows systems it will
be put in raw mode; closeTerminal() will (blindly!) put System.in in
cooked mode. input is always converted to a Reader with UTF-8
encoding.output
- an OutputStream connected to the remote user, or null
for System.out. output is always converted to a Writer with UTF-8
encoding.windowWidth
- the number of text columns to start withwindowHeight
- the number of text rows to start withjava.io.UnsupportedEncodingException
- if an exception is thrown when
creating the InputStreamReaderpublic ECMA48Terminal(java.lang.Object listener, java.io.InputStream input, java.io.OutputStream output) throws java.io.UnsupportedEncodingException
listener
- the object this backend needs to wake up when new
input comes ininput
- an InputStream connected to the remote user, or null for
System.in. If System.in is used, then on non-Windows systems it will
be put in raw mode; closeTerminal() will (blindly!) put System.in in
cooked mode. input is always converted to a Reader with UTF-8
encoding.output
- an OutputStream connected to the remote user, or null
for System.out. output is always converted to a Writer with UTF-8
encoding.java.io.UnsupportedEncodingException
- if an exception is thrown when
creating the InputStreamReaderpublic ECMA48Terminal(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer, boolean setRawMode)
listener
- the object this backend needs to wake up when new
input comes ininput
- the InputStream underlying 'reader'. Its available()
method is used to determine if reader.read() will block or not.reader
- a Reader connected to the remote user.writer
- a PrintWriter connected to the remote user.setRawMode
- if true, set System.in into raw mode with stty.
This should in general not be used. It is here solely for Demo3,
which uses System.in.java.lang.IllegalArgumentException
- if input, reader, or writer are null.public ECMA48Terminal(java.lang.Object listener, java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer)
listener
- the object this backend needs to wake up when new
input comes ininput
- the InputStream underlying 'reader'. Its available()
method is used to determine if reader.read() will block or not.reader
- a Reader connected to the remote user.writer
- a PrintWriter connected to the remote user.java.lang.IllegalArgumentException
- if input, reader, or writer are null.public void setTitle(java.lang.String title)
setTitle
in interface Screen
setTitle
in class LogicalScreen
title
- the new titlepublic void flushPhysical()
flushPhysical
in interface Screen
flushPhysical
in class LogicalScreen
public void resizeToScreen()
resizeToScreen
in class LogicalScreen
public boolean hasEvents()
hasEvents
in interface TerminalReader
public void getEvents(java.util.List<TInputEvent> queue)
getEvents
in interface TerminalReader
queue
- list to append new events topublic void closeTerminal()
closeTerminal
in interface TerminalReader
public void setListener(java.lang.Object listener)
setListener
in interface TerminalReader
listener
- the new listening object that run() wakes up on new
inputpublic void reloadOptions()
reloadOptions
in interface TerminalReader
public void run()
run
in interface java.lang.Runnable
public int getTextWidth()
getTextWidth
in interface Screen
getTextWidth
in class LogicalScreen
public int getTextHeight()
getTextHeight
in interface Screen
getTextHeight
in class LogicalScreen
public SessionInfo getSessionInfo()
public java.io.PrintWriter getOutput()
public void flush()
public int getSixelPaletteSize()
public void setSixelPaletteSize(int paletteSize)
paletteSize
- the new palette sizepublic boolean hasSixel()
Copyright © 2019 Kevin Lamonte. Licensed MIT.