All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.basic.BasicOptionPaneUI

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

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


Variable Index

 o defaultBorder
 o defaultOptions
Default option names, when none are supplied.
 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 getDefaultBorder()
Returns the border to use if the OptionPane does not currently have one.
 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 getMaxCharactersPerLineCount()
Returns the maximum number of characters to place on a line.
 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 getMinimumOptionPaneSize()
Returns the minimum size the option pane should be.
 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 getMinimumOptionPaneSize.
 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 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 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 getDefaultBorder
public Border getDefaultBorder()
Returns the border to use if the OptionPane does not currently have one.

 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 getIconForType
public Icon getIconForType(int messageType)
Returns the icon to use for the passed in type.

 o getMaxCharactersPerLineCount
public int getMaxCharactersPerLineCount()
Returns the maximum number of characters to place on a line. Default is to return Integer.MAX_VALUE. Concrete implementations may want to return a value that means something.

Overrides:
getMaxCharactersPerLineCount 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 getMinimumOptionPaneSize
public Dimension getMinimumOptionPaneSize()
Returns the minimum size the option pane should be. Primarily provided for subclassers wishin to offer a different minimum size.

 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 getMinimumOptionPaneSize.

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  

Submit a bug or feature