Package jexer
Class TTextPicture
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TScrollable
-
- jexer.TTextPicture
-
- All Implemented Interfaces:
java.lang.Comparable<TWidget>,Scrollable,TerminalListener
public class TTextPicture extends TScrollable implements TerminalListener
TTextPicture displays a color-and-text canvas, also called "ANSI Art" or "ASCII Art".
-
-
Field Summary
-
Fields inherited from class jexer.TScrollable
hScroller, vScroller
-
-
Constructor Summary
Constructors Constructor Description TTextPicture(TWidget parent, java.lang.String filename, int x, int y, int width, int height)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Handle widget close.voiddraw()Draw the text box.intgetDisplayHeight()Function to call to obtain the display height.intgetDisplayWidth()Function to call to obtain the display width.voidonKeypress(TKeypressEvent keypress)Handle keystrokes.voidonMouseDown(TMouseEvent mouse)Handle mouse press events.voidonResize(TResizeEvent resize)Handle window/screen resize events.voidpostUpdate(TerminalState terminalState)Called by emulator when fresh data has come in.voidreflowData()Resize scrollbars for a new width/height.-
Methods inherited from class jexer.TScrollable
bigHorizontalDecrement, bigHorizontalIncrement, bigVerticalDecrement, bigVerticalIncrement, getBottomValue, getHorizontalBigChange, getHorizontalScroller, getHorizontalSmallChange, getHorizontalValue, getLeftValue, getRightValue, getTopValue, getVerticalBigChange, getVerticalScroller, getVerticalSmallChange, getVerticalValue, horizontalDecrement, horizontalIncrement, placeScrollbars, setBottomValue, setHorizontalBigChange, setHorizontalSmallChange, setHorizontalValue, setLeftValue, setRightValue, setTopValue, setVerticalBigChange, setVerticalSmallChange, setVerticalValue, toBottom, toEnd, toHome, toLeft, toRight, toTop, verticalDecrement, verticalIncrement
-
Methods inherited from class jexer.TWidget
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, applyCellTransform, applyCellTransform, compareTo, doRepaint, drawBox, drawBoxShadow, drawChildren, drawForegroundBox, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getLocale, getMouseStyle, getParent, getScreen, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hForegroundLineXY, hLineXY, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseDoubleClick, onMouseMotion, onMouseUp, putAll, putAttrXY, putAttrXY, putBackgroundAttrBox, putBackgroundAttrXY, putBackgroundAttrXY, putCharXY, putCharXY, putCharXY, putForegroundCharXY, putForegroundStringXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setLocale, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY, vLineXY
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jexer.terminal.TerminalListener
getClipboard
-
-
-
-
Constructor Detail
-
TTextPicture
public TTextPicture(TWidget parent, java.lang.String filename, int x, int y, int width, int height)
Public constructor.- Parameters:
parent- parent widgetfilename- the file containing the picture datax- column relative to parenty- row relative to parentwidth- width of text areaheight- height of text area
-
-
Method Detail
-
onResize
public void onResize(TResizeEvent resize)
Handle window/screen resize events.- Overrides:
onResizein classTScrollable- Parameters:
resize- resize event
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypressin classTWidget- Parameters:
keypress- keystroke event
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse press events.- Overrides:
onMouseDownin classTWidget- Parameters:
mouse- mouse button press event
-
reflowData
public void reflowData()
Resize scrollbars for a new width/height.- Overrides:
reflowDatain classTScrollable
-
postUpdate
public void postUpdate(TerminalState terminalState)
Called by emulator when fresh data has come in.- Specified by:
postUpdatein interfaceTerminalListener- Parameters:
terminalState- the new terminal state
-
getDisplayWidth
public int getDisplayWidth()
Function to call to obtain the display width.- Specified by:
getDisplayWidthin interfaceTerminalListener- Returns:
- the number of columns in the display
-
getDisplayHeight
public int getDisplayHeight()
Function to call to obtain the display height.- Specified by:
getDisplayHeightin interfaceTerminalListener- Returns:
- the number of rows in the display
-
-