|
|||||||||
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 jwo.utils.gui.JWFrame
public class JWFrame
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.
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 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.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Constructor Detail |
---|
public JWFrame(String title)
title
- Title of window.public JWFrame(String title, String iconName, boolean showMenu, boolean showTools, boolean showStatus)
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 |
---|
public JMenu addMenu(String name)
name
- Name on menu to add.
public JMenu addMenu(String name, int mnemonic)
name
- Name on menu to add.mnemonic
- Keyboard mnemonic to use.
public JMenu addMenu(JComponent parent, String name, int mnemonic)
parent
- Component onto which a menu is added.name
- Name on menu to add.mnemonic
- Keyboard mnemonic to use.
public void addMenuSeparator(JMenu menu)
menu
- Menu onto which a separator.public void addButtonSeparator()
public JMenuItem addActionItem(JMenuItem menu, String name, int mnemonic, ActionListener listener)
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.
public JMenuItem addActionItem(JMenuItem menu, String name, String icon, int mnemonic, ActionListener listener)
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.
public JMenuItem addActionItem(JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ActionListener listener)
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.
public JMenuItem addActionItem(int type, JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, int mnemonic, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, ButtonGroup bg, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, String icon, int mnemonic, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, String icon, int mnemonic, ButtonGroup bg, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, int mnemonic, ButtonGroup bg, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, ButtonGroup bg, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, int mnemonic, int accelerator, ActionListener listener)
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.
public JMenuItem addBinActionItem(JMenuItem menu, String name, boolean isSelected, String icon, int mnemonic, int accelerator, ButtonGroup bg, ActionListener listener)
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.
public JMenuItem addActionItem(int type, JMenuItem menu, String name, String icon, int mnemonic, int accelerator, ButtonGroup bg, ActionListener listener)
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.
public Action getAction(String name)
name
- Name of action item to search for. Should be lower case without ellipsis.
public void setMessage(String text)
text
- Message to display.public void setMinProgress(int minProgress)
minProgress
- Minimum progress value.public void setMaxProgress(int maxProgress)
maxProgress
- Maximum progress value.public void setProgress(int progress)
progress
- progress value.public void showProgress(boolean visible)
visible
- Progress bar will be visible if true;public void addInterruptionListener(JWInterruptionListener interruptionListener)
interruptionListener
- Object to be informed of an
interruption request.public boolean removeInterruptionListener(JWInterruptionListener interruptionListener)
interruptionListener
- Listener to be removed.
public void run()
run
in interface Runnable
protected void initWindow()
protected void closeDown()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |