jwo.utils.gui
Class JWFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jwo.utils.gui.JWFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Runnable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
GUI3d, GUIFrame, ScriptEditor

public class JWFrame
extends JFrame
implements Runnable

Creates a containing window with status, progress, menu and toolbar options. If this window contains any buttons on its toolbar, it must contain equivalent menu items. Menu items need not have equivalent toolbar buttons.

Menus are aligned with space for iconic representation. If icons are used they should be all the same size (16x16 recommended). Alignment is forced by inserting blank icons of the same size where necessary. This icon should be located at images/blank.gif in the classpath of the VM that uses this class.

Version:
2.3, 4th December, 2007.
Author:
Jo Wood.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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, 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
JWFrame(String title)
          Creates a top-level window with a given title.
JWFrame(String title, String iconName, boolean showMenu, boolean showTools, boolean showStatus)
          Creates a top-level window with various decoration options.
 
Method Summary
 JMenuItem addActionItem(int type, JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ActionListener listener)
          Adds a given menu and button item.
 JMenuItem addActionItem(int type, JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ButtonGroup bg, ActionListener listener)
          Adds a given menu and button item.
 JMenuItem addActionItem(JMenuItem menu, String name, int mnemonic, ActionListener listener)
          Adds a given menu item to a given menu.
 JMenuItem addActionItem(JMenuItem menu, String name, String icon, int mnemonic, ActionListener listener)
          Adds given menu and button items.
 JMenuItem addActionItem(JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ActionListener listener)
          Adds a given menu and button item.
 JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, int mnemonic, ActionListener listener)
          Adds a given checkbox menu item to a given menu.
 JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, int mnemonic, ButtonGroup bg, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, ButtonGroup bg, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, int accelerator, ButtonGroup bg, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, ActionListener listener)
          Adds a given checkbox menu item to a given menu.
 JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, ButtonGroup bg, ActionListener listener)
          Adds a given checkbox menu item to a given menu.
 JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, int accelerator, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, String icon, int mnemonic, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 JMenuItem addBinActionItem(JMenuItem menu, String name, String icon, int mnemonic, ButtonGroup bg, ActionListener listener)
          Adds given checkbox menu and toggle button items.
 void addButtonSeparator()
          Adds a separator to the tool bar.
 void addInterruptionListener(JWInterruptionListener interruptionListener)
          Adds the given interruption listener to this window.
 JMenu addMenu(JComponent parent, String name, int mnemonic)
          Adds a given menu with mnemonic to a component such as a menu bar or sub menu.
 JMenu addMenu(String name)
          Adds a given menu without mnemonic to menu bar.
 JMenu addMenu(String name, int mnemonic)
          Adds a given menu with mnemonic to menu bar.
 void addMenuSeparator(JMenu menu)
          Adds a separator to the given menu.
protected  void closeDown()
          Asks the user if they really want to quit, then closes.
 Action getAction(String name)
          Returns the action item (button or menu item) associated with the given name.
protected  void initWindow()
          Performs any window initialisation that is required after the frame has been displayed.
 boolean removeInterruptionListener(JWInterruptionListener interruptionListener)
          Removes the given interruption listener from this window.
 void run()
          Displays the frame as part of a threaded process.
 void setMaxProgress(int maxProgress)
          Displays the maximum progress value.
 void setMessage(String text)
          Displays the given message in the status bar.
 void setMinProgress(int minProgress)
          Displays the minimum progress value.
 void setProgress(int progress)
          Sets the current progress (should be between 0 and 100 unless minimum or maximum progress values have been changed.
 void showProgress(boolean visible)
          Shows or removes the progress bar from the frame.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, 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, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
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
 

Constructor Detail

JWFrame

public JWFrame(String title)
Creates a top-level window with a given title. Assumes that an icon file called Icon16.gif is located in he 'images' subdirectory.

Parameters:
title - Title of window.

JWFrame

public JWFrame(String title,
               String iconName,
               boolean showMenu,
               boolean showTools,
               boolean showStatus)
Creates a top-level window with various decoration options.

Parameters:
title - Title of window.
iconName - Name of file containing icon. File should be a .gif or .jpeg in the 'images' subdirectory.
showMenu - Menu will be displayed if true;
showTools - Toolbar will be displayed if true;
showStatus - Statusbar will be displayed if true;
Method Detail

addMenu

public JMenu addMenu(String name)
Adds a given menu without mnemonic to menu bar.

Parameters:
name - Name on menu to add.
Returns:
Reference to the menu just created. This is useful for adding menu items.

addMenu

public JMenu addMenu(String name,
                     int mnemonic)
Adds a given menu with mnemonic to menu bar.

Parameters:
name - Name on menu to add.
mnemonic - Keyboard mnemonic to use.
Returns:
Reference to the menu just created. This is useful for adding menu items.

addMenu

public JMenu addMenu(JComponent parent,
                     String name,
                     int mnemonic)
Adds a given menu with mnemonic to a component such as a menu bar or sub menu.

Parameters:
parent - Component onto which a menu is added.
name - Name on menu to add.
mnemonic - Keyboard mnemonic to use.
Returns:
Reference to the menu just created. This is useful for adding menu items.

addMenuSeparator

public void addMenuSeparator(JMenu menu)
Adds a separator to the given menu. This should be called in sequence between adding other menus/menu items to the menu.

Parameters:
menu - Menu onto which a separator.

addButtonSeparator

public void addButtonSeparator()
Adds a separator to the tool bar. This should be called in sequence between adding other items to the toolbar.


addActionItem

public JMenuItem addActionItem(JMenuItem menu,
                               String name,
                               int mnemonic,
                               ActionListener listener)
Adds a given menu item to a given menu.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addActionItem

public JMenuItem addActionItem(JMenuItem menu,
                               String name,
                               String icon,
                               int mnemonic,
                               ActionListener listener)
Adds given menu and button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addActionItem

public JMenuItem addActionItem(JMenuItem menu,
                               String name,
                               String icon,
                               int mnemonic,
                               int accelerator,
                               ActionListener listener)
Adds a given menu and button item.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
accelerator - Keyboard accelerator to use. Uses the system-dependent mask (e.g. CTRL on windows, Command on MacOS).
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addActionItem

public JMenuItem addActionItem(int type,
                               JMenuItem menu,
                               String name,
                               String icon,
                               int mnemonic,
                               int accelerator,
                               ActionListener listener)
Adds a given menu and button item.

Parameters:
type - Type of menu (NORMAL, CHECKBOX).
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
accelerator - Keyboard accelerator to use. Uses the system-dependent mask (e.g. CTRL on windows, Command on MacOS).
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  int mnemonic,
                                  ActionListener listener)
Adds a given checkbox menu item to a given menu.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  boolean isSelected,
                                  int mnemonic,
                                  ActionListener listener)
Adds a given checkbox menu item to a given menu.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
isSelected - Item will be selected if true.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  int mnemonic,
                                  ButtonGroup bg,
                                  ActionListener listener)
Adds a given checkbox menu item to a given menu.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
mnemonic - Keyboard mnemonic to use.
bg - Button group for grouped toggle buttons/checkboxes.
listener - Action listener to respond to menu selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  String icon,
                                  int mnemonic,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items. Assumes added item is not selected.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  boolean isSelected,
                                  String icon,
                                  int mnemonic,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
isSelected - Item will be selected if true.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  String icon,
                                  int mnemonic,
                                  ButtonGroup bg,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
bg - Button group for grouped toggle buttons/checkboxes.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  boolean isSelected,
                                  int mnemonic,
                                  ButtonGroup bg,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
isSelected - Item will be selected if true.
mnemonic - Keyboard mnemonic to use.
bg - Button group for grouped toggle buttons/checkboxes.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  boolean isSelected,
                                  String icon,
                                  int mnemonic,
                                  ButtonGroup bg,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
isSelected - Item will be selected if true.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
bg - Button group for grouped toggle buttons/checkboxes.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  int mnemonic,
                                  int accelerator,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
mnemonic - Keyboard mnemonic to use.
accelerator - Keyboard accelerator to use. Uses the system-dependent mask (e.g. CTRL on windows, Command on MacOS).
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addBinActionItem

public JMenuItem addBinActionItem(JMenuItem menu,
                                  String name,
                                  boolean isSelected,
                                  String icon,
                                  int mnemonic,
                                  int accelerator,
                                  ButtonGroup bg,
                                  ActionListener listener)
Adds given checkbox menu and toggle button items.

Parameters:
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
isSelected - Item will be selected if true.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
accelerator - Keyboard accelerator to use. Uses the system-dependent mask (e.g. CTRL on windows, Command on MacOS).
bg - Button group for grouped toggle buttons/checkboxes.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

addActionItem

public JMenuItem addActionItem(int type,
                               JMenuItem menu,
                               String name,
                               String icon,
                               int mnemonic,
                               int accelerator,
                               ButtonGroup bg,
                               ActionListener listener)
Adds a given menu and button item.

Parameters:
type - Type of menu (NORMAL, CHECKBOX).
menu - Menu onto which this menu item is added.
name - Name on the new menu item to add.
icon - Name of file containing icon or null if no icon.
mnemonic - Keyboard mnemonic to use.
accelerator - Keyboard accelerator to use. Uses the system-dependent mask (e.g. CTRL on windows, Command on MacOS).
bg - Button group for linking items together.
listener - Action listener to respond to menu or button selection.
Returns:
Reference to the menu item just created. This is useful for adding sub-menus.

getAction

public Action getAction(String name)
Returns the action item (button or menu item) associated with the given name.

Parameters:
name - Name of action item to search for. Should be lower case without ellipsis.
Returns:
The first action item that has the given name, or null of nothing found. Should be all lower case and without ellipsis.

setMessage

public void setMessage(String text)
Displays the given message in the status bar.

Parameters:
text - Message to display.

setMinProgress

public void setMinProgress(int minProgress)
Displays the minimum progress value.

Parameters:
minProgress - Minimum progress value.

setMaxProgress

public void setMaxProgress(int maxProgress)
Displays the maximum progress value.

Parameters:
maxProgress - Maximum progress value.

setProgress

public void setProgress(int progress)
Sets the current progress (should be between 0 and 100 unless minimum or maximum progress values have been changed.

Parameters:
progress - progress value.

showProgress

public void showProgress(boolean visible)
Shows or removes the progress bar from the frame.

Parameters:
visible - Progress bar will be visible if true;

addInterruptionListener

public void addInterruptionListener(JWInterruptionListener interruptionListener)
Adds the given interruption listener to this window. The listener will be informed whenever the progress bar is clicked.

Parameters:
interruptionListener - Object to be informed of an interruption request.

removeInterruptionListener

public boolean removeInterruptionListener(JWInterruptionListener interruptionListener)
Removes the given interruption listener from this window.

Parameters:
interruptionListener - Listener to be removed.
Returns:
True if listener was present and has been successfully removed.

run

public void run()
Displays the frame as part of a threaded process. This can be used when called with EventQueue.invokeLater() to ensure that the window is invoked in a thread-safe manner.

Specified by:
run in interface Runnable

initWindow

protected void initWindow()
Performs any window initialisation that is required after the frame has been displayed. Not usually required, but this can be overridden for subclasses that need to perform some dynamic display changes or need to capture the graphics context of this frame.


closeDown

protected void closeDown()
Asks the user if they really want to quit, then closes.



Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009