JHotDraw 7.4.1

org.jhotdraw.gui
Class JSheet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by org.jhotdraw.gui.JSheet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class JSheet
extends javax.swing.JDialog

JSheet is a document modal dialog which is displayed below the title bar of a JFrame.

A JSheet blocks input on its owner window, while it is visible.

Unlike application modal dialogs, the show method of a JSheet does return immediately, when the JSheet has become visible. Applications need to use a SheetListener to get the return value of a JSheet.

Requires Java 1.4.

Caveats: We are using an unsupported API call to make the JSheet translucent. This API may go away in future versions of the Macintosh Runtime for Java. In such a case, we (hopefully) just end up with a non-opaque sheet.

Version:
$Id: JSheet.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.event.EventListenerList listenerList
          Event listener list.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
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, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JSheet(java.awt.Dialog owner)
          Creates a new JSheet.
JSheet(java.awt.Frame owner)
          Creates a new JSheet.
 
Method Summary
 void addNotify()
           
 void addSheetListener(SheetListener l)
          Adds a sheet listener.
 void dispose()
           
protected  void fireOptionSelected(javax.swing.JFileChooser pane, int option)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireOptionSelected(javax.swing.JOptionPane pane)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireOptionSelected(javax.swing.JOptionPane pane, int option, java.lang.Object value, java.lang.Object inputValue)
          Notify all listeners that have registered interest for notification on this event type.
protected  void fireOptionSelected(URIChooser pane, int option)
          Notify all listeners that have registered interest for notification on this event type.
 void hide()
           
protected  void hide0()
           
protected  void installSheet()
          Installs the sheet on the owner.
 boolean isAnimated()
          If this returns true, the JSheet uses a transition effect when shown and when hidden.
protected  boolean isShowAsSheet()
           
 void removeSheetListener(SheetListener l)
          Removes a sheet listener.
static void requestUserAttention(boolean requestCritical)
          Requests attention from user.
 void setAnimated(boolean newValue)
          If this is set to true, the JSheet uses a transition effect when shown and when hidden.
 void show()
           
protected  void show0()
           
static void showConfirmSheet(java.awt.Component parentComponent, java.lang.Object message, int optionType, int messageType, javax.swing.Icon icon, SheetListener listener)
          Brings up a sheet with a specified icon, where the number of choices is determined by the optionType parameter.
static void showConfirmSheet(java.awt.Component parentComponent, java.lang.Object message, int optionType, int messageType, SheetListener listener)
          Brings up a sheet where the number of choices is determined by the optionType parameter, where the messageType parameter determines the icon to display.
static void showConfirmSheet(java.awt.Component parentComponent, java.lang.Object message, int optionType, SheetListener listener)
          Brings up a sheet where the number of choices is determined by the optionType parameter.
static void showConfirmSheet(java.awt.Component parentComponent, java.lang.Object message, SheetListener listener)
          Brings up a sheet with the options Yes, No and Cancel.
static void showInputSheet(java.awt.Component parentComponent, java.lang.Object message, int messageType, javax.swing.Icon icon, java.lang.Object[] selectionValues, java.lang.Object initialSelectionValue, SheetListener listener)
          Prompts the user for input in a sheet where the initial selection, possible selections, and all other options can be specified.
static void showInputSheet(java.awt.Component parentComponent, java.lang.Object message, int messageType, SheetListener listener)
          Shows a sheet requesting input from the user parented to parentComponent and message type messageType.
static void showInputSheet(java.awt.Component parentComponent, java.lang.Object message, java.lang.Object initialSelectionValue, SheetListener listener)
          Shows a question-message sheet requesting input from the user and parented to parentComponent.
static void showInputSheet(java.awt.Component parentComponent, java.lang.Object message, SheetListener listener)
          Shows a question-message sheet requesting input from the user parented to parentComponent.
static void showMessageSheet(java.awt.Component parentComponent, java.lang.Object message)
          Brings up an information-message sheet.
static void showMessageSheet(java.awt.Component parentComponent, java.lang.Object message, int messageType)
          Brings up a sheet that displays a message using a default icon determined by the messageType parameter.
static void showMessageSheet(java.awt.Component parentComponent, java.lang.Object message, int messageType, javax.swing.Icon icon, SheetListener listener)
          Brings up a sheet displaying a message, specifying all parameters.
