JBCSolutions - JbcBeans v1.5

This document is the API specification for the JbcBeans, version 1.5


jbc.beans
Class JbcMetallicToggleButton

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.JToggleButton
                      extended by jbc.beans.JbcMetallicToggleButton
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:
JbcEllipticToggleButton

public class JbcMetallicToggleButton
extends javax.swing.JToggleButton

This bean is a toggle button allowing to create nice, metallic, elliptic or circular buttons. Its functionalities are identical to a normal toggle button. It may be usefully used for multimedia applications, or any application or applet that should be carefully done.

Author:
Copyright © 1999-2004, JBC. All Rights Reserved.
Licensed Materials - Property of JBC.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JToggleButton
javax.swing.JToggleButton.ToggleButtonModel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.AbstractButton
BORDER_PAINTED_CHANGED_PROPERTY, 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, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, 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
TOOL_TIP_TEXT_KEY, 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
JbcMetallicToggleButton()
          Creates a metallic toggle button with no set text or icon.
JbcMetallicToggleButton(javax.swing.Action a)
          Creates a metallic toggle button where properties are taken from the Action supplied.
JbcMetallicToggleButton(javax.swing.Icon icon)
          Creates a metallic toggle button with an icon.
JbcMetallicToggleButton(java.lang.String text)
          Creates a metallic toggle button with text.
JbcMetallicToggleButton(java.lang.String text, javax.swing.Icon icon)
          Creates a metallic toggle button with initial text and an icon.
 
Method Summary
 boolean contains(int x, int y)
          Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.
 java.lang.String getAbout()
          Application code will not use these methods explicitly.
 java.awt.Color getBackground()
          Gets the background color of this component.
 int getBevelSize()
          Gets the size of the bevel.
 java.awt.Dimension getPreferredSize()
          If the preferredSize has been set to a non-null value just returns it.
 java.awt.Color getRollOverColor()
          Gets the rollover color of this component.
 java.awt.Color getSelectedColor()
          Gets the selected color of this component.
 boolean isContrastBorderPainted()
          Returns whether the contrast border should be painted.
 boolean isContrasted()
          Returns whether the component should be contrasted.
 boolean isElliptic()
          Returns whether an elliptic button should be painted.
 boolean isFlat()
          Returns whether a flat button should be painted.
 boolean isRaised()
          Returns whether the raised border should be painted.
 void paint(java.awt.Graphics g)
           
 void paintInterface(java.awt.Graphics g)
           
 void setAbout(java.lang.String text)
          Application code will not use these methods explicitly.
 void setBackground(java.awt.Color color)
          Sets the background color of this component.
 void setBevelSize(int size)
          Sets the size of the bevel.
 void setContentAreaFilled(boolean contentAreaFilled)
          For this component, this method forces the ContentAreaFilled property to false.
 void setContrastBorderPainted(boolean b)
          Sets whether the contrast border should be painted.
 void setContrasted(boolean b)
          Sets whether the component should be contrasted
 void setElliptic(boolean b)
          Sets whether an elliptic button should be painted.
 void setFlat(boolean b)
          Sets whether a flat button should be painted.
 void setOpaque(boolean opaque)
          If true the component paints every pixel within its bounds.
 void setPreferredSize(java.awt.Dimension preferredSize)
          Sets the preferred size of this component.
 void setRaised(boolean b)
          Sets whether the raised border should be painted.
 void setRollOverColor(java.awt.Color color)
          Sets the rollover color of this component.
 void setSelectedColor(java.awt.Color color)
          Sets the selected color of this component.
 void updateUI()
          Notification from the UIFactory that the L&F has changed.
 
Methods inherited from class javax.swing.JToggleButton
getAccessibleContext, getUIClassID
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, doClick, doClick, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, 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, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setRequestFocusEnabled, setToolTipText, setTransferHandler, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JbcMetallicToggleButton

public JbcMetallicToggleButton()
Creates a metallic toggle button with no set text or icon.


JbcMetallicToggleButton

public JbcMetallicToggleButton(java.lang.String text,
                               javax.swing.Icon icon)
Creates a metallic toggle button with initial text and an icon.

Parameters:
text - the text of the button.
icon - the Icon image to display on the button

JbcMetallicToggleButton

public JbcMetallicToggleButton(javax.swing.Icon icon)
Creates a metallic toggle button with an icon.

Parameters:
icon - the Icon image to display on the button

JbcMetallicToggleButton

public JbcMetallicToggleButton(java.lang.String text)
Creates a metallic toggle button with text.

Parameters:
text - the text of the button

JbcMetallicToggleButton

public JbcMetallicToggleButton(javax.swing.Action a)
Creates a metallic toggle button where properties are taken from the Action supplied.

Method Detail

setAbout

public void setAbout(java.lang.String text)
Application code will not use these methods explicitly.


getAbout

public java.lang.String getAbout()
Application code will not use these methods explicitly.


getPreferredSize

public java.awt.Dimension getPreferredSize()
If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the value of the preferredSize property
See Also:
setPreferredSize(java.awt.Dimension), ComponentUI

