|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--ix.iface.ui.JFrameMT
A frame with a menu bar, a tool bar, and file/about/exit dialogues. Contains a method to create a default menu/tool bar and useful methods for building menu and tool bars. Creates an About dialog, file dialogs (open, save as), provides default functions for openFile, saveFileAs, toggleToolbar, exit, and aboutDialog.
Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
JAboutDialog |
aboutDialog
|
protected IXToolItem |
aboutItem
|
protected IXToolItem |
closeItem
|
protected javax.swing.ImageIcon |
copyIcon
|
protected IXToolItem |
copyItem
|
protected javax.swing.ImageIcon |
cutIcon
|
protected IXToolItem |
cutItem
|
javax.swing.JMenu |
editMenu
|
protected IXToolItem |
exitItem
|
javax.swing.JMenu |
fileMenu
|
protected javax.swing.ImageIcon |
helpIcon
|
protected IXToolItem |
helpItem
|
javax.swing.JMenu |
helpMenu
|
java.lang.String |
imageDir
|
javax.swing.JPanel |
JPanel2
|
javax.swing.JPanel |
mainJPanel
|
protected IXToolItem |
manualItem
|
javax.swing.JMenuBar |
menuBar
|
protected javax.swing.ImageIcon |
newIcon
|
protected IXToolItem |
newItem
|
java.awt.FileDialog |
openFileDialog
|
protected javax.swing.ImageIcon |
openIcon
|
protected IXToolItem |
openItem
|
javax.swing.JMenu |
optionsMenu
|
protected javax.swing.ImageIcon |
pasteIcon
|
protected IXToolItem |
pasteItem
|
protected javax.swing.ImageIcon |
revertIcon
|
protected IXToolItem |
revertItem
|
protected IXToolItem |
saveAsItem
|
java.awt.FileDialog |
saveFileDialog
|
protected javax.swing.ImageIcon |
saveIcon
|
protected IXToolItem |
saveItem
|
(package private) int |
TB_HEIGHT
|
(package private) int |
TBB_HEIGHT
|
(package private) int |
TBB_WIDTH
|
(package private) int |
TBB_Y
|
javax.swing.JToolBar |
toolBar
|
javax.swing.JMenu |
toolsMenu
|
javax.swing.JMenu |
viewMenu
|
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, icon, ICONIFIED, mbManagement, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Window |
inputContext, OPENED, ownedWindowList, state, warningString, windowListener |
Fields inherited from class java.awt.Container |
component, containerListener, layoutMgr, listeningBoundsChildren, listeningChildren, ncomponents |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JFrameMT()
Creates a frame with a menu bar, a tool bar, a main panel. |
|
JFrameMT(java.lang.String title)
Creates a frame (see JFrameMT()) with a given title |
Method Summary | |
void |
aboutDialog()
|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
void |
exit()
|
void |
exitApplication()
|
javax.swing.JCheckBoxMenuItem |
makeCheckMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label)
Makes a check box menu item and adds it to the given (menu) component. |
void |
makeDefaultMenuToolbar()
Makes a default menubar and toolbar. |
javax.swing.JMenu |
makeEditMenuTool(javax.swing.JComponent parentMenu)
Makes a default edit menu and toolbar buttons. |
javax.swing.JMenu |
makeFileMenuTool(javax.swing.JComponent parentMenu)
Makes a default file menu and toolbar buttons. |
void |
makeFileMenuToolExits(javax.swing.JMenu fileMenu)
Makes default close/exit menu options and and toolbar buttons. |
void |
makeFileMenuToolFiles(javax.swing.JMenu fileMenu)
Makes default file new/open/save/saveAs menu items and toolbar buttons. |
void |
makeFrame()
|
javax.swing.JMenu |
makeHelpMenuTool(javax.swing.JComponent parentMenu)
Makes a default help menu and toolbar buttons. |
javax.swing.JMenu |
makeMenu(javax.swing.JComponent parent,
java.lang.String label)
Makes a menu and adds it to the given (menu) component. |
javax.swing.JMenuItem |
makeMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label)
Makes a menu item with the given label and command and adds it to the given (menu) parent. |
javax.swing.JMenuItem |
makeMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label,
char mnemonic)
Makes a menu item as above but with a given mnemonic. |
javax.swing.JMenuItem |
makeMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label,
char mnemonic,
javax.swing.Icon icon,
javax.swing.KeyStroke accel)
Makes a menu item as above but with a given icon and accelerator |
javax.swing.JMenuItem |
makeMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label,
javax.swing.Icon icon)
Makes a menu item as above but with a given icon and accelerator |
javax.swing.JMenuItem |
makeMenuTool(javax.swing.JComponent menuParent,
java.lang.String command,
char mnemonic,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a menu item and a toolbar button with given mnemonic. |
javax.swing.JMenuItem |
makeMenuTool(javax.swing.JComponent menuParent,
java.lang.String command,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a menu item and a toolbar button with command, icon, and ToolTipText. |
javax.swing.JMenuItem |
makeMenuTool(javax.swing.JComponent menuParent,
java.lang.String command,
java.lang.String label,
char mnemonic,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a menu item and a toolbar button as above but with given label. |
javax.swing.JMenuItem |
makeMenuTool(javax.swing.JComponent menuParent,
java.lang.String command,
java.lang.String label,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a menu item and a toolbar button as above but with given label. |
void |
makeMenuToolBars()
|
javax.swing.JMenuItem |
makeMenuToolITxt(javax.swing.JComponent menuParent,
java.lang.String command,
java.lang.String label,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a menu item and a toolbar button as with makeMenuTool but adds the label to the icon too. |
javax.swing.JMenu |
makeOptionsMenuTool(javax.swing.JComponent parentMenu)
Makes a default options menu and toolbar buttons. |
javax.swing.JRadioButtonMenuItem |
makeRadioMenuItem(javax.swing.JComponent parent,
java.lang.String command,
java.lang.String label)
Makes a radio button menu item and adds it to the given (menu) component. |
protected javax.swing.JButton |
makeToolbarButton(java.lang.String command,
javax.swing.Icon icon,
char mnemo,
java.lang.String tttxt)
Makes a toolbar button as above but with a mnemonic. |
protected javax.swing.JButton |
makeToolbarButton(java.lang.String command,
javax.swing.Icon icon,
int x,
char mnemo,
java.lang.String tttxt)
Makes a toolbar button as above but with a given location. |
protected javax.swing.JButton |
makeToolbarButton(java.lang.String command,
javax.swing.Icon icon,
java.lang.String tttxt)
Makes a toolbar button with the given command, icon, and ToolTipText. |
protected javax.swing.JButton |
makeToolbarButton(java.lang.String command,
javax.swing.Icon icon,
java.lang.String text,
java.lang.String tttxt)
Makes a toolbar button with the given command, icon, text, and ToolTipText. |
javax.swing.JMenu |
makeToolsMenuTool(javax.swing.JComponent parentMenu)
Makes a default tools menu and toolbar buttons. |
javax.swing.JMenu |
makeViewMenuTool(javax.swing.JComponent parentMenu)
Makes a default view menu and toolbar buttons. |
void |
openFile()
|
void |
placeToolbarButton(javax.swing.JButton button,
int x)
|
void |
saveFile()
|
void |
saveFileAs(java.awt.event.ActionEvent event)
|
void |
toggleToolbar(boolean on)
|
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.awt.Window |
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, show, toBack, toFront, transferFocus |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
public java.lang.String imageDir
int TBB_Y
int TBB_WIDTH
int TBB_HEIGHT
int TB_HEIGHT
public JAboutDialog aboutDialog
public java.awt.FileDialog saveFileDialog
public java.awt.FileDialog openFileDialog
public javax.swing.JPanel mainJPanel
public javax.swing.JPanel JPanel2
public javax.swing.JMenuBar menuBar
public javax.swing.JToolBar toolBar
public javax.swing.JMenu fileMenu
public javax.swing.JMenu editMenu
public javax.swing.JMenu viewMenu
public javax.swing.JMenu toolsMenu
public javax.swing.JMenu helpMenu
public javax.swing.JMenu optionsMenu
protected javax.swing.ImageIcon newIcon
protected javax.swing.ImageIcon openIcon
protected javax.swing.ImageIcon saveIcon
protected javax.swing.ImageIcon revertIcon
protected javax.swing.ImageIcon cutIcon
protected javax.swing.ImageIcon copyIcon
protected javax.swing.ImageIcon pasteIcon
protected javax.swing.ImageIcon helpIcon
protected IXToolItem newItem
protected IXToolItem openItem
protected IXToolItem saveItem
protected IXToolItem saveAsItem
protected IXToolItem closeItem
protected IXToolItem exitItem
protected IXToolItem revertItem
protected IXToolItem cutItem
protected IXToolItem copyItem
protected IXToolItem pasteItem
protected IXToolItem helpItem
protected IXToolItem manualItem
protected IXToolItem aboutItem
Constructor Detail |
public JFrameMT()
public JFrameMT(java.lang.String title)
title
- a string representing the frame's titleMethod Detail |
public void makeFrame()
public void makeMenuToolBars()
public void makeDefaultMenuToolbar()
public javax.swing.JMenu makeFileMenuTool(javax.swing.JComponent parentMenu)
public void makeFileMenuToolFiles(javax.swing.JMenu fileMenu)
public void makeFileMenuToolExits(javax.swing.JMenu fileMenu)
public javax.swing.JMenu makeOptionsMenuTool(javax.swing.JComponent parentMenu)
public javax.swing.JMenu makeEditMenuTool(javax.swing.JComponent parentMenu)
public javax.swing.JMenu makeViewMenuTool(javax.swing.JComponent parentMenu)
public javax.swing.JMenu makeToolsMenuTool(javax.swing.JComponent parentMenu)
public javax.swing.JMenu makeHelpMenuTool(javax.swing.JComponent parentMenu)
public javax.swing.JMenuItem makeMenuTool(javax.swing.JComponent menuParent, java.lang.String command, javax.swing.Icon icon, java.lang.String tttxt)
menuParent
- the menu that the item should be added tocommand
- attached to item and button for recognising actionsicon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonpublic javax.swing.JMenuItem makeMenuTool(javax.swing.JComponent menuParent, java.lang.String command, java.lang.String label, javax.swing.Icon icon, java.lang.String tttxt)
menuParent
- the menu that the item should be added tocommand
- attached to item and button for recognising actionslabel
- the label to display on the menu item (usually ...)icon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonpublic javax.swing.JMenuItem makeMenuTool(javax.swing.JComponent menuParent, java.lang.String command, char mnemonic, javax.swing.Icon icon, java.lang.String tttxt)
menuParent
- the menu that the item should be added tocommand
- attached to item and button for recognising actionsmnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonpublic javax.swing.JMenuItem makeMenuTool(javax.swing.JComponent menuParent, java.lang.String command, java.lang.String label, char mnemonic, javax.swing.Icon icon, java.lang.String tttxt)
menuParent
- the menu that the item should be added tocommand
- attached to item and button for recognising actionslabel
- the label to display on the menu item (usually ...)mnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonpublic javax.swing.JMenuItem makeMenuToolITxt(javax.swing.JComponent menuParent, java.lang.String command, java.lang.String label, javax.swing.Icon icon, java.lang.String tttxt)
menuParent
- the menu that the item should be added tocommand
- attached to item and button for recognising actionslabel
- the label to display on the menu item (usually ...)icon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonprotected javax.swing.JButton makeToolbarButton(java.lang.String command, javax.swing.Icon icon, java.lang.String tttxt)
command
- attached to the button for recognising actionsicon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonprotected javax.swing.JButton makeToolbarButton(java.lang.String command, javax.swing.Icon icon, char mnemo, java.lang.String tttxt)
command
- attached to the button for recognising actionsmnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonprotected javax.swing.JButton makeToolbarButton(java.lang.String command, javax.swing.Icon icon, java.lang.String text, java.lang.String tttxt)
command
- attached to the button for recognising actionsicon
- the icon to use on the buttontttxt
- the tool tip text attached to the buttonprotected javax.swing.JButton makeToolbarButton(java.lang.String command, javax.swing.Icon icon, int x, char mnemo, java.lang.String tttxt)
command
- attached to the button for recognising actionsmnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to use on the buttonx
- the x-location for the button on the toolbar -***needed?tttxt
- the tool tip text attached to the buttonpublic void placeToolbarButton(javax.swing.JButton button, int x)
public javax.swing.JMenuItem makeMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menupublic javax.swing.JMenuItem makeMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label, char mnemonic)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menumnemonic
- used for mnemonic and accelerator (e.g. X for cut)
as above but without the accelerator or an iconpublic javax.swing.JMenuItem makeMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label, javax.swing.Icon icon)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menumnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to be attached to the itemaccel
- the key accelerator to be used for the itempublic javax.swing.JMenuItem makeMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label, char mnemonic, javax.swing.Icon icon, javax.swing.KeyStroke accel)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menumnemonic
- used for mnemonic and accelerator (e.g. X for cut)icon
- the icon to be attached to the itemaccel
- the key accelerator to be used for the itempublic javax.swing.JCheckBoxMenuItem makeCheckMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menupublic javax.swing.JRadioButtonMenuItem makeRadioMenuItem(javax.swing.JComponent parent, java.lang.String command, java.lang.String label)
menuParent
- the menu that the item should be added tocommand
- attached to the item for recognising actionslabel
- displayed in the menupublic javax.swing.JMenu makeMenu(javax.swing.JComponent parent, java.lang.String label)
menuParent
- the menu that the item should be added tolabel
- the name of the menupublic void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public void exitApplication()
public void openFile()
public void saveFile()
public void saveFileAs(java.awt.event.ActionEvent event)
public void toggleToolbar(boolean on)
public void exit()
public void aboutDialog()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |