vipratech.beans.standardbeans
Class ControlButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--vipratech.awt.VCanvas
                    |
                    +--vipratech.beans.standardbeans.ControlButton

public class ControlButton
extends VCanvas

The Control class displays recoder buttons that responds to mouse over and mouse pressed events by changing its 3D appearance.

Icons can be added from vipratech.beans.standardbeans.resources.ControlButtonIcon that also respond to these events.

On mouse release the button generates an action event object which is sent to any registered action listeners.

Version:
1.00, March 2002
Author:
Hendrik Dathe   dathe@chemie.uni-leipzig.de
See Also:
MainButtonIcon, Serialized Form

Fields inherited from class vipratech.awt.VCanvas
fm
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ControlButton()
          Constructor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Allows this component to be wired at design time with action listeners
 boolean getClickable()
          Returns the boolean state of the clickable variable.
 boolean getClickedOnce()
          Returns true if the button has been set to clickable and the button is in the recessed clicked once position.
 boolean getEnabled()
          Returns the enabled state of the button.
 int getIcon()
          Gets the int constant resprenting the icon.
 java.lang.String getKey()
          Returns the key for the button.
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this component of width 56px, height 36px.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of this component of width 56px, height 36px.
 void paint(java.awt.Graphics g)
          Draws the complete button, border and icon depending on the current mouse event.
 void removeActionListener(java.awt.event.ActionListener listener)
          Allows this component to be un-wired at design time with action listeners
 void setClickable(boolean clickable)
          Allows the button to be set to clickable.
 void setEnabled(boolean enabled)
          Allows the button to be disabled.
 void setIcon(int icon)
          Sets the icon for the button using an int constant from vipratech.beans.standardbeans.resources.ControlButtonIcon.
 void setKey(java.lang.String key)
          Sets a key for the button.
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlButton

public ControlButton()
Constructor.
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Allows this component to be wired at design time with action listeners

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Allows this component to be un-wired at design time with action listeners

paint

public final void paint(java.awt.Graphics g)
Draws the complete button, border and icon depending on the current mouse event.
Overrides:
paint in class java.awt.Canvas

getMinimumSize

public final java.awt.Dimension getMinimumSize()
Returns the minimum size of this component of width 56px, height 36px.
Overrides:
getMinimumSize in class java.awt.Component

getPreferredSize

public final java.awt.Dimension getPreferredSize()
Returns the preferred size of this component of width 56px, height 36px.
Overrides:
getPreferredSize in class java.awt.Component

setEnabled

public final void setEnabled(boolean enabled)
Allows the button to be disabled. The button is enabled by default.
Overrides:
setEnabled in class java.awt.Component

getEnabled

public final boolean getEnabled()
Returns the enabled state of the button.

setClickable

public final void setClickable(boolean clickable)
Allows the button to be set to clickable. The button can then be clicked once to be recessed and then clicked a second time to return to the enabled state.

getClickable

public final boolean getClickable()
Returns the boolean state of the clickable variable.

getClickedOnce

public final boolean getClickedOnce()
Returns true if the button has been set to clickable and the button is in the recessed clicked once position.

setIcon

public final void setIcon(int icon)
Sets the icon for the button using an int constant from vipratech.beans.standardbeans.resources.ControlButtonIcon. Possible values are ICON_START, ICON_STOP, ICON_FORWARD, ICON_BACKWARD, ICON_FASTFORWARD, ICON_FASTBACKWARD and ICON_INFO .

getIcon

public final int getIcon()
Gets the int constant resprenting the icon.

setKey

public final void setKey(java.lang.String key)
Sets a key for the button. The key is used to extract a locale specific label from a key/value pair in a resource bundle.

getKey

public final java.lang.String getKey()
Returns the key for the button. The key is used to extract a locale specific label from a key/value pair in a resource bundle.

dathe@chemie.uni-leipzig.de"

http://leipzig.vernetztes-studium.de