setPreferredSize

public void setPreferredSize(java.awt.Dimension preferredSize)
Sets the preferred size of this component. If preferredSize is null, the UI will be asked for the preferred size.

Overrides:
setPreferredSize in class javax.swing.JComponent

paintInterface

public final void paintInterface(java.awt.Graphics g)

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

getBackground

public java.awt.Color getBackground()
Gets the background color of this component.

Overrides:
getBackground in class java.awt.Component
Returns:
This component's background color. If this component does not have a background color, the default background color is returned.
See Also:
setBackground(java.awt.Color)

setBackground

public void setBackground(java.awt.Color color)
Sets the background color of this component.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
color - The color to become this component's background color. If this parameter is null then this component will inherit the default background.
See Also:
getBackground()

getSelectedColor

public java.awt.Color getSelectedColor()
Gets the selected color of this component.

Returns:
This component's selected color. If this component does not have a selected color, the default selected color is returned.
See Also:
setSelectedColor(java.awt.Color)

setSelectedColor

public void setSelectedColor(java.awt.Color color)
Sets the selected color of this component.

Parameters:
color - The color to become this component's selected color. If this parameter is null then this component will inherit the default selected.
See Also:
getSelectedColor()

getRollOverColor

public java.awt.Color getRollOverColor()
Gets the rollover color of this component.

Returns:
This component's rollover color. If this component does not have a rollover color, the default rollover color is returned.
See Also:
setRollOverColor(java.awt.Color)

setRollOverColor

public void setRollOverColor(java.awt.Color color)
Sets the rollover color of this component.

Parameters:
color - The color to become this component's rollover color. If this parameter is null then this component will inherit the default rollover.
See Also:
getRollOverColor()

contains

public boolean contains(int x,
                        int y)
Checks whether this component "contains" the specified point, where x and y are defined to be relative to the coordinate system of this component.

Overrides:
contains in class javax.swing.JComponent
Parameters:
x - the x coordinate of the point.
y - the y coordinate of the point.

updateUI

public void updateUI()
Notification from the UIFactory that the L&F has changed. Called to replace the UI with the latest version from the UIFactory.

Overrides:
updateUI in class javax.swing.JToggleButton
See Also:
JComponent.updateUI()

setOpaque

public void setOpaque(boolean opaque)
If true the component paints every pixel within its bounds. Otherwise, the component may not paint some or all of its pixels, allowing the underlying pixels to show through.

Overrides:
setOpaque in class javax.swing.JComponent
See Also:
JComponent.isOpaque()

setContentAreaFilled

public void setContentAreaFilled(boolean contentAreaFilled)
For this component, this method forces the ContentAreaFilled property to false.

Overrides:
setContentAreaFilled in class javax.swing.AbstractButton

isContrastBorderPainted

public boolean isContrastBorderPainted()
Returns whether the contrast border should be painted.

Returns:
true if the contrast border should be painted, false otherwise
See Also:
setContrastBorderPainted(boolean)

setContrastBorderPainted

public void setContrastBorderPainted(boolean b)
Sets whether the contrast border should be painted.

Parameters:
b - if true the contrast border is painted, false otherwise
See Also:
isContrastBorderPainted()

isRaised

public boolean isRaised()
Returns whether the raised border should be painted.

Returns:
true if the raised border should be painted, false otherwise
See Also:
setRaised(boolean)

setRaised

public void setRaised(boolean b)
Sets whether the raised border should be painted.

Parameters:
b - if true the raised border is painted, false otherwise
See Also:
isRaised()

isFlat

public boolean isFlat()
Returns whether a flat button should be painted.

Returns:
true if a flat button should be painted, false otherwise
See Also:
setFlat(boolean)

setFlat

public void setFlat(boolean b)
Sets whether a flat button should be painted.

Parameters:
b - if true a flat button is painted, false otherwise
See Also:
isFlat()

isElliptic

public boolean isElliptic()
Returns whether an elliptic button should be painted.

Returns:
true if an elliptic button should be painted, false otherwise
See Also:
setElliptic(boolean)

setElliptic

public void setElliptic(boolean b)
Sets whether an elliptic button should be painted.

Parameters:
b - if true an elliptic button is painted, false otherwise
See Also:
isElliptic()

isContrasted

public boolean isContrasted()
Returns whether the component should be contrasted.

Returns:
true if the component should be contrasted, false otherwise
See Also:
setContrasted(boolean)

setContrasted

public void setContrasted(boolean b)
Sets whether the component should be contrasted

Parameters:
b - if true the component is contrasted, false otherwise
See Also:
isContrasted()

setBevelSize

public void setBevelSize(int size)
Sets the size of the bevel.

Parameters:
size - the size of the bevel.
See Also:
getBevelSize()

getBevelSize

public int getBevelSize()
Gets the size of the bevel.

Returns:
the size of the bevel.
See Also:
setBevelSize(int)

JBCSolutions - JbcBeans v1.5

JBCSolutions - JbcBeans v1.5