jas2.util
Class JASDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- jas2.util.JASDialog
-
- All Implemented Interfaces:
- java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.DocumentListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants
- Direct Known Subclasses:
- CutAdjustmentDialog, DateChooser, ErrorBox, InstallPluginsUI, PluginDownloadProgress, PluginManagerUI, PropertyDialog, StatsWindow, UpdatePluginsUI
public class JASDialog extends javax.swing.JDialog implements java.awt.event.MouseListener, javax.swing.event.DocumentListenerJASDialog extends the built in java dialog to provide a number of extra features- Automatic placement relative to parent frame
- OK, Cancel, Apply, and Help buttons at the bottom of the dialog box
- Automatic disposal of the dialog when the user hits OK, Cancel or closes the dialog using the window manager
- See Also:
getContentPane(), Serialized Form
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field and Description static intAPPLY_BUTTONInclude this in your flags to include an Apply button.static intCANCEL_BUTTONInclude this in your flags to include a Cancel button.static intHELP_BUTTONInclude this in your flags to include a Help button.static intOK_BUTTONInclude this in your flags to include an OK button.-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor and Description JASDialog(java.awt.Dialog dlg, java.lang.String title)Creates a modal dialog with OK and Cancel buttons.JASDialog(java.awt.Dialog dlg, java.lang.String title, boolean modal)Creates a dialog with OK and Cancel buttons.JASDialog(java.awt.Dialog dlg, java.lang.String t, boolean modal, int flags)Creates a dialog box with any combination of buttons.JASDialog(java.awt.Frame frame, java.lang.String title)Creates a modal dialog with OK and Cancel buttons.JASDialog(java.awt.Frame frame, java.lang.String title, boolean modal)Creates a dialog with OK and Cancel buttons.JASDialog(java.awt.Frame f, java.lang.String t, boolean modal, int flags)Creates a dialog box with any combination of buttons.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidchangedUpdate(javax.swing.event.DocumentEvent e)CallscallEnable()by default.static JASDialogcreate(java.awt.Component c, java.lang.String t, boolean modal, int flags)static JASDialogcreate(java.awt.Frame frame, java.lang.String title)static JASDialogcreate(java.awt.Frame frame, java.lang.String title, boolean modal)voiddefaultPack()Causes default pack; does not move dialog.booleandoModal()Forces a modal display of the dialog boxjava.awt.ContainergetContentPane()Returns the content pane for the JASDialog, which is the panel (not including the buttons) where components can be added.voidinsertUpdate(javax.swing.event.DocumentEvent e)CallscallEnable()by default.voidmouseClicked(java.awt.event.MouseEvent e)Does nothing by default.voidmouseEntered(java.awt.event.MouseEvent e)Does nothing by default.voidmouseExited(java.awt.event.MouseEvent e)Does nothing by default.voidmousePressed(java.awt.event.MouseEvent e)Does nothing by default.voidmouseReleased(java.awt.event.MouseEvent e)Does nothing by default.voidpack()Causes a default pack(), but also places the dialog in the center of the parent frame.voidprocessEvent(java.awt.AWTEvent e)This method is public as an implementation side effect; do not call or override.voidremoveUpdate(javax.swing.event.DocumentEvent e)CallscallEnable()by default.voidsetApplyLabel(java.lang.String label)Set the label on the Apply button.voidsetApplyMnemonic(char mnemonic)Sets the mnnemonic (or keyboard shortcut) for the Apply button.voidsetCancelLabel(java.lang.String label)Set the label on the Cancel button.voidsetCancelMnemonic(char mnemonic)Sets the mnnemonic (or keyboard shortcut) for the Cancel button.voidsetContentPane(java.awt.Container c)Sets the content pane.voidsetHelpTopic(java.lang.String topic)Sets the name for the help topic that the Help button opens.voidsetOKLabel(java.lang.String label)Set the label on the OK button.voidsetOKMnemonic(char mnemonic)Sets the mnnemonic (or keyboard shortcut) for the OK button.voidshow()-
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, toBack
-
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, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, 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, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
OK_BUTTON
public static final int OK_BUTTON
Include this in your flags to include an OK button.- See Also:
- Constant Field Values
-
APPLY_BUTTON
public static final int APPLY_BUTTON
Include this in your flags to include an Apply button.- See Also:
- Constant Field Values
-
CANCEL_BUTTON
public static final int CANCEL_BUTTON
Include this in your flags to include a Cancel button.- See Also:
- Constant Field Values
-
HELP_BUTTON
public static final int HELP_BUTTON
Include this in your flags to include a Help button.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JASDialog
public JASDialog(java.awt.Frame frame, java.lang.String title)Creates a modal dialog with OK and Cancel buttons.- Parameters:
frame- the parent frametitle- the title for the dialog box
-
JASDialog
public JASDialog(java.awt.Frame frame, java.lang.String title, boolean modal)Creates a dialog with OK and Cancel buttons.- Parameters:
frame- the parent frametitle- the title for the dialog boxmodal- whether the dialog box is modal
-
JASDialog
public JASDialog(java.awt.Frame f, java.lang.String t, boolean modal, int flags)Creates a dialog box with any combination of buttons. Use bitwise logic to specify the appropriate flags in theflagsparameter. For example,
JASDialog.OK_BUTTON | JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON
when passed as theflagsparameter will create a button that has an OK button, a Cancel button, and a Help button.- Parameters:
dlg- the parent Dialogtitle- the title for the dialog boxmodal- whether the dialog box is modalflags- option flags
-
JASDialog
public JASDialog(java.awt.Dialog dlg, java.lang.String title)Creates a modal dialog with OK and Cancel buttons.- Parameters:
frame- the parent frametitle- the title for the dialog box
-
JASDialog
public JASDialog(java.awt.Dialog dlg, java.lang.String title, boolean modal)Creates a dialog with OK and Cancel buttons.- Parameters:
dlg- the parent Dialogtitle- the title for the dialog boxmodal- whether the dialog box is modal
-
JASDialog
public JASDialog(java.awt.Dialog dlg, java.lang.String t, boolean modal, int flags)Creates a dialog box with any combination of buttons. Use bitwise logic to specify the appropriate flags in theflagsparameter. For example,
JASDialog.OK_BUTTON | JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON
when passed as theflagsparameter will create a button that has an OK button, a Cancel button, and a Help button.- Parameters:
dlg- the parent Dialogtitle- the title for the dialog boxmodal- whether the dialog box is modalflags- option flags
-
-
Method Detail
-
create
public static JASDialog create(java.awt.Frame frame, java.lang.String title)
-
create
public static JASDialog create(java.awt.Frame frame, java.lang.String title, boolean modal)
-
create
public static JASDialog create(java.awt.Component c, java.lang.String t, boolean modal, int flags)
-
pack
public void pack()
Causes a default pack(), but also places the dialog in the center of the parent frame.- Overrides:
packin classjava.awt.Window- See Also:
Window.pack()
-
defaultPack
public void defaultPack()
Causes default pack; does not move dialog.
-
processEvent
public void processEvent(java.awt.AWTEvent e)
This method is public as an implementation side effect; do not call or override.- Overrides:
processEventin classjava.awt.Window
-
doModal
public boolean doModal()
Forces a modal display of the dialog box- Returns:
- true if the OK button was pushed, otherwise false
-
show
public void show()
- Overrides:
showin classjava.awt.Dialog
-
setOKLabel
public void setOKLabel(java.lang.String label)
Set the label on the OK button. Allows for customized button labels.
-
setOKMnemonic
public void setOKMnemonic(char mnemonic)
Sets the mnnemonic (or keyboard shortcut) for the OK button. If you have changed the label usingsetOKLabel(String)the default mnemonic ('O') may not be appropriate, so use this method to set a better one.- Parameters:
mnemonic- the new key shortcut to use- See Also:
setOKLabel(String)
-
setCancelLabel
public void setCancelLabel(java.lang.String label)
Set the label on the Cancel button. Allows for customized button labels.
-
setCancelMnemonic
public void setCancelMnemonic(char mnemonic)
Sets the mnnemonic (or keyboard shortcut) for the Cancel button. If you have changed the label usingsetCancelLabel(String)the default mnemonic ('C') may not be appropriate, so use this method to set a better one.- Parameters:
mnemonic- the new key shortcut to use- See Also:
setCancelLabel(String)
-
setApplyLabel
public void setApplyLabel(java.lang.String label)
Set the label on the Apply button. Allows for customized button labels.
-
setApplyMnemonic
public void setApplyMnemonic(char mnemonic)
Sets the mnnemonic (or keyboard shortcut) for the Apply button. If you have changed the label usingsetApplyLabel(String)the default mnemonic ('A') may not be appropriate, so use this method to set a better one.- Parameters:
mnemonic- the new key shortcut to use- See Also:
setApplyLabel(String)
-
getContentPane
public java.awt.Container getContentPane()
Returns the content pane for the JASDialog, which is the panel (not including the buttons) where components can be added. Add components to this container to have them appear in the dialog.- Specified by:
getContentPanein interfacejavax.swing.RootPaneContainer- Overrides:
getContentPanein classjavax.swing.JDialog
-
setContentPane
public void setContentPane(java.awt.Container c)
Sets the content pane. The buttons are not members of this content pane.- Specified by:
setContentPanein interfacejavax.swing.RootPaneContainer- Overrides:
setContentPanein classjavax.swing.JDialog
-
setHelpTopic
public final void setHelpTopic(java.lang.String topic)
Sets the name for the help topic that the Help button opens. Note: This is now being used to set the XML target for JavaHelp.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Does nothing by default. To use this class as a MouseListener, override only the method(s) you need.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
insertUpdate
public void insertUpdate(javax.swing.event.DocumentEvent e)
CallscallEnable()by default. To use this class as a DocumentListener, override only the method(s) you need.- Specified by:
insertUpdatein interfacejavax.swing.event.DocumentListener- See Also:
callEnable()
-
removeUpdate
public void removeUpdate(javax.swing.event.DocumentEvent e)
CallscallEnable()by default. To use this class as a DocumentListener, override only the method(s) you need.- Specified by:
removeUpdatein interfacejavax.swing.event.DocumentListener- See Also:
callEnable()
-
changedUpdate
public void changedUpdate(javax.swing.event.DocumentEvent e)
CallscallEnable()by default. To use this class as a DocumentListener, override only the method(s) you need.- Specified by:
changedUpdatein interfacejavax.swing.event.DocumentListener- See Also:
callEnable()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG