Package jexer
Class TTextPicture
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TScrollableWidget
-
- jexer.TTextPicture
-
- All Implemented Interfaces:
java.lang.Comparable<TWidget>
,Scrollable
,DisplayListener
public class TTextPicture extends TScrollableWidget implements DisplayListener
TTextPicture displays a color-and-text canvas, also called "ANSI Art" or "ASCII Art".
-
-
Field Summary
-
Fields inherited from class jexer.TScrollableWidget
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 void
close()
Handle widget close.void
displayChanged()
Called by emulator when fresh data has come in.void
draw()
Draw the text box.int
getDisplayHeight()
Function to call to obtain the display height.int
getDisplayWidth()
Function to call to obtain the display width.void
onKeypress(TKeypressEvent keypress)
Handle keystrokes.void
onMouseDown(TMouseEvent mouse)
Handle mouse press events.void
onResize(TResizeEvent resize)
Handle window/screen resize events.void
reflowData()
Resize scrollbars for a new width/height.-
Methods inherited from class jexer.TScrollableWidget
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, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getMouseStyle, getParent, getScreen, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseDoubleClick, onMouseMotion, onMouseUp, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
-
-
-
-
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:
onResize
in classTScrollableWidget
- Parameters:
resize
- resize event
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypress
in classTWidget
- Parameters:
keypress
- keystroke event
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse press events.- Overrides:
onMouseDown
in classTWidget
- Parameters:
mouse
- mouse button press event
-
reflowData
public void reflowData()
Resize scrollbars for a new width/height.- Overrides:
reflowData
in classTScrollableWidget
-
displayChanged
public void displayChanged()
Called by emulator when fresh data has come in.- Specified by:
displayChanged
in interfaceDisplayListener
-
getDisplayWidth
public int getDisplayWidth()
Function to call to obtain the display width.- Specified by:
getDisplayWidth
in interfaceDisplayListener
- Returns:
- the number of columns in the display
-
getDisplayHeight
public int getDisplayHeight()
Function to call to obtain the display height.- Specified by:
getDisplayHeight
in interfaceDisplayListener
- Returns:
- the number of rows in the display
-
-