Quaqua 7.4.2 2011-07-05

ch.randelshofer.quaqua
Class QuaquaOptionPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.OptionPaneUI
          extended by javax.swing.plaf.basic.BasicOptionPaneUI
              extended by ch.randelshofer.quaqua.QuaquaOptionPaneUI

public class QuaquaOptionPaneUI
extends javax.swing.plaf.basic.BasicOptionPaneUI

QuaquaOptionPaneUI.

Version:
$Id: QuaquaOptionPaneUI.java 361 2010-11-21 11:19:20Z wrandelshofer $
Author:
Werner Randelshofer

Nested Class Summary
static class QuaquaOptionPaneUI.QuaquaButtonAreaLayout
          ButtonAreaLayout behaves in a similar manner to FlowLayout.
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
javax.swing.plaf.basic.BasicOptionPaneUI.ButtonActionListener, javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout, javax.swing.plaf.basic.BasicOptionPaneUI.PropertyChangeHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
hasCustomComponents, initialFocusComponent, inputComponent, MinimumHeight, minimumSize, MinimumWidth, optionPane, propertyChangeListener
 
Constructor Summary
QuaquaOptionPaneUI()
           
 
Method Summary
protected  void addButtonComponents(java.awt.Container container, java.lang.Object[] buttons, int initialIndex)
          Creates the appropriate object to represent each of the objects in buttons and adds it to container.
protected  void addIcon(java.awt.Container top)
          Creates and adds a JLabel representing the icon returned from getIcon to top.
protected  void addMessageComponents(java.awt.Container container, java.awt.GridBagConstraints cons, java.lang.Object msg, int maxll, boolean internallyCreated)
          Creates the appropriate object to represent msg and places it into container.
protected  java.awt.Container createButtonArea()
          Creates and returns a Container containing the buttons.
protected  java.awt.LayoutManager createLayoutManager()
           
protected  java.awt.Container createMessageArea()
          Messaged from installComponents to create a Container containing the body of the message.
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
          Creates a new QuaquaOptionPaneUI instance.
protected  java.lang.Object[] getButtons()
          Returns the buttons to display from the JOptionPane the receiver is providing the look and feel for.
protected  int getMaxCharactersPerLineCount()
          Returns the maximum number of characters to place on a line.
protected  java.lang.Object getMessage()
          Returns the message to display from the JOptionPane the receiver is providing the look and feel for.
protected  boolean getSizeButtonsToSameWidth()
          Returns true, basic L&F wants all the buttons to have the same width.
protected  void installComponents()
           
 void paint(java.awt.Graphics gr, javax.swing.JComponent c)
           
protected  void uninstallListeners()
           
 
Methods inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
burstStringInto, containsCustomComponents, createButtonActionListener, createSeparator, getIcon, getIconForType, getInitialValueIndex, getMinimumOptionPaneSize, getPreferredSize, installDefaults, installKeyboardActions, installListeners, installUI, resetInputValue, selectInitialValue, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaOptionPaneUI

public QuaquaOptionPaneUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
Creates a new QuaquaOptionPaneUI instance.


paint

public void paint(java.awt.Graphics gr,
                  javax.swing.JComponent c)
Overrides:
paint in class javax.swing.plaf.ComponentUI

createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
Overrides:
createLayoutManager in class javax.swing.plaf.basic.BasicOptionPaneUI

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Overrides:
createPropertyChangeListener in class javax.swing.plaf.basic.BasicOptionPaneUI

installComponents

protected void installComponents()
Overrides:
installComponents in class javax.swing.plaf.basic.BasicOptionPaneUI

uninstallListeners

protected void uninstallListeners()
Overrides:
uninstallListeners in class javax.swing.plaf.basic.BasicOptionPaneUI

createMessageArea

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

Overrides:
createMessageArea in class javax.swing.plaf.basic.BasicOptionPaneUI

getMaxCharactersPerLineCount

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

Overrides:
getMaxCharactersPerLineCount in class javax.swing.plaf.basic.BasicOptionPaneUI

addIcon

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

Overrides:
addIcon in class javax.swing.plaf.basic.BasicOptionPaneUI

addButtonComponents

protected void addButtonComponents(java.awt.Container container,
                                   java.lang.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.

Overrides:
addButtonComponents in class javax.swing.plaf.basic.BasicOptionPaneUI

addMessageComponents

protected void addMessageComponents(java.awt.Container container,
                                    java.awt.GridBagConstraints cons,
                                    java.lang.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).

Overrides:
addMessageComponents in class javax.swing.plaf.basic.BasicOptionPaneUI

getButtons

protected java.lang.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 javax.swing.plaf.basic.BasicOptionPaneUI

getMessage

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

Overrides:
getMessage in class javax.swing.plaf.basic.BasicOptionPaneUI

getSizeButtonsToSameWidth

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

Overrides:
getSizeButtonsToSameWidth in class javax.swing.plaf.basic.BasicOptionPaneUI

createButtonArea

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

Overrides:
createButtonArea in class javax.swing.plaf.basic.BasicOptionPaneUI

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.