All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.basic.BasicOptionPaneUI

java.lang.Object
   |
   +----com.sun.java.swing.plaf.ComponentUI
           |
           +----com.sun.java.swing.plaf.OptionPaneUI
                   |
                   +----com.sun.java.swing.basic.AbstractOptionPaneUI
                           |
                           +----com.sun.java.swing.basic.BasicOptionPaneUI

public class BasicOptionPaneUI
extends AbstractOptionPaneUI
implements PropertyChangeListener
Provides the basic look and feel for a JOptionPane.


Variable Index

 o checkedIcons
Set to true when one of the default icons has been attempted to be loaded.
 o defaultBorder
 o defaultIcons
Icons for the different types of message panes.
 o defaultOptions
Default option names, when none are supplied.
 o iconNames
Names for the different types of images.
 o inputComponent
JComponent provide for input if optionPane.getWantsInput() returns true.
 o MIN_HEIGHT
Minimum height for the Component.
 o MIN_WIDTH
Minimum width for the Component.
 o okCancelOptions
Option names for OK_CANCEL_OPTION.
 o optionPane
JOptionPane that the reciever is providing the look and feel for.
 o yesNoCancelOptions
Options names for YES_NO_CANCEL_OPTION.
 o yesNoOptions
Option names for YES_NO_OPTION.

Constructor Index

 o BasicOptionPaneUI()

Method Index

 o createdButtonFired(int)
Messaged when a JButton as created from validateComponent is clicked Invokes setValue on the JOptionPane with the appropriate value.
 o createUI(JComponent)
Creates a new BasicOptionPaneUI instance.
 o getButtons()
Returns the buttons to display from the JOptionPane the receiver is providing the look and feel for.
 o getContainer()
Returns the JOptionPane the receiver is providing the look and feel for.
 o getIcon()
Returns the icon from the JOptionPane the reciever is providing the look and feel for, or the default icon as returned from getDefaultIcon.
 o getIconForType(int)
Returns the icon to use for the passed in type.
 o getInitialIndex()
Returns the initial index into the buttons to select.
 o getInsets(JComponent)
Returns a copy of AbstractOptionPaneUI.defaultInsets.
 o getMaximumSize(JComponent)
Messages getPreferredSize.
 o getMessage()
Returns the message to display from the JMessagePane the receiver is providing the look and feel for.
 o getMinimumSize(JComponent)
Messages getPreferredSize.
 o getPreferredSize(JComponent)
If c is the JOptionPane the reciever is contained in, the preferred size that is returned is the maximum of the preferred size of the LayoutManager for the JOptionPane, and BasicOptionPaneUI.MIN_WIDTH, BasicOptionPaneUI.MAX_WIDTH.
 o getSizeButtonsToSameWidth()
Returns true, basic L&F wants all the buttons to have the same width.
 o installUI(JComponent)
Installs the reciever as the L&F for the passed in JOptionPane
 o paint(Graphics, JComponent)
Fills the backround if the component is opaque.
 o propertyChange(PropertyChangeEvent)
If the source of the PropertyChangeEvent e equals the optionPane and is one of the ICON_PROPERTY, MESSAGE_PROPERTY, OPTIONS_PROPERTY or INITIAL_VALUE_PROPERTY, validateComponent is invoked.
 o resetInputValue()
Sets the input value in the option pane the receiver is providing the look and feel for based on the value in the inputComponent.
 o selectInitialValue()
If inputComponent is non-null, the focus is requested on that, otherwise super is messaged.
 o uninstallUI(JComponent)
Removes the receiver from the L&F controller of the passed in split pane.

Variables

 o MIN_WIDTH
 public static final int MIN_WIDTH
Minimum width for the Component.

 o MIN_HEIGHT
 public static final int MIN_HEIGHT
Minimum height for the Component.

 o iconNames
 protected static String iconNames[]
Names for the different types of images.

 o defaultIcons
 protected static Icon defaultIcons[]
Icons for the different types of message panes.

 o checkedIcons
 protected static boolean checkedIcons[]
Set to true when one of the default icons has been attempted to be loaded.

 o yesNoOptions
 public static final String yesNoOptions[]
Option names for YES_NO_OPTION.

 o yesNoCancelOptions
 public static final String yesNoCancelOptions[]
Options names for YES_NO_CANCEL_OPTION.

 o defaultOptions
 public static final String defaultOptions[]
Default option names, when none are supplied.

 o okCancelOptions
 public static final String okCancelOptions[]
Option names for OK_CANCEL_OPTION.

 o defaultBorder
 protected static final EmptyBorder defaultBorder
 o optionPane
 protected JOptionPane optionPane
