Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce
Class QButton

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JButton
                      extended by org.bounce.QButton
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants
Direct Known Subclasses:
LinkButton

public class QButton
extends javax.swing.JButton

A generic button that has more component state specific color, font and border attributes than the JButton.

Version:
$Revision: 1.5 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JButton
javax.swing.JButton.AccessibleJButton
 
Nested classes/interfaces inherited from class javax.swing.AbstractButton
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int FOCUS_AROUND_ICON
          focus rectangle around icon
static int FOCUS_AROUND_TEXT
          focus rectangle around text
static int FOCUS_AROUND_TEXT_AND_ICON
          focus rectangle around icon and text
static int FOCUS_NONE
          Do not have a focus rectangle
 
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
QButton()
          Constructor without a set text or icon.
QButton(javax.swing.Action a)
          Constructor with properties take from the action supplied.
QButton(javax.swing.Icon icon)
          Constructor for a button with an Icon.
QButton(java.lang.String text)
          Constructor for a button with text.
QButton(java.lang.String text, javax.swing.Icon icon)
          Constructor for a button with an icon and text.
 
Method Summary
 java.awt.Color getDisabledBackground()
          Returns the background color that is painted when the button is disabled.
 javax.swing.border.Border getDisabledBorder()
          Returns the border that is painted when the button is disabled.
 java.awt.Font getDisabledFont()
          Returns the font that is painted when the button is disabled.
 java.awt.Color getDisabledForeground()
          Returns the foreground color that is painted when the button is disabled.
 java.awt.Color getDisabledSelectedBackground()
          Returns the background color that is painted when the button is disabledSelected.
 javax.swing.border.Border getDisabledSelectedBorder()
          Returns the border that is painted when the button is disabledSelected.
 java.awt.Font getDisabledSelectedFont()
          Returns the font that is painted when the button is disabledSelected.
 java.awt.Color getDisabledSelectedForeground()
          Returns the foreground color that is painted when the button is disabledSelected.
 java.awt.Color getFocusedBackground()
          Returns the background color that is painted when the button is focused.
 javax.swing.border.Border getFocusedBorder()
          Returns the border that is painted when the button is focused.
 java.awt.Font getFocusedFont()
          Returns the font that is painted when the button is focused.
 java.awt.Color getFocusedForeground()
          Returns the foreground color that is painted when the button is focused.
 javax.swing.Icon getFocusedIcon()
          Returns the icon that is painted when the button is focused.
 java.awt.Color getFocusedRectangleColor()
          Returns the color for the rectangle that is painted when the button is in focus.
 int getFocusedRectangleMode()
          Returns the mode for the rectangle that is painted when the button is in focus.
 java.awt.Color getFocusedSelectedBackground()
          Returns the background color that is painted when the button is focusedSelected.
 javax.swing.border.Border getFocusedSelectedBorder()
          Returns the border that is painted when the button is focusedSelected.
 java.awt.Font getFocusedSelectedFont()
          Returns the font that is painted when the button is focusedSelected.
 java.awt.Color getFocusedSelectedForeground()
          Returns the foreground color that is painted when the button is focusedSelected.
 javax.swing.Icon getFocusedSelectedIcon()
          Returns the icon that is painted when the button is focusedSelected.
 int getMaximumLines()
          Get the maximum number of lines used for the button text.
 int getMinimumLines()
          Get the minimum number of lines used for the button text.
 java.awt.Color getPressedBackground()
          Returns the background color that is painted when the button is pressed.
 javax.swing.border.Border getPressedBorder()
          Returns the border that is painted when the button is pressed.
 java.awt.Font getPressedFont()
          Returns the font that is painted when the button is pressed.
 java.awt.Color getPressedForeground()
          Returns the foreground color that is painted when the button is pressed.
 java.awt.Color getRolloverBackground()
          Returns the background color that is painted when the button is rollover.
 javax.swing.border.Border getRolloverBorder()
          Returns the border that is painted when the button is rollover.
 java.awt.Font getRolloverFont()
          Returns the font that is painted when the button is rollover.
 java.awt.Color getRolloverForeground()
          Returns the foreground color that is painted when the button is rollover.
 java.awt.Color getRolloverSelectedBackground()
          Returns the background color that is painted when the button is rolloverSelected.
 javax.swing.border.Border getRolloverSelectedBorder()
          Returns the border that is painted when the button is rolloverSelected.
 java.awt.Font getRolloverSelectedFont()
          Returns the font that is painted when the button is rolloverSelected.
 java.awt.Color getRolloverSelectedForeground()
          Returns the foreground color that is painted when the button is rolloverSelected.
 java.awt.Color getSelectedBackground()
          Returns the background color that is painted when the button is selected.
 javax.swing.border.Border getSelectedBorder()
          Returns the border that is painted when the button is selected.
 java.awt.Font getSelectedFont()
          Returns the font that is painted when the button is selected.
 java.awt.Color getSelectedForeground()
          Returns the foreground color that is painted when the button is selected.
 boolean isDoubleClick()
          Call to find out if the double click has been enabled.
protected  void paintBorder(java.awt.Graphics g)
          Paints the QButton's border, this border needs to be selected from all component state specific borders.
 void setDisabledBackground(java.awt.Color color)
          Sets the background color that is painted when the button is disabled.
 void setDisabledBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is disabled.
 void setDisabledFont(java.awt.Font font)
          Sets the Font that is painted when the button is disabled.
 void setDisabledForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is disabled.
 void setDisabledSelectedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is disabledSelected.
 void setDisabledSelectedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is disabledSelected.
 void setDisabledSelectedFont(java.awt.Font font)
          Sets the Font that is painted when the button is disabledSelected.
 void setDisabledSelectedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is disabledSelected.
 void setDoubleClick(boolean enable)
          Enables the double click, this makes the button no longer returning an action event when the button has been clicked, only when double clicked.
 void setFocusedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is focused.
 void setFocusedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is focused.
 void setFocusedFont(java.awt.Font font)
          Sets the Font that is painted when the button is focused.
 void setFocusedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is focused.
 void setFocusedIcon(javax.swing.Icon icon)
          Sets the Icon that is painted when the button is focused.
 void setFocusedRectangleColor(java.awt.Color color)
          Sets the color for the rectangle that is painted when the button is in focus.
 void setFocusedRectangleMode(int mode)
          Sets the mode for the rectangle that is painted when the button is in focus.
 void setFocusedSelectedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is focusedSelected.
 void setFocusedSelectedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is focusedSelected.
 void setFocusedSelectedFont(java.awt.Font font)
          Sets the Font that is painted when the button is focusedSelected.
 void setFocusedSelectedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is focusedSelected.
 void setFocusedSelectedIcon(javax.swing.Icon icon)
          Sets the Icon that is painted when the button is focusedSelected.
 void setLines(int lines)
          Set the number of lines used for the button text.
 void setMaximumLines(int lines)
          Sets the maximum number of possible lines on this button.
 void setMinimumLines(int lines)
          Sets the minimum number of possible lines on this button.
 void setPressedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is pressed.
 void setPressedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is pressed.
 void setPressedFont(java.awt.Font font)
          Sets the Font that is painted when the button is pressed.
 void setPressedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is pressed.
 void setRolloverBackground(java.awt.Color color)
          Sets the background color that is painted when the button is rollover.
 void setRolloverBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is rollover.
 void setRolloverFont(java.awt.Font font)
          Sets the Font that is painted when the button is rollover.
 void setRolloverForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is rollover.
 void setRolloverSelectedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is rolloverSelected.
 void setRolloverSelectedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is rolloverSelected.
 void setRolloverSelectedFont(java.awt.Font font)
          Sets the Font that is painted when the button is rolloverSelected.
 void setRolloverSelectedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is rolloverSelected.
 void setSelectedBackground(java.awt.Color color)
          Sets the background color that is painted when the button is selected.
 void setSelectedBorder(javax.swing.border.Border border)
          Sets the border that is painted when the button is selected.
 void setSelectedFont(java.awt.Font font)
          Sets the Font that is painted when the button is selected.
 void setSelectedForeground(java.awt.Color color)
          Sets the foreground color that is painted when the button is selected.
 void updateUI()
          Sets the look and feel to the Bounce Button UI look and feel.
 
Methods inherited from class javax.swing.JButton
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable
 
Methods inherited from class javax.swing.AbstractButton
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FOCUS_NONE

public static final int FOCUS_NONE
Do not have a focus rectangle

See Also:
Constant Field Values

FOCUS_AROUND_TEXT

public static final int FOCUS_AROUND_TEXT
focus rectangle around text

See Also:
Constant Field Values

FOCUS_AROUND_ICON

public static final int FOCUS_AROUND_ICON
focus rectangle around icon

See Also:
Constant Field Values

FOCUS_AROUND_TEXT_AND_ICON

public static final int FOCUS_AROUND_TEXT_AND_ICON
focus rectangle around icon and text

See Also:
Constant Field Values
Constructor Detail

QButton

public QButton()
Constructor without a set text or icon.


QButton

public QButton(javax.swing.Action a)
Constructor with properties take from the action supplied.

Parameters:
a - the associated action.

QButton

public QButton(javax.swing.Icon icon)
Constructor for a button with an Icon.

Parameters:
icon - the icon for the button.

QButton

public QButton(java.lang.String text)
Constructor for a button with text.

Parameters:
text - the text for the button.

QButton

public QButton(java.lang.String text,
               javax.swing.Icon icon)
Constructor for a button with an icon and text.

Parameters:
text - the text for the button.
icon - the icon for the button.
Method Detail

updateUI

public void updateUI()
Sets the look and feel to the Bounce Button UI look and feel. Override this method if you want to install a different UI.

Overrides:
updateUI in class javax.swing.JButton

paintBorder

protected void paintBorder(java.awt.Graphics g)
Paints the QButton's border, this border needs to be selected from all component state specific borders.

Overrides:
paintBorder in class javax.swing.AbstractButton
Parameters:
g - the graphics.

setPressedBackground

public void setPressedBackground(java.awt.Color color)
Sets the background color that is painted when the button is pressed. Setting the color to null, changes the color to the default background color.

Parameters:
color - the pressed background color.

getPressedBackground

public java.awt.Color getPressedBackground()
Returns the background color that is painted when the button is pressed.

Returns:
the pressed background color.

setPressedForeground

public void setPressedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is pressed. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the pressed foreground color.

getPressedForeground

public java.awt.Color getPressedForeground()
Returns the foreground color that is painted when the button is pressed.

Returns:
the pressed foreground color.

setPressedBorder

public void setPressedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is pressed. Setting the border to null, changes the border to the default border.

Parameters:
border - the pressed border.

getPressedBorder

public javax.swing.border.Border getPressedBorder()
Returns the border that is painted when the button is pressed.

Returns:
the pressed border.

setPressedFont

public void setPressedFont(java.awt.Font font)
Sets the Font that is painted when the button is pressed. Setting the Font to null, changes the font to the default font.

Parameters:
font - the pressed font.

getPressedFont

public java.awt.Font getPressedFont()
Returns the font that is painted when the button is pressed.

Returns:
the pressed font.

setSelectedBackground

public void setSelectedBackground(java.awt.Color color)
Sets the background color that is painted when the button is selected. Setting the color to null, changes the color to the default background color.

Parameters:
color - the selected background color.

getSelectedBackground

public java.awt.Color getSelectedBackground()
Returns the background color that is painted when the button is selected.

Returns:
the selected background color.

setSelectedForeground

public void setSelectedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is selected. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the selected foreground color.

getSelectedForeground

public java.awt.Color getSelectedForeground()
Returns the foreground color that is painted when the button is selected.

Returns:
the selected foreground color.

setSelectedBorder

public void setSelectedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is selected. Setting the border to null, changes the border to the default border.

Parameters:
border - the selected border.

getSelectedBorder

public javax.swing.border.Border getSelectedBorder()
Returns the border that is painted when the button is selected.

Returns:
the selected border.

setSelectedFont

public void setSelectedFont(java.awt.Font font)
Sets the Font that is painted when the button is selected. Setting the Font to null, changes the font to the default font.

Parameters:
font - the selected font.

getSelectedFont

