Package Summary  Overview Summary

class:BasicOptionPaneUI [NONE]

  • Direct Known Subclasses:
    SynthOptionPaneUI


    public class BasicOptionPaneUI
    extends OptionPaneUI
    
    Provides the basic look and feel for a JOptionPane. BasicMessagePaneUI provides a means to place an icon, message and buttons into a Container. Generally, the layout will look like:
            ------------------
            | i | message    |
            | c | message    |
            | o | message    |
            | n | message    |
            ------------------
            |     buttons    |
            |________________|
     
    icon is an instance of Icon that is wrapped inside a JLabel. The message is an opaque object and is tested for the following: if the message is a Component it is added to the Container, if it is an Icon it is wrapped inside a JLabel and added to the Container otherwise it is wrapped inside a JLabel.

    The above layout is used when the option pane's ComponentOrientation property is horizontal, left-to-right. The layout will be adjusted appropriately for other orientations.

    The Container, message, icon, and buttons are all determined from abstract methods.

field:MinimumWidth [CHANGED]

  • MinimumWidth

    public static final int MinimumWidth
    The mininum width of JOptionPane.
    See Also:
    Constant Field Values
  • MinimumWidth

    public static final int MinimumWidth
    The mininum width of JOptionPane.
    See Also:
    Constant Field Values

field:MinimumHeight [CHANGED]

  • MinimumHeight

    public static final int MinimumHeight
    The mininum height of JOptionPane.
    See Also:
    Constant Field Values
  • MinimumHeight

    public static final int MinimumHeight
    The mininum height of JOptionPane.
    See Also:
    Constant Field Values

field:optionPane [NONE]

  • optionPane

    protected JOptionPane optionPane
    JOptionPane that the receiver is providing the look and feel for.

field:minimumSize [CHANGED]

  • minimumSize

    protected Dimension minimumSize
    The size of JOptionPane.
  • minimumSize

    protected Dimension minimumSize
  • minimumSize

    protected Dimension minimumSize
    The size of JOptionPane.

field:inputComponent [NONE]

  • inputComponent

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

field:initialFocusComponent [NONE]

  • initialFocusComponent

    protected Component initialFocusComponent
    Component to receive focus when messaged with selectInitialValue.

field:hasCustomComponents [NONE]

  • hasCustomComponents

    protected boolean hasCustomComponents
    This is set to true in validateComponent if a Component is contained in either the message or the buttons.

field:propertyChangeListener [CHANGED]

  • propertyChangeListener

    protected PropertyChangeListener propertyChangeListener
    The instance of PropertyChangeListener.
  • propertyChangeListener

    protected PropertyChangeListener propertyChangeListener
    The instance of PropertyChangeListener.

constructor:BasicOptionPaneUI() [CHANGED]

  • BasicOptionPaneUI

    public BasicOptionPaneUIpublic BasicOptionPaneUI​()
  • BasicOptionPaneUI

    public BasicOptionPaneUI()
  • BasicOptionPaneUI

    public BasicOptionPaneUI​()

method:createUI(javax.swing.JComponent) [CHANGED]

  • createUI

    public static ComponentUI createUI createUI​(JComponent x)
    Creates a new BasicOptionPaneUI instance.
    Parameters:
    x - the component
    Returns:
    a new BasicOptionPaneUI instance
  • createUI

    public static ComponentUI createUI​(JComponent x)
    Creates a new BasicOptionPaneUI instance.
    Parameters:
    x - the component
    Returns:
    a new BasicOptionPaneUI instance

method:installUI(javax.swing.JComponent) [CHANGED]

method:uninstallUI(javax.swing.JComponent) [CHANGED]

method:installDefaults() [CHANGED]

  • installDefaults

    protected void installDefaultsprotected void installDefaults​()
    Installs default properties.
  • installDefaults

    protected void installDefaults()
  • installDefaults

    protected void installDefaults​()
    Installs default properties.

method:uninstallDefaults() [CHANGED]

  • uninstallDefaults

    protected void uninstallDefaultsprotected void uninstallDefaults​()
    Uninstalls default properties.
  • uninstallDefaults

    protected void uninstallDefaults()
  • uninstallDefaults

    protected void uninstallDefaults​()
    Uninstalls default properties.

method:installComponents() [CHANGED]

  • installComponents

    protected void installComponentsprotected void installComponents​()
    Registers components.
  • installComponents

    protected void installComponents()
  • installComponents

    protected void installComponents​()
    Registers components.

method:uninstallComponents() [CHANGED]

  • uninstallComponents

    protected void uninstallComponentsprotected void uninstallComponents​()
    Unregisters components.
  • uninstallComponents

    protected void uninstallComponents()
  • uninstallComponents

    protected void uninstallComponents​()
    Unregisters components.

method:createLayoutManager() [CHANGED]

  • createLayoutManager

    protected LayoutManager createLayoutManager createLayoutManager​()
    Returns a layout manager.
    Returns:
    a layout manager
  • createLayoutManager

    protected LayoutManager createLayoutManager()
  • createLayoutManager

    protected LayoutManager createLayoutManager​()
    Returns a layout manager.
    Returns:
    a layout manager

method:installListeners() [CHANGED]

  • installListeners

    protected void installListenersprotected void installListeners​()
    Registers listeners.
  • installListeners

    protected void installListeners()
  • installListeners

    protected void installListeners​()
    Registers listeners.

method:uninstallListeners() [CHANGED]

  • uninstallListeners

    protected void uninstallListenersprotected void uninstallListeners​()
    Unregisters listeners.
  • uninstallListeners

    protected void uninstallListeners()
  • uninstallListeners

    protected void uninstallListeners​()
    Unregisters listeners.

method:createPropertyChangeListener() [CHANGED]

  • createPropertyChangeListener

    protected PropertyChangeListener createPropertyChangeListener createPropertyChangeListener​()
    Returns an instance of PropertyChangeListener.
    Returns:
    an instance of PropertyChangeListener
  • createPropertyChangeListener

    protected PropertyChangeListener createPropertyChangeListener​()
    Returns an instance of PropertyChangeListener.
    Returns:
    an instance of PropertyChangeListener

method:installKeyboardActions() [CHANGED]

  • installKeyboardActions

    protected void installKeyboardActionsprotected void installKeyboardActions​()
    Registers keyboard actions.
  • installKeyboardActions

    protected void installKeyboardActions()
  • installKeyboardActions

    protected void installKeyboardActions​()
    Registers keyboard actions.

method:uninstallKeyboardActions() [CHANGED]

  • uninstallKeyboardActions

    protected void uninstallKeyboardActionsprotected void uninstallKeyboardActions​()
    Unregisters keyboard actions.
  • uninstallKeyboardActions

    protected void uninstallKeyboardActions()
  • uninstallKeyboardActions

    protected void uninstallKeyboardActions​()
    Unregisters keyboard actions.

method:getMinimumOptionPaneSize() [CHANGED]

  • getMinimumOptionPaneSize

    public Dimension getMinimumOptionPaneSize getMinimumOptionPaneSize​()
    Returns the minimum size the option pane should be. Primarily provided for subclassers wishing to offer a different minimum size.
    Returns:
    the minimum size of the option pane
  • getMinimumOptionPaneSize

    public Dimension getMinimumOptionPaneSize()
    Returns the minimum size the option pane should be. Primarily provided for subclassers wishing to offer a different minimum size.
  • getMinimumOptionPaneSize

    public Dimension getMinimumOptionPaneSize​()
    Returns the minimum size the option pane should be. Primarily provided for subclassers wishing to offer a different minimum size.
    Returns:
    the minimum size of the option pane

method:getPreferredSize(javax.swing.JComponent) [CHANGED]

  • getPreferredSize

    public Dimension getPreferredSize getPreferredSize​(JComponent c)
    If c is the JOptionPane the receiver 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
    Parameters:
    c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
    Returns:
    a Dimension object containing given component's preferred size appropriate for the look and feel
    See Also:
    JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)
  • getPreferredSize

    public Dimension getPreferredSize​(JComponent c)
    If c is the JOptionPane the receiver 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
    Parameters:
    c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
    Returns:
    a Dimension object containing given component's preferred size appropriate for the look and feel
    See Also:
    JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

method:createMessageArea() [CHANGED]

  • createMessageArea

    protected Container createMessageArea createMessageArea​()
    Messaged from installComponents to create a Container containing the body of the message. The icon is the created by calling addIcon.
    Returns:
    a instance of Container
  • createMessageArea

    protected Container createMessageArea()
    Messaged from installComponents to create a Container containing the body of the message. The icon is the created by calling addIcon.
  • createMessageArea

    protected Container createMessageArea​()
    Messaged from installComponents to create a Container containing the body of the message. The icon is the created by calling addIcon.
    Returns:
    a instance of Container

method:addMessageComponents(java.awt.Container, java.awt.GridBagConstraints, java.lang.Object, int, boolean) [CHANGED]

  • addMessageComponents

    protected void addMessageComponentsprotected void addMessageComponents​(Container container,
                                        GridBagConstraints cons,
                                        Object msg,
                                        int maxll,
                                        boolean internallyCreated)
    Creates the appropriate object to represent msg and places it into container. If msg is an instance of Component, it is added directly,; if it is an Icon, a JLabel is created to represent it,; otherwise, a JLabel is created for the string, if d. If msg is an Object[], this method will be recursively invoked for the children. internallyCreated is true if Objc msg is an instance of Component and was created internally by this method (this is used to correctly set hasCustomComponents only if ! internallyCreated is false).
    Parameters:
    container - a container
    cons - an instance of GridBagConstraints
    msg - a message
    maxll - a maximum length
    internallyCreated). - true if the component was internally created
  • addMessageComponents

    protected void addMessageComponents(Container container,
                                        GridBagConstraints cons,
                                        Object msg,
                                        int maxll,
                                        boolean internallyCreated)
    Creates the appropriate object to represent msg and places it into container. If msg is an instance of Component, it is added directly, if it is an Icon, a JLabel is created to represent it, otherwise a JLabel is created for the string, if d is an Object[], this method will be recursively invoked for the children. internallyCreated is true if Objc is an instance of Component and was created internally by this method (this is used to correctly set hasCustomComponents only if !internallyCreated).
  • addMessageComponents

    protected void addMessageComponents​(Container container,
                                        GridBagConstraints cons,
                                        Object msg,
                                        int maxll,
                                        boolean internallyCreated)
    Creates the appropriate object to represent msg and places it into container. If msg is an instance of Component, it is added directly; if it is an Icon, a JLabel is created to represent it; otherwise, a JLabel is created for the string. If msg is an Object[], this method will be recursively invoked for the children. internallyCreated is true if msg is an instance of Component and was created internally by this method (this is used to correctly set hasCustomComponents only if internallyCreated is false).
    Parameters:
    container - a container
    cons - an instance of GridBagConstraints
    msg - a message
    maxll - a maximum length
    internallyCreated - true if the component was internally created

method:getMessage() [CHANGED]

  • getMessage

    protected Object getMessage getMessage​()
    Returns the message to display from the JOptionPane the receiver is providing the look and feel for.
    Returns:
    the message to display
  • getMessage

    protected Object getMessage()
    Returns the message to display from the JOptionPane the receiver is providing the look and feel for.
  • getMessage

    protected Object getMessage​()
    Returns the message to display from the JOptionPane the receiver is providing the look and feel for.
    Returns:
    the message to display

method:addIcon(java.awt.Container) [CHANGED]

  • addIcon

    protected void addIconprotected void addIcon​(Container top)
    Creates and adds a JLabel representing the icon returned from getIcon to top. This is messaged from createMessageArea.
    Parameters:
    top - a container
  • addIcon

    protected void addIcon(Container top)
    Creates and adds a JLabel representing the icon returned from getIcon to top. This is messaged from createMessageArea
  • addIcon

    protected void addIcon​(Container top)
    Creates and adds a JLabel representing the icon returned from getIcon to top. This is messaged from createMessageArea.
    Parameters:
    top - a container

method:getIcon() [CHANGED]

  • getIcon

    protected Icon getIcon getIcon​()
    Returns the icon from the JOptionPane the receiver is providing the look and feel for, or the default icon as returned from getDefaultIcon.
    Returns:
    the icon
  • getIcon

    protected Icon getIcon()
    Returns the icon from the JOptionPane the receiver is providing the look and feel for, or the default icon as returned from getDefaultIcon.
  • getIcon

    protected Icon getIcon​()
    Returns the icon from the JOptionPane the receiver is providing the look and feel for, or the default icon as returned from getDefaultIcon.
    Returns:
    the icon

