Package jexer.demos
Class DemoApplication
- java.lang.Object
-
- jexer.TApplication
-
- jexer.demos.DemoApplication
-
- All Implemented Interfaces:
java.lang.Runnable
public class DemoApplication extends TApplication
The demo application itself.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jexer.TApplication
TApplication.BackendType
-
-
Field Summary
-
Fields inherited from class jexer.TApplication
customMousePointer, customWidgetMousePointer, desktopCanHaveCursor, helpFile, helpTopics, imageSupportTest, lastUserInputTime, menuTrayText, oldPixelMouse, overlay, smartWindowPlacement, textMouse
-
-
Constructor Summary
Constructors Constructor Description DemoApplication(java.io.InputStream input, java.io.OutputStream output)
Public constructor.DemoApplication(java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer)
Public constructor.DemoApplication(java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer, boolean setRawMode)
Public constructor.DemoApplication(Backend backend)
Public constructor.DemoApplication(TApplication.BackendType backendType)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onMenu(TMenuEvent menu)
Handle menu events.-
Methods inherited from class jexer.TApplication
activateWindow, addEditMenu, addFileMenu, addHelpMenu, addMenu, addMenu, addMenuItem, addOverlay, addSubMenu, addTableMenu, addTimer, addToolMenu, addWindow, addWindow, addWindow, addWindow, addWindowMenu, closeMenu, closeSubMenu, closeWindow, disableMenuItem, disableMenuItems, doRepaint, doSmartPlacement, enableMenuItem, enableMenuItems, enableSecondaryEventReceiver, exit, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getActiveWindow, getAllMenus, getAllWindows, getBackend, getClipboard, getCustomMousePointer, getDesktop, getDesktopBottom, getDesktopTop, getFocusFollowsMouse, getMenuItem, getOverlay, getScreen, getTheme, hasWindow, hiddenWindowCount, hideWindow, inputBox, inputBox, inputBox, invokeLater, isModalThreadRunning, isRunning, messageBox, messageBox, onCommand, onExit, onKeypress, onPostDraw, onPreDraw, openContextMenu, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, openTerminal, postEvent, postMenuEvent, recomputeMenuX, removeMenu, removeTimer, restoreConsole, run, setCustomMousePointer, setDesktop, setDesktop, setFocusFollowsMouse, setHideMenuBar, setHideStatusBar, showAboutDialog, shownWindowCount, showWindow, switchMenu, switchWindow, windowCount, yield
-
-
-
-
Constructor Detail
-
DemoApplication
public DemoApplication(java.io.InputStream input, java.io.OutputStream output) throws java.io.UnsupportedEncodingException
Public constructor.- Parameters:
input
- 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; shutdown() 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.- Throws:
java.io.UnsupportedEncodingException
- if an exception is thrown when creating the InputStreamReader
-
DemoApplication
public DemoApplication(java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer, boolean setRawMode)
Public constructor.- Parameters:
input
- 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.- Throws:
java.lang.IllegalArgumentException
- if input, reader, or writer are null.
-
DemoApplication
public DemoApplication(java.io.InputStream input, java.io.Reader reader, java.io.PrintWriter writer)
Public constructor.- Parameters:
input
- 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.- Throws:
java.lang.IllegalArgumentException
- if input, reader, or writer are null.
-
DemoApplication
public DemoApplication(Backend backend)
Public constructor.- Parameters:
backend
- a Backend that is already ready to go.
-
DemoApplication
public DemoApplication(TApplication.BackendType backendType) throws java.lang.Exception
Public constructor.- Parameters:
backendType
- one of the TApplication.BackendType values- Throws:
java.lang.Exception
- if TApplication can't instantiate the Backend.
-
-
Method Detail
-
onMenu
public boolean onMenu(TMenuEvent menu)
Handle menu events.- Overrides:
onMenu
in classTApplication
- Parameters:
menu
- menu event- Returns:
- if true, the event was processed and should not be passed onto a window
-
-