com.mindbright.terminal
public class TerminalMenuHandlerFull extends TerminalMenuHandler implements java.awt.event.ActionListener, java.awt.event.ItemListener, TerminalPrinter
TerminalWin
Modifier and Type | Field and Description |
---|---|
static int |
MENU_EDIT |
static int |
MENU_FILE |
static int |
MENU_SETTINGS |
Constructor and Description |
---|
TerminalMenuHandlerFull() |
TerminalMenuHandlerFull(java.lang.String titleName) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Called when a menu item was selected
|
void |
addBasicMenus(TerminalWin terminal,
javax.swing.JMenuBar mb)
Install the standard menus on the given frame.
|
boolean |
captureToFileDialog()
Start capturing data to file.
|
com.mindbright.terminal.TerminalMenuHandlerFull.TFileOutputStream |
chooseFileDialog(java.lang.String title)
Shows a save dialog with the specified title.
|
void |
endCapture()
Stop capturing data in a file.
|
void |
findDialog(java.lang.String title)
Show the find dialog.
|
javax.swing.JMenu |
getMenu(int idx) |
void |
handleMenuAction(int[] id)
Actually handle the selection of all the menu elements.
|
void |
itemStateChanged(java.awt.event.ItemEvent e)
Called when a checkbox menu item has changed state
|
void |
printBuffer() |
void |
printScreen()
Print a dump of the current screen.
|
void |
sendFileDialog()
Show the send file dialog.
|
void |
setPopupMenu(java.lang.Object menu)
Registers a popup menu.
|
void |
setReadOnlyMode(boolean readOnly)
Configure these menus to possibly act as belonging to a read
only terminal.
|
void |
setTerminalMenuListener(TerminalMenuListener listener)
Register a listener which is interested in menu events
|
void |
setTerminalWin(TerminalWin term)
Attach to a terminal window.
|
void |
setTitleName(java.lang.String titleName)
Set the name of this application.
|
void |
showPopupMenu(int x,
int y)
Show the popup menu at the indicated position.
|
void |
startPrinter(boolean tofile)
Start printing data to printer.
|
void |
stopPrinter(boolean resetterminal)
Stop sending data to printer.
|
void |
termSettingsDialog()
Show the terminal settings dialog with the default title.
|
void |
termSettingsDialog(java.lang.String title)
Show the terminal settings dialog.
|
void |
update()
Gets called when the contents of the menus might need updating.
|
void |
updateSelection(boolean selectionAvailable)
Gets called when the selection state is changed
|
void |
write(char c)
Write a character to the printer.
|
public static final int MENU_FILE
public static final int MENU_EDIT
public static final int MENU_SETTINGS
public TerminalMenuHandlerFull()
public TerminalMenuHandlerFull(java.lang.String titleName)
public void setTitleName(java.lang.String titleName)
TerminalMenuHandler
setTitleName
in class TerminalMenuHandler
titleName
- the application name for window titlespublic void setTerminalWin(TerminalWin term)
TerminalMenuHandler
setTerminalWin
in class TerminalMenuHandler
term
- terminal window to attach topublic void setReadOnlyMode(boolean readOnly)
TerminalMenuHandler
setReadOnlyMode
in class TerminalMenuHandler
readOnly
- true if the menus should be configured for read
only mode.public void setTerminalMenuListener(TerminalMenuListener listener)
TerminalMenuHandler
setTerminalMenuListener
in class TerminalMenuHandler
listener
- the interested listenerpublic void addBasicMenus(TerminalWin terminal, javax.swing.JMenuBar mb)
TerminalMenuHandler
addBasicMenus
in class TerminalMenuHandler
terminal
- terminal window to attach tomb
- menu bar to add menus topublic void updateSelection(boolean selectionAvailable)
TerminalMenuHandler
updateSelection
in class TerminalMenuHandler
selectionAvailable
- true if some text is selectedpublic void update()
TerminalMenuHandler
update
in class TerminalMenuHandler
public void termSettingsDialog(java.lang.String title)
title
- desired title of dialogpublic void termSettingsDialog()
public void findDialog(java.lang.String title)
title
- desired title of dialogpublic final void sendFileDialog()
public final com.mindbright.terminal.TerminalMenuHandlerFull.TFileOutputStream chooseFileDialog(java.lang.String title)
FileOutputStream
title
- title of dialogpublic final boolean captureToFileDialog()
public void endCapture()
captureToFileDialog()
.public javax.swing.JMenu getMenu(int idx)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
public void handleMenuAction(int[] id)
public void setPopupMenu(java.lang.Object menu)
TerminalMenuHandler
setPopupMenu
in class TerminalMenuHandler
menu
- the popup menu. This is passed as an Object since
it may be either a PopupMenu
or
JPopupMenu
.public void showPopupMenu(int x, int y)
TerminalMenuHandler
showPopupMenu
in class TerminalMenuHandler
x
- x-coordinate of position to show menu ayy
- y-coordinate of position to show menu aypublic void write(char c)
write
in interface TerminalOutputListener
c
- charcter to writepublic void startPrinter(boolean tofile)
startPrinter
in interface TerminalPrinter
public void stopPrinter(boolean resetterminal)
stopPrinter
in interface TerminalPrinter
public void printScreen()
TerminalPrinter
printScreen
in interface TerminalPrinter
public void printBuffer()