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.
defaultBorder-
defaultOptions- Default option names, when none are supplied.
inputComponent- JComponent provide for input if optionPane.getWantsInput() returns
true.
MIN_HEIGHT- Minimum height for the Component.
MIN_WIDTH- Minimum width for the Component.
okCancelOptions- Option names for OK_CANCEL_OPTION.
optionPane- JOptionPane that the reciever is providing the look and feel for.
yesNoCancelOptions- Options names for YES_NO_CANCEL_OPTION.
yesNoOptions- Option names for YES_NO_OPTION.
BasicOptionPaneUI()
-
createdButtonFired(int)
- Messaged when a JButton as created from validateComponent is clicked
Invokes setValue on the JOptionPane with the appropriate value.
createUI(JComponent)
- Creates a new BasicOptionPaneUI instance.
getButtons()
- Returns the buttons to display from the JOptionPane the receiver is
providing the look and feel for.
getContainer()
- Returns the JOptionPane the receiver is providing the look and feel
for.
getDefaultBorder()
- Returns the border to use if the OptionPane does not currently have
one.
getIcon()
- Returns the icon from the JOptionPane the reciever is providing
the look and feel for, or the default icon as returned from
getDefaultIcon.
getIconForType(int)
- Returns the icon to use for the passed in type.
getInitialIndex()
- Returns the initial index into the buttons to select.
getInsets(JComponent)
- Returns a copy of AbstractOptionPaneUI.defaultInsets.
getMaxCharactersPerLineCount()
- Returns the maximum number of characters to place on a line.
getMaximumSize(JComponent)
- Messages getPreferredSize.
getMessage()
- Returns the message to display from the JMessagePane the receiver is
providing the look and feel for.
getMinimumOptionPaneSize()
- Returns the minimum size the option pane should be.
getMinimumSize(JComponent)
- Messages getPreferredSize.
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
.
getSizeButtonsToSameWidth()
- Returns true, basic L&F wants all the buttons to have the same
width.
installUI(JComponent)
- Installs the reciever as the L&F for the passed in JOptionPane
paint(Graphics, JComponent)
- Fills the backround if the component is opaque.
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.
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.
selectInitialValue()
- If inputComponent is non-null, the focus is requested on that,
otherwise super is messaged.
uninstallUI(JComponent)
- Removes the receiver from the L&F controller of the passed in split
pane.
MIN_WIDTH
public static final int MIN_WIDTH
- Minimum width for the Component.
MIN_HEIGHT
public static final int MIN_HEIGHT
- Minimum height for the Component.
yesNoOptions
public static final String[] yesNoOptions
- Option names for YES_NO_OPTION.
yesNoCancelOptions
public static final String[] yesNoCancelOptions
- Options names for YES_NO_CANCEL_OPTION.
defaultOptions
public static final String[] defaultOptions
- Default option names, when none are supplied.
okCancelOptions
public static final String[] okCancelOptions
- Option names for OK_CANCEL_OPTION.
defaultBorder
protected static final EmptyBorder defaultBorder
optionPane
protected JOptionPane optionPane
- JOptionPane that the reciever is providing the look and feel for.
inputComponent
protected JComponent inputComponent
- JComponent provide for input if optionPane.getWantsInput() returns
true.
BasicOptionPaneUI
public BasicOptionPaneUI()
createUI
public static ComponentUI createUI(JComponent x)
- Creates a new BasicOptionPaneUI instance.
installUI
public void installUI(JComponent c)
- Installs the reciever as the L&F for the passed in JOptionPane
- Overrides:
- installUI in class ComponentUI
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
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.
getDefaultBorder
public Border getDefaultBorder()
- Returns the border to use if the OptionPane does not currently have
one.
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
getIconForType
public Icon getIconForType(int messageType)
- Returns the icon to use for the passed in type.
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
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
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
getContainer
public Container getContainer()
- Returns the JOptionPane the receiver is providing the look and feel
for.
- Overrides:
- getContainer in class AbstractOptionPaneUI
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
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.
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
getMinimumOptionPaneSize
public Dimension getMinimumOptionPaneSize()
- Returns the minimum size the option pane should be. Primarily
provided for subclassers wishin to offer a different minimum size.
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
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Messages getPreferredSize.
- Overrides:
- getMinimumSize in class ComponentUI
getMaximumSize
public Dimension getMaximumSize(JComponent c)
- Messages getPreferredSize.
- Overrides:
- getMaximumSize in class ComponentUI
getInsets
public Insets getInsets(JComponent c)
- Returns a copy of AbstractOptionPaneUI.defaultInsets.
paint
public void paint(Graphics g,
JComponent c)
- Fills the backround if the component is opaque.
- Overrides:
- paint in class ComponentUI
getSizeButtonsToSameWidth
public boolean getSizeButtonsToSameWidth()
- Returns true, basic L&F wants all the buttons to have the same
width.
- Overrides:
- getSizeButtonsToSameWidth in class AbstractOptionPaneUI
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