static void showMessageSheet(java.awt.Component parentComponent, java.lang.Object message, int messageType, SheetListener listener)
          Brings up a sheet that displays a message using a default icon determined by the messageType parameter.
static void showMessageSheet(java.awt.Component parentComponent, java.lang.Object message, SheetListener listener)
          Brings up an information-message sheet.
static void showOpenSheet(javax.swing.JFileChooser chooser, java.awt.Component parent, SheetListener listener)
          Displays an "Open File" file chooser sheet.
static void showOpenSheet(URIChooser chooser, java.awt.Component parent, SheetListener listener)
          Displays an "Open File" file chooser sheet.
static void showOptionSheet(java.awt.Component parentComponent, java.lang.Object message, int optionType, int messageType, javax.swing.Icon icon, java.lang.Object[] options, java.lang.Object initialValue, SheetListener listener)
          Brings up a sheet with a specified icon, where the initial choice is determined by the initialValue parameter and the number of choices is determined by the optionType parameter.
static void showSaveSheet(javax.swing.JFileChooser chooser, java.awt.Component parent, SheetListener listener)
          Displays a "Save File" file chooser sheet.
static void showSaveSheet(URIChooser chooser, java.awt.Component parent, SheetListener listener)
          Displays a "Save File" file chooser sheet.
static void showSheet(javax.swing.JFileChooser chooser, java.awt.Component parent, java.lang.String approveButtonText, SheetListener listener)
          Displays a custom file chooser sheet with a custom approve button.
static void showSheet(javax.swing.JOptionPane pane, java.awt.Component parentComponent, SheetListener listener)
          Displays an option pane as a sheet on its parent window.
static void showSheet(URIChooser chooser, java.awt.Component parent, java.lang.String approveButtonText, SheetListener listener)
          Displays a custom file chooser sheet with a custom approve button.
protected  void uninstallSheet()
          Uninstalls the sheet on the owner.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Dialog
getModalityType, getTitle, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

listenerList

protected javax.swing.event.EventListenerList listenerList
Event listener list.

Constructor Detail

JSheet

public JSheet(java.awt.Frame owner)
Creates a new JSheet.


JSheet

public JSheet(java.awt.Dialog owner)
Creates a new JSheet.

Method Detail

isShowAsSheet

protected boolean isShowAsSheet()

installSheet

protected void installSheet()
Installs the sheet on the owner. This method is invoked just before the JSheet is shown.


uninstallSheet

protected void uninstallSheet()
Uninstalls the sheet on the owner. This method is invoked immediately after the JSheet is hidden.


addNotify

public void addNotify()
Overrides:
addNotify in class java.awt.Dialog

setAnimated

public void setAnimated(boolean newValue)
If this is set to true, the JSheet uses a transition effect when shown and when hidden.


isAnimated

public boolean isAnimated()
If this returns true, the JSheet uses a transition effect when shown and when hidden.


dispose

public void dispose()
Overrides:
dispose in class java.awt.Window

hide0

protected void hide0()

show0

protected void show0()

hide

public void hide()
Overrides:
hide in class java.awt.Dialog

show

public void show()
Overrides:
show in class java.awt.Dialog

requestUserAttention

public static void requestUserAttention(boolean requestCritical)
Requests attention from user. This is invoked when the sheet is opened.


addSheetListener

public void addSheetListener(SheetListener l)
Adds a sheet listener.


removeSheetListener

public void removeSheetListener(SheetListener l)
Removes a sheet listener.


fireOptionSelected

protected void fireOptionSelected(javax.swing.JOptionPane pane)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.


fireOptionSelected

protected void fireOptionSelected(javax.swing.JOptionPane pane,
                                  int option,
                                  java.lang.Object value,
                                  java.lang.Object inputValue)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.


fireOptionSelected

protected void fireOptionSelected(javax.swing.JFileChooser pane,
                                  int option)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.


fireOptionSelected

protected void fireOptionSelected(URIChooser pane,
                                  int option)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.


showSheet

public static void showSheet(javax.swing.JOptionPane pane,
                             java.awt.Component parentComponent,
                             SheetListener listener)
Displays an option pane as a sheet on its parent window.

