|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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.util.ToolFrame ix.iface.ui.JFrameMT
public class 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
IXToolItem |
aboutItem
|
(package private) CatchingActionListener |
catchingListener
|
IXToolItem |
closeItem
|
protected javax.swing.ImageIcon |
copyIcon
|
IXToolItem |
copyItem
|
protected javax.swing.ImageIcon |
cutIcon
|
IXToolItem |
cutItem
|
java.io.File |
directory
Te directory that the application's files live in |
javax.swing.JMenu |
editMenu
|
IXToolItem |
exitItem
|
java.util.ArrayList |
extensions
A list of file extensions to be used in the file chooser. |
java.io.File |
file
The current file (for saving) |
javax.swing.JFileChooser |
fileChooser
|
javax.swing.JMenu |
fileMenu
|
java.lang.String |
fileType
A description of the file type to be used in the file chooser. |
java.lang.String |
helpFile
|
HelpFrame |
helpFrame
|
javax.swing.ImageIcon |
helpFrameIcon
|
protected javax.swing.ImageIcon |
helpIcon
|
IXToolItem |
helpItem
|
javax.swing.JMenu |
helpMenu
|
javax.swing.JPanel |
JPanel2
|
javax.swing.JPanel |
mainJPanel
|
IXToolItem |
manualItem
|
javax.swing.JMenuBar |
menuBar
|
protected javax.swing.ImageIcon |
newIcon
|
IXToolItem |
newItem
|
protected javax.swing.ImageIcon |
openIcon
|
IXToolItem |
openItem
|
javax.swing.JMenu |
optionsMenu
|
protected javax.swing.ImageIcon |
pasteIcon
|
IXToolItem |
pasteItem
|
protected javax.swing.ImageIcon |
redoIcon
|
IXToolItem |
redoItem
|
protected javax.swing.ImageIcon |
revertIcon
|
IXToolItem |
revertItem
|
IXToolItem |
saveAsItem
|
protected javax.swing.ImageIcon |
saveIcon
|
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
|
IXToolItem |
toolbarItem
|
javax.swing.JMenu |
toolsMenu
|
javax.swing.JMenu |
viewMenu
|
Fields inherited from class ix.iface.util.ToolFrame |
---|
toolFrames |
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, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
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 |
adaptDefaultMenu()
Dummy method that can be overridden by sub-classes to adapt the default. |
void |
adaptDefaultMenuToolbar()
Dummy method that can be overridden by sub-classes to adapt the default. |
void |
adaptDefaultToolbar()
Dummy method that can be overridden by sub-classes to adapt the default. |
void |
close()
|
void |
ensureFileChooser()
|
HTMLFrame |
ensureHelpFrame()
|
void |
exit()
|
void |
exitApplication()
|
void |
makeDefaultMenu()
Makes a default menubar Menus: File (new, open, save, saveAs, Options menu, close, exit), Edit (revert, copy, cut, paste), View (), Tools(), Help (help, manual, about) |
void |
makeDefaultMenuToolbar()
Makes a default menubar and toolbar. |
void |
MakeDefaultToolbar()
|
void |
makeEditMenu()
|
javax.swing.JMenu |
makeEditMenuTool(javax.swing.JComponent parentMenu)
Makes a default edit menu and toolbar buttons. |
void |
makeFileMenu()
|
void |
makeFileMenuExits()
|
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()
|
void |
makeHelpMenu()
Make sure that if this is overwritten, adaptDefaultMenu is called elsewhere. |
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. |
void |
makeMenuToolBars()
|
void |
makeOptionsMenu()
|
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. |
void |
makeToolbarItem(javax.swing.JMenu parentMenu)
|
void |
makeToolsMenu()
|
javax.swing.JMenu |
makeToolsMenuTool(javax.swing.JComponent parentMenu)
Makes a default tools menu and toolbar buttons. |
void |
makeViewMenu()
|
javax.swing.JMenu |
makeViewMenuTool(javax.swing.JComponent parentMenu)
Makes a default view menu and toolbar buttons. |
void |
openFile()
|
void |
openFile(java.io.File file)
Overwrite this with actual opening. |
void |
placeToolbarButton(javax.swing.JButton button,
int x)
|
void |
saveFile()
|
void |
saveFileAs()
|
void |
saveToFile(java.io.File file)
Overwrite this with actual saving. |
void |
toggleToolbar(boolean on)
|
java.io.File |
userChooseFile()
|
void |
userHelp()
|
void |
userManual()
|
boolean |
validFileName(java.lang.String name)
Checks whether the file name has an extension listed in the frame's extensions. |
Methods inherited from class ix.iface.util.ToolFrame |
---|
setVisible, symbolNameChanged, walkToolFrames |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
CatchingActionListener catchingListener
int TBB_Y
int TBB_WIDTH
int TBB_HEIGHT
int TB_HEIGHT
public javax.swing.JFileChooser fileChooser
public java.io.File directory
public java.io.File file
public java.util.ArrayList extensions
public java.lang.String fileType
public HelpFrame helpFrame
public java.lang.String helpFile
public javax.swing.ImageIcon helpFrameIcon
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 redoIcon
protected javax.swing.ImageIcon cutIcon
protected javax.swing.ImageIcon copyIcon
protected javax.swing.ImageIcon pasteIcon
protected javax.swing.ImageIcon helpIcon
public IXToolItem newItem
public IXToolItem openItem
public IXToolItem saveItem
public IXToolItem saveAsItem
public IXToolItem toolbarItem
public IXToolItem closeItem
public IXToolItem exitItem
public IXToolItem revertItem
public IXToolItem redoItem
public IXToolItem cutItem
public IXToolItem copyItem
public IXToolItem pasteItem
public IXToolItem helpItem
public IXToolItem manualItem
public 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 ensureFileChooser()
public boolean validFileName(java.lang.String name)
public void makeDefaultMenu()
public void makeFileMenu()
public void makeFileMenuExits()
public void makeOptionsMenu()
public void makeToolbarItem(javax.swing.JMenu parentMenu)
public void makeEditMenu()
public void makeViewMenu()
public void makeToolsMenu()
public void makeHelpMenu()
public void MakeDefaultToolbar()
public void makeDefaultMenuToolbar()
public void adaptDefaultMenuToolbar()
public void adaptDefaultMenu()
public void adaptDefaultToolbar()
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 void placeToolbarButton(javax.swing.JButton button, int x)
public 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 close()
public void exitApplication()
public void openFile()
public java.io.File userChooseFile()
public void saveFile()
public void saveFileAs()
public void saveToFile(java.io.File file)
public void openFile(java.io.File file)
public void toggleToolbar(boolean on)
public void exit()
public void aboutDialog()
public void userManual()
public void userHelp()
public HTMLFrame ensureHelpFrame()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |