org.jscience.awt.buttons
Class Button

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.jscience.awt.buttons.Button
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
RoundButton, SquareButton, ToggleSwitchButton

public abstract class Button
extends java.awt.Canvas

DOCUMENT ME!

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
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
protected  java.awt.event.ActionListener actionListener
          DOCUMENT ME!
protected  java.awt.Color buttonColor
          DOCUMENT ME!
static java.awt.Color BUTTONCOLOR
          DOCUMENT ME!
protected  java.lang.String caption
          DOCUMENT ME!
protected  boolean captionAtBottom
          DOCUMENT ME!
static java.lang.String DEFAULTFONTNAME
          DOCUMENT ME!
static int DEFAULTFONTSIZE
          DOCUMENT ME!
static int DEFAULTFONTSTYLE
          DOCUMENT ME!
protected  java.awt.Font font
          DOCUMENT ME!
protected  java.lang.String fontName
          DOCUMENT ME!
protected  int fontSize
          DOCUMENT ME!
protected  int fontStyle
          DOCUMENT ME!
protected  boolean hasHighlight
          DOCUMENT ME!
protected  int height
          DOCUMENT ME!
protected  java.awt.Color highlightBrighterColor
          DOCUMENT ME!
protected  java.awt.Color highlightDarkerColor
          DOCUMENT ME!
protected  java.awt.Image offImage
          DOCUMENT ME!
protected  java.awt.Image onImage
          DOCUMENT ME!
protected  java.awt.Color panelColor
          DOCUMENT ME!
static java.awt.Color PANELCOLOR
          DOCUMENT ME!
protected  boolean state
          DOCUMENT ME!
protected  boolean sticky
          DOCUMENT ME!
protected  java.awt.Color textColor
          DOCUMENT ME!
static java.awt.Color TEXTCOLOR
          DOCUMENT ME!
protected  int width
          DOCUMENT ME!
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Button(int width, int height, java.lang.String fontName, int fontStyle, int fontSize, java.lang.String caption, boolean captionAtBottom, boolean sticky, boolean state, boolean hasHighlight, java.awt.Color panelColor, java.awt.Color buttonColor, java.awt.Color textColor)
          Creates a new Button object.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          DOCUMENT ME!
 java.awt.Color getButtonColor()
          DOCUMENT ME!
 java.lang.String getCaption()
          DOCUMENT ME!
 boolean getCaptionAtBottom()
          DOCUMENT ME!
 java.awt.Font getFont()
          DOCUMENT ME!
 java.lang.String getFontName()
          DOCUMENT ME!
 int getFontSize()
          DOCUMENT ME!
 int getFontStyle()
          DOCUMENT ME!
 int getHeight()
          DOCUMENT ME!
 boolean getHighlight()
          DOCUMENT ME!
 java.awt.Color getPanelColor()
          DOCUMENT ME!
abstract  java.awt.Dimension getPreferredSize()
          DOCUMENT ME!
 boolean getState()
          DOCUMENT ME!
 boolean getSticky()
          DOCUMENT ME!
 java.awt.Color getTextColor()
          DOCUMENT ME!
 int getWidth()
          DOCUMENT ME!
abstract  void paint(java.awt.Graphics g)
          DOCUMENT ME!
protected  void processActionEvent(java.awt.event.ActionEvent e)
          DOCUMENT ME!
protected  void processKeyEvent(java.awt.event.KeyEvent e)
          DOCUMENT ME!
