com.sshtools.ui.awt
Class ImageButton

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bycom.sshtools.ui.awt.ImageTextLabel
              extended bycom.sshtools.ui.awt.ImageButton
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
ActionButton

public class ImageButton
extends ImageTextLabel

An button implementation that can display an image.

Version:
$Revision: 1.1 $
Author:
$author$
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.awt.Color defaultBorderColor
           
protected static int defaultBorderWidth
           
 
Fields inherited from class com.sshtools.ui.awt.ImageTextLabel
EMPTY, LOWERED_BEVEL, NONE, RAISED_BEVEL
 
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
ImageButton()
           
ImageButton(java.awt.Image image, java.lang.String text, java.lang.String actionCommand)
           
 
Method Summary
 boolean action(java.awt.Event event, java.lang.Object arg)
           
 void addActionListener(java.awt.event.ActionListener l)
           
 java.lang.String getActionCommand()
          Get the action command
 int getDarkness()
           
 java.awt.Image getGrayImage()
           
 boolean mouseDown(java.awt.Event event, int x, int y)
           
 boolean mouseEnter(java.awt.Event event, int x, int y)
           
 boolean mouseExit(java.awt.Event event, int x, int y)
           
 boolean mouseUp(java.awt.Event event, int x, int y)
           
 void removeActionListener(java.awt.event.ActionListener l)
           
 void setActionCommand(java.lang.String actionCommand)
          Set the action command
 void setDarkness(int darkness)
           
 void setGrayImage(java.awt.Image grayImage)
           
 void setHoverButton(boolean hoverButton)
          Set if this is a 'hover button'.
 
Methods inherited from class com.sshtools.ui.awt.ImageTextLabel
addNotify, doLayout, getBorderColor, getImage, getInsets, getMargin, getMinimumSize, getPreferredSize, getText, getTextImageGap, isTextVisible, paint, paintBorder, setBorderColor, setBorderType, setImage, setMargin, setText, setTextImageGap, setTextVisible, update
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
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, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDrag, mouseMove, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, 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, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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

defaultBorderWidth

protected static final int defaultBorderWidth
See Also:
Constant Field Values

defaultBorderColor

protected static final java.awt.Color defaultBorderColor
Constructor Detail

ImageButton

public ImageButton()

ImageButton

public ImageButton(java.awt.Image image,
                   java.lang.String text,
                   java.lang.String actionCommand)
Method Detail

setHoverButton

public void setHoverButton(boolean hoverButton)
Set if this is a 'hover button'. If true a border will be raised when the user moves the mouse pointer over this component.

Parameters:
hoverButton -

getActionCommand

public java.lang.String getActionCommand()
Get the action command


setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Set the action command

Parameters:
actionCommand - action command

mouseDown

public boolean mouseDown(java.awt.Event event,
                         int x,
                         int y)

mouseEnter

public boolean mouseEnter(java.awt.Event event,
                          int x,
                          int y)

mouseUp

public boolean mouseUp(java.awt.Event event,
                       int x,
                       int y)

addActionListener

public void addActionListener(java.awt.event.ActionListener l)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)

action

public boolean action(java.awt.Event event,
                      java.lang.Object arg)

mouseExit

public boolean mouseExit(java.awt.Event event,
                         int x,
                         int y)

getDarkness

public int getDarkness()

setDarkness

public void setDarkness(int darkness)

getGrayImage

public java.awt.Image getGrayImage()

setGrayImage

public void setGrayImage(java.awt.Image grayImage)


Copyright © 2003-2004 3SP LTD. All Rights Reserved.