Package net.sf.freecol.client.gui.plaf
Class FreeColOptionPaneUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.OptionPaneUI
-
- javax.swing.plaf.basic.BasicOptionPaneUI
-
- net.sf.freecol.client.gui.plaf.FreeColOptionPaneUI
-
public class FreeColOptionPaneUI extends javax.swing.plaf.basic.BasicOptionPaneUI
Draw the "image.background.FreeColOptionPane" resource as a tiled background image.
-
-
Field Summary
Fields Modifier and Type Field Description private int
cancelIndex
private java.util.List<javax.swing.JButton>
newButtons
private int
okIndex
-
Constructor Summary
Constructors Modifier Constructor Description private
FreeColOptionPaneUI()
Trivial internal constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addButtonComponents(java.awt.Container container, java.lang.Object[] buttons, int initialIndex)
protected java.awt.Container
createButtonArea()
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
private javax.swing.JButton
getButton(int index)
Get a button by index.private int
getColumns(int nButtons)
Choose the number of columns for the OptionPane buttons.void
paint(java.awt.Graphics g, javax.swing.JComponent c)
private java.util.List<javax.swing.JButton>
prepareButtons()
Prepare the new buttons for this component and cache.void
selectInitialValue(javax.swing.JOptionPane op)
-
Methods inherited from class javax.swing.plaf.basic.BasicOptionPaneUI
addIcon, addMessageComponents, burstStringInto, containsCustomComponents, createButtonActionListener, createLayoutManager, createMessageArea, createPropertyChangeListener, createSeparator, getButtons, getIcon, getIconForType, getInitialValueIndex, getMaxCharactersPerLineCount, getMessage, getMinimumOptionPaneSize, getPreferredSize, getSizeButtonsToSameWidth, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, resetInputValue, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
-
-
-
-
Method Detail
-
getColumns
private int getColumns(int nButtons)
Choose the number of columns for the OptionPane buttons.- Parameters:
nButtons
- The number of buttons.- Returns:
- A suitable number of columns.
-
prepareButtons
private java.util.List<javax.swing.JButton> prepareButtons()
Prepare the new buttons for this component and cache.- Returns:
- A list of buttons.
-
getButton
private javax.swing.JButton getButton(int index)
Get a button by index.- Parameters:
index
- The index to look for.- Returns:
- The corresponding button.
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
createButtonArea
protected java.awt.Container createButtonArea()
- Overrides:
createButtonArea
in classjavax.swing.plaf.basic.BasicOptionPaneUI
-
addButtonComponents
protected void addButtonComponents(java.awt.Container container, java.lang.Object[] buttons, int initialIndex)
- Overrides:
addButtonComponents
in classjavax.swing.plaf.basic.BasicOptionPaneUI
-
selectInitialValue
public void selectInitialValue(javax.swing.JOptionPane op)
- Overrides:
selectInitialValue
in classjavax.swing.plaf.basic.BasicOptionPaneUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.ComponentUI
-
-