method:getIconForType(int) [CHANGED]

  • getIconForType

    protected Icon getIconForType getIconForType​(int messageType)
    Returns the icon to use for the passed in type.
    Parameters:
    messageType - a type of message
    Returns:
    the icon to use for the passed in type
  • getIconForType

    protected Icon getIconForType(int messageType)
    Returns the icon to use for the passed in type.
  • getIconForType

    protected Icon getIconForType​(int messageType)
    Returns the icon to use for the passed in type.
    Parameters:
    messageType - a type of message
    Returns:
    the icon to use for the passed in type

method:getMaxCharactersPerLineCount() [CHANGED]

  • getMaxCharactersPerLineCount

    protected int getMaxCharactersPerLineCountprotected int getMaxCharactersPerLineCount​()
    Returns the maximum number of characters to place on a line.
    Returns:
    the maximum number of characters to place on a line
  • getMaxCharactersPerLineCount

    protected int getMaxCharactersPerLineCount()
    Returns the maximum number of characters to place on a line.
  • getMaxCharactersPerLineCount

    protected int getMaxCharactersPerLineCount​()
    Returns the maximum number of characters to place on a line.
    Returns:
    the maximum number of characters to place on a line

method:burstStringInto(java.awt.Container, java.lang.String, int) [CHANGED]

  • burstStringInto

    protected void burstStringIntoprotected void burstStringInto​(Container c,
                                   String d,
                                   int maxll)
    Recursively creates new JLabel instances to represent d. Each JLabel instance is added to c.
    Parameters:
    c - a container
    d - a text
    maxll - a maximum length of a text
  • burstStringInto

    protected void burstStringInto(Container c,
                                   String d,
                                   int maxll)
    Recursively creates new JLabel instances to represent d. Each JLabel instance is added to c.
  • burstStringInto

    protected void burstStringInto​(Container c,
                                   String d,
                                   int maxll)
    Recursively creates new JLabel instances to represent d. Each JLabel instance is added to c.
    Parameters:
    c - a container
    d - a text
    maxll - a maximum length of a text

method:createSeparator() [CHANGED]

  • createSeparator

    protected Container createSeparator createSeparator​()
    Returns a separator.
    Returns:
    a separator
  • createSeparator

    protected Container createSeparator()
  • createSeparator

    protected Container createSeparator​()
    Returns a separator.
    Returns:
    a separator

method:createButtonArea() [CHANGED]

  • createButtonArea

    protected Container createButtonArea createButtonArea​()
    Creates and returns a Container containing the buttons. The buttons are created by calling getButtons.
    Returns:
    a Container containing the buttons
  • createButtonArea

    protected Container createButtonArea()
    Creates and returns a Container containing the buttons. The buttons are created by calling getButtons.
  • createButtonArea

    protected Container createButtonArea​()
    Creates and returns a Container containing the buttons. The buttons are created by calling getButtons.
    Returns:
    a Container containing the buttons

method:addButtonComponents(java.awt.Container, java.lang.Object[], int) [CHANGED]

  • addButtonComponents

    protected void addButtonComponentsprotected void addButtonComponents​(Container container,
                                       Object[] buttons,
                                       int initialIndex)
    Creates the appropriate object to represent each of the objects in buttons and adds it to container. This differs from addMessageComponents in that it will recurse on buttons and that if button is not a Component it will create an instance of JButton.
    Parameters:
    container - a container
    buttons - an array of buttons
    initialIndex - an initial index
  • addButtonComponents

    protected void addButtonComponents(Container container,
                                       Object[] buttons,
                                       int initialIndex)
    Creates the appropriate object to represent each of the objects in buttons and adds it to container. This differs from addMessageComponents in that it will recurse on buttons and that if button is not a Component it will create an instance of JButton.
  • addButtonComponents

    protected void addButtonComponents​(Container container,
                                       Object[] buttons,
                                       int initialIndex)
    Creates the appropriate object to represent each of the objects in buttons and adds it to container. This differs from addMessageComponents in that it will recurse on buttons and that if button is not a Component it will create an instance of JButton.
    Parameters:
    container - a container
    buttons - an array of buttons
    initialIndex - an initial index