public java.awt.Font getSelectedFont()
Returns the font that is painted when the button is selected.

Returns:
the selected font.

setDisabledBackground

public void setDisabledBackground(java.awt.Color color)
Sets the background color that is painted when the button is disabled. Setting the color to null, changes the color to the default background color.

Parameters:
color - the disabled background color.

getDisabledBackground

public java.awt.Color getDisabledBackground()
Returns the background color that is painted when the button is disabled.

Returns:
the disabled background color.

setDisabledForeground

public void setDisabledForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is disabled. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the disabled foreground color.

getDisabledForeground

public java.awt.Color getDisabledForeground()
Returns the foreground color that is painted when the button is disabled.

Returns:
the disabled foreground color.

setDisabledBorder

public void setDisabledBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is disabled. Setting the border to null, changes the border to the default border.

Parameters:
border - the disabled border.

getDisabledBorder

public javax.swing.border.Border getDisabledBorder()
Returns the border that is painted when the button is disabled.

Returns:
the disabled border.

setDisabledFont

public void setDisabledFont(java.awt.Font font)
Sets the Font that is painted when the button is disabled. Setting the Font to null, changes the font to the default font.

Parameters:
font - the disabled font.

getDisabledFont

public java.awt.Font getDisabledFont()
Returns the font that is painted when the button is disabled.

Returns:
the disabled font.

setDisabledSelectedBackground

public void setDisabledSelectedBackground(java.awt.Color color)
Sets the background color that is painted when the button is disabledSelected. Setting the color to null, changes the color to the default background color.

Parameters:
color - the disabledSelected background color.

getDisabledSelectedBackground

public java.awt.Color getDisabledSelectedBackground()
Returns the background color that is painted when the button is disabledSelected.

Returns:
the disabledSelected background color.

setDisabledSelectedForeground

public void setDisabledSelectedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is disabledSelected. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the disabledSelected foreground color.

getDisabledSelectedForeground

public java.awt.Color getDisabledSelectedForeground()
Returns the foreground color that is painted when the button is disabledSelected.

Returns:
the disabledSelected foreground color.

setDisabledSelectedBorder

public void setDisabledSelectedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is disabledSelected. Setting the border to null, changes the border to the default border.

Parameters:
border - the disabledSelected border.

getDisabledSelectedBorder

public javax.swing.border.Border getDisabledSelectedBorder()
Returns the border that is painted when the button is disabledSelected.

Returns:
the disabledSelected border.

setDisabledSelectedFont

public void setDisabledSelectedFont(java.awt.Font font)
Sets the Font that is painted when the button is disabledSelected. Setting the Font to null, changes the font to the default font.

Parameters:
font - the disabledSelected font.

getDisabledSelectedFont

public java.awt.Font getDisabledSelectedFont()
Returns the font that is painted when the button is disabledSelected.

Returns:
the disabledSelected font.

setRolloverBackground

public void setRolloverBackground(java.awt.Color color)
Sets the background color that is painted when the button is rollover. Setting the color to null, changes the color to the default background color.

Parameters:
color - the rollover background color.

getRolloverBackground

public java.awt.Color getRolloverBackground()
Returns the background color that is painted when the button is rollover.

Returns:
the rollover background color.

setRolloverForeground

public void setRolloverForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is rollover. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the rollover foreground color.

getRolloverForeground

public java.awt.Color getRolloverForeground()
Returns the foreground color that is painted when the button is rollover.

Returns:
the rollover foreground color.

setRolloverBorder

public void setRolloverBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is rollover. Setting the border to null, changes the border to the default border.

Parameters:
border - the rollover border.

getRolloverBorder

public javax.swing.border.Border getRolloverBorder()
Returns the border that is painted when the button is rollover.

Returns:
the rollover border.

setRolloverFont

public void setRolloverFont(java.awt.Font font)
Sets the Font that is painted when the button is rollover. Setting the Font to null, changes the font to the default font.

Parameters:
font - the rollover font.

getRolloverFont

public java.awt.Font getRolloverFont()
Returns the font that is painted when the button is rollover.

Returns:
the rollover font.

setRolloverSelectedBackground