JOptionPane that the reciever is providing the look and feel for.

 o inputComponent
 protected JComponent inputComponent
JComponent provide for input if optionPane.getWantsInput() returns true.

Constructors

 o BasicOptionPaneUI
 public BasicOptionPaneUI()

Methods

 o getIconForType
 public static Icon getIconForType(int messageType)
Returns the icon to use for the passed in type.

 o createUI
 public static ComponentUI createUI(JComponent x)
Creates a new BasicOptionPaneUI instance.

 o installUI
 public void installUI(JComponent c)
Installs the reciever as the L&F for the passed in JOptionPane

Overrides:
installUI in class ComponentUI
 o uninstallUI
 public void uninstallUI(JComponent c)
Removes the receiver from the L&F controller of the passed in split pane.

Overrides:
uninstallUI in class ComponentUI
 o propertyChange
 public void propertyChange(PropertyChangeEvent e)
If the source of the PropertyChangeEvent e equals the optionPane and is one of the ICON_PROPERTY, MESSAGE_PROPERTY, OPTIONS_PROPERTY or INITIAL_VALUE_PROPERTY, validateComponent is invoked.

 o getIcon
 public Icon getIcon()
Returns the icon from the JOptionPane the reciever is providing the look and feel for, or the default icon as returned from getDefaultIcon.

Overrides:
getIcon in class AbstractOptionPaneUI
 o getMessage
 public Object getMessage()
Returns the message to display from the JMessagePane the receiver is providing the look and feel for.

Overrides:
getMessage in class AbstractOptionPaneUI
 o getButtons
 public Object[] getButtons()
Returns the buttons to display from the JOptionPane the receiver is providing the look and feel for. If the JOptionPane has options set, they will be provided, otherwise if the optionType is YES_NO_OPTION, yesNoOptions is returned, if the type is YES_NO_CANCEL_OPTION yesNoCancelOptions is returned, otherwise defaultButtons are returned.

Overrides:
getButtons in class AbstractOptionPaneUI
 o getContainer
 public Container getContainer()
Returns the JOptionPane the receiver is providing the look and feel for.

Overrides:
getContainer in class AbstractOptionPaneUI
 o getInitialIndex
 public int getInitialIndex()
Returns the initial index into the buttons to select. The index is calculated from the initial value from the JOptionPane and options of the JOptionPane or 0.

Overrides:
getInitialIndex in class AbstractOptionPaneUI
 o resetInputValue
 protected void resetInputValue()
Sets the input value in the option pane the receiver is providing the look and feel for based on the value in the inputComponent.

 o createdButtonFired
 protected void createdButtonFired(int buttonIndex)
Messaged when a JButton as created from validateComponent is clicked Invokes setValue on the JOptionPane with the appropriate value.

If you are creating your own look and feel and subclassing this be sure to set the value to an Integer value representing YES_OPTION, NO_OPTION or CANCEL_OPTION.

Overrides:
createdButtonFired in class AbstractOptionPaneUI
 o getPreferredSize
 public Dimension getPreferredSize(JComponent c)
If c is the JOptionPane the reciever is contained in, the preferred size that is returned is the maximum of the preferred size of the LayoutManager for the JOptionPane, and BasicOptionPaneUI.MIN_WIDTH, BasicOptionPaneUI.MAX_WIDTH.

Overrides:
getPreferredSize in class ComponentUI
 o getMinimumSize
 public Dimension getMinimumSize(JComponent c)
Messages getPreferredSize.

Overrides:
getMinimumSize in class ComponentUI
 o getMaximumSize
 public Dimension getMaximumSize(JComponent c)
Messages getPreferredSize.

Overrides:
getMaximumSize in class ComponentUI
 o getInsets
 public Insets getInsets(JComponent c)
Returns a copy of AbstractOptionPaneUI.defaultInsets.

 o paint
 public void paint(Graphics g,
                   JComponent c)
Fills the backround if the component is opaque.

Overrides:
paint in class ComponentUI
 o getSizeButtonsToSameWidth
 public boolean getSizeButtonsToSameWidth()
Returns true, basic L&F wants all the buttons to have the same width.

Overrides:
getSizeButtonsToSameWidth in class AbstractOptionPaneUI
 o selectInitialValue
 public void selectInitialValue()
If inputComponent is non-null, the focus is requested on that, otherwise super is messaged.

Overrides:
selectInitialValue in class AbstractOptionPaneUI

All Packages  Class Hierarchy  This Package  Previous  Next  Index