method:createButtonActionListener(int) [CHANGED]

  • createButtonActionListener

    protected ActionListener createButtonActionListener createButtonActionListener​(int buttonIndex)
    Constructs a new instance of a ButtonActionListener.
    Parameters:
    buttonIndex - an index of the button
    Returns:
    a new instance of a ButtonActionListener
  • createButtonActionListener

    protected ActionListener createButtonActionListener(int buttonIndex)
  • createButtonActionListener

    protected ActionListener createButtonActionListener​(int buttonIndex)
    Constructs a new instance of a ButtonActionListener.
    Parameters:
    buttonIndex - an index of the button
    Returns:
    a new instance of a ButtonActionListener

method:getButtons() [CHANGED]

  • getButtons

    protected Object[] getButtons 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_OPTIONyesNoCancelOptions is returned, otherwise defaultButtons are returned.
    Returns:
    the buttons to display from the JOptionPane
  • getButtons

    protected 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.
  • getButtons

    protected 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_OPTIONyesNoCancelOptions is returned, otherwise defaultButtons are returned.
    Returns:
    the buttons to display from the JOptionPane

method:getSizeButtonsToSameWidth() [CHANGED]

  • getSizeButtonsToSameWidth

    protected boolean getSizeButtonsToSameWidthprotected boolean getSizeButtonsToSameWidth​()
    Returns true, basic L&F wants all the buttons to have the same width.
    Returns:
    true if all the buttons should have the same width
  • getSizeButtonsToSameWidth

    protected boolean getSizeButtonsToSameWidth()
    Returns true, basic L&F wants all the buttons to have the same width.
  • getSizeButtonsToSameWidth

    protected boolean getSizeButtonsToSameWidth​()
    Returns true, basic L&F wants all the buttons to have the same width.
    Returns:
    true if all the buttons should have the same width

method:getInitialValueIndex() [CHANGED]

  • getInitialValueIndex

    protected int getInitialValueIndexprotected int getInitialValueIndex​()
    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.
    Returns:
    the initial index into the buttons to select
  • getInitialValueIndex

    protected int getInitialValueIndex()
    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.
  • getInitialValueIndex

    protected int getInitialValueIndex​()
    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.
    Returns:
    the initial index into the buttons to select

method:resetInputValue() [CHANGED]

  • resetInputValue

    protected void resetInputValueprotected 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.
  • 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.
  • 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.

method:selectInitialValue(javax.swing.JOptionPane) [CHANGED]

  • selectInitialValue

    public void selectInitialValuepublic void selectInitialValue​(JOptionPane op)
    If inputComponent is non-null, the focus is requested on that, otherwise request focus on the default value
    Specified by:
    selectInitialValue in class OptionPaneUI
    Parameters:
    op - a JOptionPane
  • selectInitialValue

    public void selectInitialValue(JOptionPane op)
    If inputComponent is non-null, the focus is requested on that, otherwise request focus on the default value
    Specified by:
    selectInitialValue in class OptionPaneUI
  • selectInitialValue

    public void selectInitialValue​(JOptionPane op)
    If inputComponent is non-null, the focus is requested on that, otherwise request focus on the default value
    Specified by:
    selectInitialValue in class OptionPaneUI
    Parameters:
    op - a JOptionPane

method:containsCustomComponents(javax.swing.JOptionPane) [CHANGED]

  • containsCustomComponents

    public boolean containsCustomComponentspublic boolean containsCustomComponents​(JOptionPane op)
    Returns true if in the last call to validateComponent the message or buttons contained a subclass of Component.
    Specified by:
    containsCustomComponents in class OptionPaneUI
    Parameters:
    op - a JOptionPane
    Returns:
    true if the given JOptionPane contains user created Components
  • containsCustomComponents

    public boolean containsCustomComponents(JOptionPane op)
    Returns true if in the last call to validateComponent the message or buttons contained a subclass of Component.
    Specified by:
    containsCustomComponents in class OptionPaneUI
  • containsCustomComponents

    public boolean containsCustomComponents​(JOptionPane op)
    Returns true if in the last call to validateComponent the message or buttons contained a subclass of Component.
    Specified by:
    containsCustomComponents in class OptionPaneUI
    Parameters:
    op - a JOptionPane
    Returns:
    true if the given JOptionPane contains user created Components

© 2017 Oracle Corporation and/or its affiliates