ix.iface.ui
Class JFrameMT

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--ix.iface.ui.JFrameMT
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
Direct Known Subclasses:
JFrameMTP

public class JFrameMT
extends javax.swing.JFrame
implements java.awt.event.ActionListener

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.

See Also:
Serialized Form

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
 IXToolItem aboutItem
           
 IXToolItem closeItem
           
protected  javax.swing.ImageIcon copyIcon
           
 IXToolItem copyItem
           
protected  javax.swing.ImageIcon cutIcon
           
 IXToolItem cutItem
           
 javax.swing.JMenu editMenu
           
 IXToolItem exitItem
           
 javax.swing.JMenu fileMenu
           
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
           
 java.awt.FileDialog openFileDialog
           
protected  javax.swing.ImageIcon openIcon
           
 IXToolItem openItem
           
 javax.swing.JMenu optionsMenu
           
protected  javax.swing.ImageIcon pasteIcon
           
 IXToolItem pasteItem
           
protected  javax.swing.ImageIcon revertIcon
           
 IXToolItem revertItem
           
 IXToolItem saveAsItem
           
 java.awt.FileDialog saveFileDialog
           
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 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 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.
 java.awt.FileDialog ensureOpenDialog()
           
 java.awt.FileDialog ensureSaveDialog()
           
 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 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
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, postProcessKeyEvent, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
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

TBB_Y

int TBB_Y

TBB_WIDTH

int TBB_WIDTH

TBB_HEIGHT

int TBB_HEIGHT

TB_HEIGHT

int TB_HEIGHT

saveFileDialog

public java.awt.FileDialog saveFileDialog

openFileDialog

public java.awt.FileDialog openFileDialog

mainJPanel

public javax.swing.JPanel mainJPanel

JPanel2

public javax.swing.JPanel JPanel2

menuBar

public javax.swing.JMenuBar menuBar

toolBar

public javax.swing.JToolBar toolBar

fileMenu

public javax.swing.JMenu fileMenu

editMenu

public javax.swing.JMenu editMenu

viewMenu

public javax.swing.JMenu viewMenu

toolsMenu

public javax.swing.JMenu toolsMenu

helpMenu

public javax.swing.JMenu helpMenu

optionsMenu

public javax.swing.JMenu optionsMenu

newIcon

protected javax.swing.ImageIcon newIcon

openIcon

protected javax.swing.ImageIcon openIcon

saveIcon

protected javax.swing.ImageIcon saveIcon

revertIcon

protected javax.swing.ImageIcon revertIcon

cutIcon

protected javax.swing.ImageIcon cutIcon

copyIcon

protected javax.swing.ImageIcon copyIcon

pasteIcon

protected javax.swing.ImageIcon pasteIcon

helpIcon

protected javax.swing.ImageIcon helpIcon

newItem

public IXToolItem newItem

openItem

public IXToolItem openItem

saveItem

public IXToolItem saveItem

saveAsItem

public IXToolItem saveAsItem

toolbarItem

public IXToolItem toolbarItem

closeItem

public IXToolItem closeItem

exitItem

public IXToolItem exitItem

revertItem

public IXToolItem revertItem

cutItem

public IXToolItem cutItem

copyItem

public IXToolItem copyItem

pasteItem

public IXToolItem pasteItem

helpItem

public IXToolItem helpItem

manualItem

public IXToolItem manualItem

aboutItem

public IXToolItem aboutItem
Constructor Detail

JFrameMT

public JFrameMT()
Creates a frame with a menu bar, a tool bar, a main panel. Also creates required dialogs (open/save file, about, exit) and handles layout.

JFrameMT

public JFrameMT(java.lang.String title)
Creates a frame (see JFrameMT()) with a given title
Parameters:
title - a string representing the frame's title
Method Detail

makeFrame

public void makeFrame()

makeMenuToolBars

public void makeMenuToolBars()

ensureSaveDialog

public java.awt.FileDialog ensureSaveDialog()

ensureOpenDialog

