jas.util
Class JASDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--jas.util.JASDialog
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.DocumentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, javax.swing.RootPaneContainer, java.io.Serializable, 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.DocumentListener

JASDialog extends the built in java dialog to provide a number of extra features

To make components visible on this dialog, add them to the content pane.

See Also:
getContentPane(), Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
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
 
Field Summary
static int APPLY_BUTTON
          Include this in your flags to include an Apply button.
static int CANCEL_BUTTON
          Include this in your flags to include a Cancel button.
static int HELP_BUTTON
          Include this in your flags to include a Help button.
static int OK_BUTTON
          Include this in your flags to include an OK button.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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
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
protected  void callEnable()
          Forces the dialog to re-evaluate button enabling.
 void changedUpdate(javax.swing.event.DocumentEvent e)
          Calls callEnable() by default.
 void defaultPack()
          Causes default pack; does not move dialog.
 boolean doModal()
          Forces a modal display of the dialog box
protected  void enableApply(JASState state)
          Override to customize when Apply is enabled.
protected  void enableHelp(JASState state)
          Override to customize when Help is enabled.
protected  void enableOK(JASState state)
          Override to customize when OK is enabled.
 java.awt.Container getContentPane()
          Returns the content pane for the JASDialog, which is the panel (not including the buttons) where components can be added.
 void insertUpdate(javax.swing.event.DocumentEvent e)
          Calls callEnable() by default.
 void mouseClicked(java.awt.event.MouseEvent e)
          Does nothing by default.
 void mouseEntered(java.awt.event.MouseEvent e)
          Does nothing by default.
 void mouseExited(java.awt.event.MouseEvent e)
          Does nothing by default.
 void mousePressed(java.awt.event.MouseEvent e)
          Does nothing by default.
 void mouseReleased(java.awt.event.MouseEvent e)
          Does nothing by default.
protected  void onApply()
          Called when the Apply button is pushed.
protected  void onCancel()
          Called when the Cancel button is pushed.
protected  void onOK()
          Called when the OK button is pushed.
 void pack()
          Causes a default pack(), but also places the dialog in the center of the parent frame.
 void processEvent(java.awt.AWTEvent e)
          This method is public as an implementation side effect; do not call or override.
 void removeUpdate(javax.swing.event.DocumentEvent e)
          Calls callEnable() by default.
 void setApplyLabel(java.lang.String label)
          Set the label on the Apply button.
 void setApplyMnemonic(char mnemonic)
          Sets the mnnemonic (or keyboard shortcut) for the Apply button.
 void setCancelLabel(java.lang.String label)
          Set the label on the Cancel button.
 void setCancelMnemonic(char mnemonic)
          Sets the mnnemonic (or keyboard shortcut) for the Cancel button.
 void setContentPane(java.awt.Container c)
          Sets the content pane.
 void setHelpTopic(java.lang.String topic)
          Sets the name for the help topic that the Help button opens.
 void setOKLabel(java.lang.String label)
          Set the label on the OK button.
 void setOKMnemonic(char mnemonic)
          Sets the mnnemonic (or keyboard shortcut) for the OK button.
 void show()
           
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, postEvent, removeWindowListener, setCursor, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, remove, 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
 

Field Detail

OK_BUTTON

public static final int OK_BUTTON
Include this in your flags to include an OK button.

APPLY_BUTTON

public static final int APPLY_BUTTON
Include this in your flags to include an Apply button.

CANCEL_BUTTON

public static final int CANCEL_BUTTON
Include this in your flags to include a Cancel button.

HELP_BUTTON

public static final int HELP_BUTTON
Include this in your flags to include a Help button.
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 frame
title - 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 frame
title - the title for the dialog box
modal - 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 the flags parameter. For example,
JASDialog.OK_BUTTON | JASDialog.CANCEL_BUTTON | JASDialog.HELP_BUTTON
when passed as the flags parameter will create a button that has an OK button, a Cancel button, and a Help button.
Parameters:
frame - the parent frame
title - the title for the dialog box
modal - whether the dialog box is modal
flags - option flags
Method Detail

pack

public void pack()
Causes a default pack(), but also places the dialog in the center of the parent frame.
Overrides:
pack in class java.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:
processEvent in class java.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:
show in class java.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 using setOKLabel(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 using setCancelLabel(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 using setApplyLabel(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)

onOK

protected void onOK()
Called when the OK button is pushed. Override to provide customized functionality for derived dialog boxes.

onCancel

protected void onCancel()
Called when the Cancel button is pushed. Override to provide customized functionality for derived dialog boxes.

onApply

protected void onApply()
Called when the Apply button is pushed. Override to provide customized functionality for derived dialog boxes.

callEnable

protected void callEnable()
Forces the dialog to re-evaluate button enabling.

enableOK

protected void enableOK(JASState state)
Override to customize when OK is enabled. OK is enabled by default.

enableHelp

protected void enableHelp(JASState state)
Override to customize when Help is enabled. By default, Help is enabled if both a help book and help topic have been set.
See Also:
setHelpTopic(String)

enableApply

protected void enableApply(JASState state)
Override to customize when Apply is enabled. By default, Apply is disenabled.

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.
Overrides:
getContentPane in class javax.swing.JDialog

setContentPane

public void setContentPane(java.awt.Container c)
Sets the content pane. The buttons are not members of this content pane.
Overrides:
setContentPane in class javax.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:
mouseClicked in interface java.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:
mousePressed in interface java.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:
mouseReleased in interface java.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:
mouseEntered in interface java.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:
mouseExited in interface java.awt.event.MouseListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
See Also:
callEnable()

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
See Also:
callEnable()

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Calls callEnable() by default. To use this class as a DocumentListener, override only the method(s) you need.
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener
See Also:
callEnable()