Parameters:
pane - The option pane.
parentComponent - The parent of the option pane.
listener - The listener for SheetEvents.

showConfirmSheet

public static void showConfirmSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    SheetListener listener)
Brings up a sheet with the options Yes, No and Cancel.

Parameters:
parentComponent - determines the Frame in which the sheet is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
listener - The listener for SheetEvents.

showConfirmSheet

public static void showConfirmSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int optionType,
                                    SheetListener listener)
Brings up a sheet where the number of choices is determined by the optionType parameter.

Parameters:
parentComponent - determines the Frame in which the sheet is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
optionType - an int designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
listener - The listener for SheetEvents.

showConfirmSheet

public static void showConfirmSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int optionType,
                                    int messageType,
                                    SheetListener listener)
Brings up a sheet where the number of choices is determined by the optionType parameter, where the messageType parameter determines the icon to display. The messageType parameter is primarily used to supply a default icon from the Look and Feel.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
optionType - an integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
messageType - an integer designating the kind of message this is; primarily used to determine the icon from the pluggable Look and Feel: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
listener - The listener for SheetEvents.

showConfirmSheet

public static void showConfirmSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int optionType,
                                    int messageType,
                                    javax.swing.Icon icon,
                                    SheetListener listener)
Brings up a sheet with a specified icon, where the number of choices is determined by the optionType parameter. The messageType parameter is primarily used to supply a default icon from the look and feel.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
optionType - an int designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
messageType - an int designating the kind of message this is, primarily used to determine the icon from the pluggable Look and Feel: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
icon - the icon to display in the dialog
listener - The listener for SheetEvents.

showInputSheet

public static void showInputSheet(java.awt.Component parentComponent,
                                  java.lang.Object message,
                                  SheetListener listener)
Shows a question-message sheet requesting input from the user parented to parentComponent.

Parameters:
parentComponent - the parent Component for the dialog
listener - The listener for SheetEvents.

showInputSheet

public static void showInputSheet(java.awt.Component parentComponent,
                                  java.lang.Object message,
                                  java.lang.Object initialSelectionValue,
                                  SheetListener listener)
Shows a question-message sheet requesting input from the user and parented to parentComponent. The input value will be initialized to initialSelectionValue.

Parameters:
parentComponent - the parent Component for the dialog
message - the Object to display
initialSelectionValue - the value used to initialize the input field
listener - The listener for SheetEvents.

showInputSheet

public static void showInputSheet(java.awt.Component parentComponent,
                                  java.lang.Object message,
                                  int messageType,
                                  SheetListener listener)
Shows a sheet requesting input from the user parented to parentComponent and message type messageType.

Parameters:
parentComponent - the parent Component for the dialog
message - the Object to display
messageType - the type of message that is to be displayed: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
listener - The listener for SheetEvents.

showInputSheet

public static void showInputSheet(java.awt.Component parentComponent,
                                  java.lang.Object message,
                                  int messageType,
                                  javax.swing.Icon icon,
                                  java.lang.Object[] selectionValues,
                                  java.lang.Object initialSelectionValue,
                                  SheetListener listener)
Prompts the user for input in a sheet where the initial selection, possible selections, and all other options can be specified. The user will able to choose from selectionValues, where null implies the user can input whatever they wish, usually by means of a JTextField. initialSelectionValue is the initial value to prompt the user with. It is up to the UI to decide how best to represent the selectionValues, but usually a JComboBox, JList, or JTextField will be used.

Parameters:
parentComponent - the parent Component for the dialog
message - the Object to display
messageType - the type of message to be displayed: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
icon - the Icon image to display
selectionValues - an array of Objects that gives the possible selections
initialSelectionValue - the value used to initialize the input field
listener - The listener for SheetEvents.

showMessageSheet

public static void showMessageSheet(java.awt.Component parentComponent,
                                    java.lang.Object message)
Brings up an information-message sheet.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display

showMessageSheet

public static void showMessageSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    SheetListener listener)
Brings up an information-message sheet.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
listener - This listener is notified when the sheet is dismissed.

showMessageSheet

public static void showMessageSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int messageType)
Brings up a sheet that displays a message using a default icon determined by the messageType parameter.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
messageType - the type of message to be displayed: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE

showMessageSheet

public static void showMessageSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int messageType,
                                    SheetListener listener)
Brings up a sheet that displays a message using a default icon determined by the messageType parameter.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
messageType - the type of message to be displayed: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
listener - This listener is notified when the sheet is dismissed.

showMessageSheet

public static void showMessageSheet(java.awt.Component parentComponent,
                                    java.lang.Object message,
                                    int messageType,
                                    javax.swing.Icon icon,
                                    SheetListener listener)
Brings up a sheet displaying a message, specifying all parameters.

Parameters:
parentComponent - determines the Frame in which the sheet is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
messageType - the type of message to be displayed: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
icon - an icon to display in the sheet that helps the user identify the kind of message that is being displayed
listener - This listener is notified when the sheet is dismissed.

showOptionSheet

public static void showOptionSheet(java.awt.Component parentComponent,
                                   java.lang.Object message,
                                   int optionType,
                                   int messageType,
                                   javax.swing.Icon icon,
                                   java.lang.Object[] options,
                                   java.lang.Object initialValue,
                                   SheetListener listener)
Brings up a sheet with a specified icon, where the initial choice is determined by the initialValue parameter and the number of choices is determined by the optionType parameter.

If optionType is YES_NO_OPTION, or YES_NO_CANCEL_OPTION and the options parameter is null, then the options are supplied by the look and feel.

The messageType parameter is primarily used to supply a default icon from the look and feel.

Parameters:
parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, the sheet is displayed as a dialog.
message - the Object to display
optionType - an integer designating the options available on the dialog: YES_NO_OPTION, or YES_NO_CANCEL_OPTION
messageType - an integer designating the kind of message this is, primarily used to determine the icon from the pluggable Look and Feel: JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE, or JOptionPane.PLAIN_MESSAGE
icon - the icon to display in the dialog
options - an array of objects indicating the possible choices the user can make; if the objects are components, they are rendered properly; non-String objects are rendered using their toString methods; if this parameter is null, the options are determined by the Look and Feel
initialValue - the object that represents the default selection for the dialog; only meaningful if options is used; can be null
listener - The listener for SheetEvents.

showSaveSheet

public static void showSaveSheet(javax.swing.JFileChooser chooser,
                                 java.awt.Component parent,
                                 SheetListener listener)
Displays a "Save File" file chooser sheet. Note that the text that appears in the approve button is determined by the L&F.

Parameters:
parent - the parent component of the dialog, can be null.
listener - The listener for SheetEvents.

showOpenSheet

public static void showOpenSheet(javax.swing.JFileChooser chooser,
                                 java.awt.Component parent,
                                 SheetListener listener)
Displays an "Open File" file chooser sheet. Note that the text that appears in the approve button is determined by the L&F.

Parameters:
parent - the parent component of the dialog, can be null.
listener - The listener for SheetEvents.

showSaveSheet

public static void showSaveSheet(URIChooser chooser,
                                 java.awt.Component parent,
                                 SheetListener listener)
Displays a "Save File" file chooser sheet. Note that the text that appears in the approve button is determined by the L&F.

Parameters:
parent - the parent component of the dialog, can be null.
listener - The listener for SheetEvents.

showOpenSheet

public static void showOpenSheet(URIChooser chooser,
                                 java.awt.Component parent,
                                 SheetListener listener)
Displays an "Open File" file chooser sheet. Note that the text that appears in the approve button is determined by the L&F.

Parameters:
parent - the parent component of the dialog, can be null.
listener - The listener for SheetEvents.

showSheet

public static void showSheet(javax.swing.JFileChooser chooser,
                             java.awt.Component parent,
                             java.lang.String approveButtonText,
                             SheetListener listener)
Displays a custom file chooser sheet with a custom approve button.

Parameters:
parent - the parent component of the dialog; can be null
approveButtonText - the text of the ApproveButton
listener - The listener for SheetEvents.

showSheet

public static void showSheet(URIChooser chooser,
                             java.awt.Component parent,
                             java.lang.String approveButtonText,
                             SheetListener listener)
Displays a custom file chooser sheet with a custom approve button.

Parameters:
parent - the parent component of the dialog; can be null
approveButtonText - the text of the ApproveButton
listener - The listener for SheetEvents.

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.