public java.awt.FileDialog ensureOpenDialog()

makeDefaultMenu

public 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)

makeFileMenu

public void makeFileMenu()

makeFileMenuExits

public void makeFileMenuExits()

makeOptionsMenu

public void makeOptionsMenu()

makeToolbarItem

public void makeToolbarItem(javax.swing.JMenu parentMenu)

makeEditMenu

public void makeEditMenu()

makeViewMenu

public void makeViewMenu()

makeToolsMenu

public void makeToolsMenu()

makeHelpMenu

public void makeHelpMenu()
Make sure that if this is overwritten, adaptDefaultMenu is called elsewhere.

MakeDefaultToolbar

public void MakeDefaultToolbar()

makeDefaultMenuToolbar

public void makeDefaultMenuToolbar()
Makes a default menubar and toolbar. Menus: File, Edit, View, Help

adaptDefaultMenuToolbar

public void adaptDefaultMenuToolbar()
Dummy method that can be overridden by sub-classes to adapt the default.

adaptDefaultMenu

public void adaptDefaultMenu()
Dummy method that can be overridden by sub-classes to adapt the default.

adaptDefaultToolbar

public void adaptDefaultToolbar()
Dummy method that can be overridden by sub-classes to adapt the default.

makeFileMenuTool

public javax.swing.JMenu makeFileMenuTool(javax.swing.JComponent parentMenu)
Makes a default file menu and toolbar buttons. Menu items: new, open, save, save as, S, Options, S, close, exit Toolbar buttons: new, open, save

makeFileMenuToolFiles

public void makeFileMenuToolFiles(javax.swing.JMenu fileMenu)
Makes default file new/open/save/saveAs menu items and toolbar buttons. Menu items: new, open, save, save as, S Toolbar buttons: new, open, save

makeFileMenuToolExits

public void makeFileMenuToolExits(javax.swing.JMenu fileMenu)
Makes default close/exit menu options and and toolbar buttons. Menu items: S, close, exit Toolbar buttons: none

makeOptionsMenuTool

public javax.swing.JMenu makeOptionsMenuTool(javax.swing.JComponent parentMenu)
Makes a default options menu and toolbar buttons. Menu items: cut, copy, paste Toolbar buttons: cut, copy, paste

makeEditMenuTool

public javax.swing.JMenu makeEditMenuTool(javax.swing.JComponent parentMenu)
Makes a default edit menu and toolbar buttons. Menu items: cut, copy, paste Toolbar buttons: cut, copy, paste

makeViewMenuTool

public javax.swing.JMenu makeViewMenuTool(javax.swing.JComponent parentMenu)
Makes a default view menu and toolbar buttons. Menu items: none Toolbar buttons: none

makeToolsMenuTool

public javax.swing.JMenu makeToolsMenuTool(javax.swing.JComponent parentMenu)
Makes a default tools menu and toolbar buttons. Menu items: none Toolbar buttons: none

makeHelpMenuTool

public javax.swing.JMenu makeHelpMenuTool(javax.swing.JComponent parentMenu)
Makes a default help menu and toolbar buttons. Menu items: help, manual, about Toolbar buttons: help

placeToolbarButton

public void placeToolbarButton(javax.swing.JButton button,
                               int x)

makeRadioMenuItem

public 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.
Parameters:
menuParent - the menu that the item should be added to
command - attached to the item for recognising actions
label - displayed in the menu

makeMenu

public javax.swing.JMenu makeMenu(javax.swing.JComponent parent,
                                  java.lang.String label)
Makes a menu and adds it to the given (menu) component. Sets the accelerator to be the first letter of the label
Parameters:
menuParent - the menu that the item should be added to
label - the name of the menu

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

exitApplication

public void exitApplication()

openFile

public void openFile()

saveFile

public void saveFile()

saveFileAs

public void saveFileAs(java.awt.event.ActionEvent event)

toggleToolbar

public void toggleToolbar(boolean on)

exit

public void exit()

aboutDialog

public void aboutDialog()