Package diva.gui
Class ApplicationContext
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- diva.gui.ApplicationContext
-
- All Implemented Interfaces:
AppContext,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible,javax.swing.RootPaneContainer,javax.swing.WindowConstants
- Direct Known Subclasses:
BasicFrame
public class ApplicationContext extends javax.swing.JFrame implements AppContext
A context for an application in the diva.gui infrastructure. This class represents an AppContext as a JFrame. Generally, all this class does is to pipe the AppContext method through to the appropriate method in the JFrame class. In addition, a listener is attached to the frame that fires the context's exit action when a WINDOW_CLOSING event is created. In this class, the default exit action kills the JVM. This class does not contain a menu bar or a toolbar by default.- Version:
- $Id$
- Author:
- Steve Neuendorffer, Michael Shilman, John Reekie
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
-
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
-
-
Constructor Summary
Constructors Constructor Description ApplicationContext()Create a new ApplicationContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.ActiongetExitAction()Return the action that is called back when the user exits the app.java.awt.ImagegetIconImage()Get the image that represents this frame.javax.swing.JMenuBargetJMenuBar()Return the menu bar that the container uses.java.lang.StringgetTitle()Return the title of the context.booleanisVisible()Return whether or not the frame is visible.java.awt.ComponentmakeComponent()Return "this" as a component.voidsetExitAction(javax.swing.Action exitAction)Set the action that is called back when the user exits the app.voidsetIconImage(java.awt.Image image)Set the icon that represents this frame.voidsetJMenuBar(javax.swing.JMenuBar menu)Set the menu bar that the container uses.voidsetTitle(java.lang.String title)Set the title of the context.voidsetVisible(boolean visible)Set the frame's visibility.voidshowStatus(java.lang.String status)Show the given status string at the bottom of the context.-
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, isPreferredSizeSet, isValid, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface diva.gui.AppContext
setSize
-
-
-
-
Constructor Detail
-
ApplicationContext
public ApplicationContext()
Create a new ApplicationContext. Add a hook to the frame that will cause the exit action to be fired when a user attempts to close the window. Set the default close operation of the frame to be DO_NOTHING_ON_CLOSE, since this is handled by the default exit action.
-
-
Method Detail
-
getExitAction
public javax.swing.Action getExitAction()
Return the action that is called back when the user exits the app.- Specified by:
getExitActionin interfaceAppContext
-
getIconImage
public java.awt.Image getIconImage()
Get the image that represents this frame.- Specified by:
getIconImagein interfaceAppContext- Overrides:
getIconImagein classjava.awt.Frame
-
getTitle
public java.lang.String getTitle()
Return the title of the context.- Specified by:
getTitlein interfaceAppContext- Overrides:
getTitlein classjava.awt.Frame
-
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
Return the menu bar that the container uses.- Specified by:
getJMenuBarin interfaceAppContext- Overrides:
getJMenuBarin classjavax.swing.JFrame
-
isVisible
public boolean isVisible()
Return whether or not the frame is visible.- Specified by:
isVisiblein interfaceAppContext- Overrides:
isVisiblein classjava.awt.Component
-
makeComponent
public java.awt.Component makeComponent()
Return "this" as a component.- Specified by:
makeComponentin interfaceAppContext
-
showStatus
public void showStatus(java.lang.String status)
Show the given status string at the bottom of the context. This base class does nothing.- Specified by:
showStatusin interfaceAppContext
-
setVisible
public void setVisible(boolean visible)
Set the frame's visibility.- Specified by:
setVisiblein interfaceAppContext- Overrides:
setVisiblein classjava.awt.Window
-
setExitAction
public void setExitAction(javax.swing.Action exitAction)
Set the action that is called back when the user exits the app.- Specified by:
setExitActionin interfaceAppContext
-
setTitle
public void setTitle(java.lang.String title)
Set the title of the context.- Specified by:
setTitlein interfaceAppContext- Overrides:
setTitlein classjava.awt.Frame
-
setIconImage
public void setIconImage(java.awt.Image image)
Set the icon that represents this frame.- Specified by:
setIconImagein interfaceAppContext- Overrides:
setIconImagein classjavax.swing.JFrame
-
setJMenuBar
public void setJMenuBar(javax.swing.JMenuBar menu)
Set the menu bar that the container uses.- Specified by:
setJMenuBarin interfaceAppContext- Overrides:
setJMenuBarin classjavax.swing.JFrame
-
-