public void setRolloverSelectedBackground(java.awt.Color color)
Sets the background color that is painted when the button is rolloverSelected. Setting the color to null, changes the color to the default background color.

Parameters:
color - the rolloverSelected background color.

getRolloverSelectedBackground

public java.awt.Color getRolloverSelectedBackground()
Returns the background color that is painted when the button is rolloverSelected.

Returns:
the rolloverSelected background color.

setRolloverSelectedForeground

public void setRolloverSelectedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is rolloverSelected. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the rolloverSelected foreground color.

getRolloverSelectedForeground

public java.awt.Color getRolloverSelectedForeground()
Returns the foreground color that is painted when the button is rolloverSelected.

Returns:
the rolloverSelected foreground color.

setRolloverSelectedBorder

public void setRolloverSelectedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is rolloverSelected. Setting the border to null, changes the border to the default border.

Parameters:
border - the rolloverSelected border.

getRolloverSelectedBorder

public javax.swing.border.Border getRolloverSelectedBorder()
Returns the border that is painted when the button is rolloverSelected.

Returns:
the rolloverSelected border.

setRolloverSelectedFont

public void setRolloverSelectedFont(java.awt.Font font)
Sets the Font that is painted when the button is rolloverSelected. Setting the Font to null, changes the font to the default font.

Parameters:
font - the rolloverSelected font.

getRolloverSelectedFont

public java.awt.Font getRolloverSelectedFont()
Returns the font that is painted when the button is rolloverSelected.

Returns:
the rolloverSelected font.

setFocusedBackground

public void setFocusedBackground(java.awt.Color color)
Sets the background color that is painted when the button is focused. Setting the color to null, changes the color to the default background color.

Parameters:
color - the focused background color.

getFocusedBackground

public java.awt.Color getFocusedBackground()
Returns the background color that is painted when the button is focused.

Returns:
the focused background color.

setFocusedForeground

public void setFocusedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is focused. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the focused foreground color.

getFocusedForeground

public java.awt.Color getFocusedForeground()
Returns the foreground color that is painted when the button is focused.

Returns:
the focused foreground color.

setFocusedBorder

public void setFocusedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is focused. Setting the border to null, changes the border to the default border.

Parameters:
border - the focused border.

getFocusedBorder

public javax.swing.border.Border getFocusedBorder()
Returns the border that is painted when the button is focused.

Returns:
the focused border.

setFocusedFont

public void setFocusedFont(java.awt.Font font)
Sets the Font that is painted when the button is focused. Setting the Font to null, changes the font to the default font.

Parameters:
font - the focused font.

getFocusedFont

public java.awt.Font getFocusedFont()
Returns the font that is painted when the button is focused.

Returns:
the focused font.

getFocusedIcon

public javax.swing.Icon getFocusedIcon()
Returns the icon that is painted when the button is focused.

Returns:
the focused icon.

setFocusedIcon

public void setFocusedIcon(javax.swing.Icon icon)
Sets the Icon that is painted when the button is focused. Setting the Icon to null, changes the icon to the default icon.

Parameters:
icon - the focused icon.

setFocusedSelectedBackground

public void setFocusedSelectedBackground(java.awt.Color color)
Sets the background color that is painted when the button is focusedSelected. Setting the color to null, changes the color to the default background color.

Parameters:
color - the focusedSelected background color.

getFocusedSelectedBackground

public java.awt.Color getFocusedSelectedBackground()
Returns the background color that is painted when the button is focusedSelected.

Returns:
the focusedSelected background color.

setFocusedSelectedForeground

public void setFocusedSelectedForeground(java.awt.Color color)
Sets the foreground color that is painted when the button is focusedSelected. Setting the color to null, changes the color to the default foreground color.

Parameters:
color - the focusedSelected foreground color.

getFocusedSelectedForeground

public java.awt.Color getFocusedSelectedForeground()
Returns the foreground color that is painted when the button is focusedSelected.

Returns:
the focusedSelected foreground color.

setFocusedSelectedBorder

public void setFocusedSelectedBorder(javax.swing.border.Border border)
Sets the border that is painted when the button is focusedSelected. Setting the border to null, changes the border to the default border.

Parameters:
border - the focusedSelected border.