protected  void processMouseEvent(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void removeActionListener(java.awt.event.ActionListener l)
          DOCUMENT ME!
 void setButtonColor(java.awt.Color buttonColor)
          DOCUMENT ME!
 void setCaption(java.lang.String caption)
          DOCUMENT ME!
 void setCaptionAtBottom(boolean captionAtBottom)
          DOCUMENT ME!
 void setFont(java.awt.Font font)
          DOCUMENT ME!
 void setFontName(java.lang.String fontName)
          DOCUMENT ME!
 void setFontSize(int fontSize)
          DOCUMENT ME!
 void setFontStyle(int fontStyle)
          DOCUMENT ME!
 void setHeight(int height)
          DOCUMENT ME!
 void setHighlight(boolean hasHighlight)
          DOCUMENT ME!
 void setPanelColor(java.awt.Color panelColor)
          DOCUMENT ME!
 void setState(boolean state)
          DOCUMENT ME!
 void setSticky(boolean sticky)
          DOCUMENT ME!
 void setTextColor(java.awt.Color textColor)
          DOCUMENT ME!
 void setWidth(int width)
          DOCUMENT ME!
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PANELCOLOR

public static final java.awt.Color PANELCOLOR
DOCUMENT ME!


BUTTONCOLOR

public static final java.awt.Color BUTTONCOLOR
DOCUMENT ME!


TEXTCOLOR

public static final java.awt.Color TEXTCOLOR
DOCUMENT ME!


DEFAULTFONTNAME

public static final java.lang.String DEFAULTFONTNAME
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTFONTSTYLE

public static final int DEFAULTFONTSTYLE
DOCUMENT ME!

See Also:
Constant Field Values

DEFAULTFONTSIZE

public static final int DEFAULTFONTSIZE
DOCUMENT ME!

See Also:
Constant Field Values

width

protected int width
DOCUMENT ME!


height

protected int height
DOCUMENT ME!


fontName

protected java.lang.String fontName
DOCUMENT ME!


fontStyle

protected int fontStyle
DOCUMENT ME!


fontSize

protected int fontSize
DOCUMENT ME!


font

protected java.awt.Font font
DOCUMENT ME!


caption

protected java.lang.String caption
DOCUMENT ME!


captionAtBottom

protected boolean captionAtBottom
DOCUMENT ME!


sticky

protected boolean sticky
DOCUMENT ME!


state

protected boolean state
DOCUMENT ME!


hasHighlight

protected boolean hasHighlight
DOCUMENT ME!


panelColor

protected java.awt.Color panelColor
DOCUMENT ME!


buttonColor

protected java.awt.Color buttonColor
DOCUMENT ME!


textColor

protected java.awt.Color textColor
DOCUMENT ME!


highlightBrighterColor

protected java.awt.Color highlightBrighterColor
DOCUMENT ME!


highlightDarkerColor

protected java.awt.Color highlightDarkerColor
DOCUMENT ME!


actionListener

protected transient java.awt.event.ActionListener actionListener
DOCUMENT ME!


onImage

protected java.awt.Image onImage
DOCUMENT ME!


offImage

protected java.awt.Image offImage
DOCUMENT ME!

Constructor Detail

Button

public Button(int width,
              int height,
              java.lang.String fontName,
              int fontStyle,
              int fontSize,
              java.lang.String caption,
              boolean captionAtBottom,
              boolean sticky,
              boolean state,
              boolean hasHighlight,
              java.awt.Color panelColor,
              java.awt.Color buttonColor,
              java.awt.Color textColor)
Creates a new Button object.

Parameters:
width - DOCUMENT ME!
height - DOCUMENT ME!
fontName - DOCUMENT ME!
fontStyle - DOCUMENT ME!
fontSize - DOCUMENT ME!
caption - DOCUMENT ME!
captionAtBottom - DOCUMENT ME!
sticky - DOCUMENT ME!
state - DOCUMENT ME!
hasHighlight - DOCUMENT ME!
panelColor - DOCUMENT ME!
buttonColor - DOCUMENT ME!
textColor - DOCUMENT ME!
Method Detail

getPreferredSize

public abstract java.awt.Dimension getPreferredSize()
DOCUMENT ME!

Overrides:
getPreferredSize in class java.awt.Component
Returns:
DOCUMENT ME!

paint

public abstract void paint(java.awt.Graphics g)
DOCUMENT ME!

Overrides:
paint in class java.awt.Canvas
Parameters:
g - DOCUMENT ME!

getWidth

public int getWidth()
DOCUMENT ME!

Overrides:
getWidth in class java.awt.Component
Returns:
DOCUMENT ME!

setWidth

public void setWidth(int width)
DOCUMENT ME!

Parameters:
width - DOCUMENT ME!

getHeight

public int getHeight()
DOCUMENT ME!

Overrides:
getHeight in class java.awt.Component
Returns:
DOCUMENT ME!

setHeight

public void setHeight(int height)
DOCUMENT ME!

Parameters:
height - DOCUMENT ME!

getFont

public java.awt.Font getFont()
DOCUMENT ME!

Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component
Returns:
DOCUMENT ME!

setFont

public void setFont(java.awt.Font font)
DOCUMENT ME!

Overrides:
setFont in class java.awt.Component
Parameters:
font - DOCUMENT ME!

getFontName

public java.lang.String getFontName()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontName

public void setFontName(java.lang.String fontName)
DOCUMENT ME!

Parameters:
fontName - DOCUMENT ME!

getFontStyle

public int getFontStyle()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontStyle

public void setFontStyle(int fontStyle)
DOCUMENT ME!

Parameters:
fontStyle - DOCUMENT ME!

getFontSize

public int getFontSize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFontSize

public void setFontSize(int fontSize)
DOCUMENT ME!

Parameters:
fontSize - DOCUMENT ME!

getCaption

public java.lang.String getCaption()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setCaption

public void setCaption(java.lang.String caption)
DOCUMENT ME!

Parameters:
caption - DOCUMENT ME!

getCaptionAtBottom

public boolean getCaptionAtBottom()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setCaptionAtBottom

public void setCaptionAtBottom(boolean captionAtBottom)
DOCUMENT ME!

Parameters:
captionAtBottom - DOCUMENT ME!

getSticky

public boolean getSticky()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setSticky

public void setSticky(boolean sticky)
DOCUMENT ME!

Parameters:
sticky - DOCUMENT ME!

getState

public boolean getState()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setState

public void setState(boolean state)
DOCUMENT ME!

Parameters:
state - DOCUMENT ME!

getHighlight

public boolean getHighlight()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setHighlight

public void setHighlight(boolean hasHighlight)
DOCUMENT ME!

Parameters:
hasHighlight - DOCUMENT ME!

getPanelColor

public java.awt.Color getPanelColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setPanelColor

public void setPanelColor(java.awt.Color panelColor)
DOCUMENT ME!

Parameters:
panelColor - DOCUMENT ME!

getButtonColor

public java.awt.Color getButtonColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setButtonColor

public void setButtonColor(java.awt.Color buttonColor)
DOCUMENT ME!

Parameters:
buttonColor - DOCUMENT ME!

getTextColor

public java.awt.Color getTextColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setTextColor

public void setTextColor(java.awt.Color textColor)
DOCUMENT ME!

Parameters:
textColor - DOCUMENT ME!

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
DOCUMENT ME!

Parameters:
l - DOCUMENT ME!

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
DOCUMENT ME!

Parameters:
l - DOCUMENT ME!

processActionEvent

protected void processActionEvent(java.awt.event.ActionEvent e)
DOCUMENT ME!

Parameters:
e - DOCUMENT ME!

processMouseEvent

protected void processMouseEvent(java.awt.event.MouseEvent e)
DOCUMENT ME!

Overrides:
processMouseEvent in class java.awt.Component
Parameters:
e - DOCUMENT ME!

processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)
DOCUMENT ME!

Overrides:
processKeyEvent in class java.awt.Component
Parameters:
e - DOCUMENT ME!