getFocusedSelectedBorder

public javax.swing.border.Border getFocusedSelectedBorder()
Returns the border that is painted when the button is focusedSelected.

Returns:
the focusedSelected border.

setFocusedSelectedFont

public void setFocusedSelectedFont(java.awt.Font font)
Sets the Font that is painted when the button is focusedSelected. Setting the Font to null, changes the font to the default font.

Parameters:
font - the focusedSelected font.

getFocusedSelectedFont

public java.awt.Font getFocusedSelectedFont()
Returns the font that is painted when the button is focusedSelected.

Returns:
the focusedSelected font.

getFocusedSelectedIcon

public javax.swing.Icon getFocusedSelectedIcon()
Returns the icon that is painted when the button is focusedSelected.

Returns:
the focusedSelected icon.

setFocusedSelectedIcon

public void setFocusedSelectedIcon(javax.swing.Icon icon)
Sets the Icon that is painted when the button is focusedSelected. Setting the Icon to null, changes the icon to the default icon.

Parameters:
icon - the focusedSelected icon.

setFocusedRectangleColor

public void setFocusedRectangleColor(java.awt.Color color)
Sets the color for the rectangle that is painted when the button is in focus. Setting the color to null, disables the painting of the rectangle. To be compatible with the JButton, the painting of the rectangle is also disabled when the isFocusPainted method returns false.

Parameters:
color - the focused Rectangle color.

getFocusedRectangleColor

public java.awt.Color getFocusedRectangleColor()
Returns the color for the rectangle that is painted when the button is in focus.

Returns:
the focused Rectangle color.

setFocusedRectangleMode

public void setFocusedRectangleMode(int mode)
Sets the mode for the rectangle that is painted when the button is in focus. The mode can be FOCUS_NONE, no focus rectangle is painted, FOCUS_AROUND_TEXT, Only a rectangle around the text is painted, FOCUS_AROUND_ICON, Only a rectangle around the icon is painted, FOCUS_AROUND_TEXT_AND_ICON, a rectangle around the icon and the text will be painted. The default value is to have the focus around the icon and the text.

Parameters:
mode - the focused mode.

getFocusedRectangleMode

public int getFocusedRectangleMode()
Returns the mode for the rectangle that is painted when the button is in focus. The mode can be FOCUS_NONE, no focus rectangle is painted, FOCUS_AROUND_TEXT, Only a rectangle around the text is painted, FOCUS_AROUND_ICON, Only a rectangle around the icon is painted, FOCUS_AROUND_TEXT_AND_ICON, a rectangle around the icon and the text will be painted. The default value is to have the focus around the icon and the text.

Returns:
the focused mode.

setDoubleClick

public void setDoubleClick(boolean enable)
Enables the double click, this makes the button no longer returning an action event when the button has been clicked, only when double clicked.

Parameters:
enable - the double click value, the value is enabled when true.

isDoubleClick

public boolean isDoubleClick()
Call to find out if the double click has been enabled.

Returns:
the double click value, the value is enabled when true.

setMaximumLines

public void setMaximumLines(int lines)
Sets the maximum number of possible lines on this button. If there is text in the lines the lines will be painted and included in the preferred-height calculations.

Parameters:
lines - the number of lines.
Throws:
java.lang.IllegalArgumentException - if lines is smaller than the minimum number of lines.

getMaximumLines

public int getMaximumLines()
Get the maximum number of lines used for the button text.

Returns:
the maximum number of lines.

setMinimumLines

public void setMinimumLines(int lines)
Sets the minimum number of possible lines on this button. The lines will always be included in the preferred-height calculations, even if they don't have text.

Parameters:
lines - the number of lines.
Throws:
java.lang.IllegalArgumentException - if lines is bigger than the maximum number of lines.

getMinimumLines

public int getMinimumLines()
Get the minimum number of lines used for the button text.

Returns:
the minimum number of lines.

setLines

public void setLines(int lines)
Set the number of lines used for the button text. This forces the preferred height of the button to be as high as the height of the lines of text. This is equal to setting the maximum and minimum number of lines to the same value.

Parameters:
lines - the number of lines.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.