Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class uk.co.ist.mwt.ImageButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--uk.co.ist.mwt.ShadowedComponent
                    |
                    +--uk.co.ist.mwt.BoxedButton
                          |
                          +--uk.co.ist.mwt.ImageButton

public class ImageButton
extends BoxedButton
ImageButtons are buttons which display an image inside their shadow box.

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
ImageButton()
          Constructor; simply sets a sensible shadow thickness
 
Method Summary
java.awt.Image getArmedImage()
          Method to get the image displayed in the button when it is enabled and armed
java.awt.Image getDisabledImage()
          Method to get the image displayed in the button when it is disabled
java.awt.Image getImage()
          Method to get the image displayed in the button when it is enabled and unarmed
java.awt.Dimension getMinimumSize()
          Gets the minimum size of the ImageButton.
java.awt.Dimension getPreferredSize()
          Gets the preferred size of the ImageButton.
boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int w, int h)
          Routine to repaint the image when it changes; we ask the parent to relayout if our idea of its size has changed.
void paint(java.awt.Graphics g)
          Method to paint the button - its shadow box and its image.
void setArmedImage(java.awt.Image i)
          Method to specify the image to display in the button when it is enabled and armed
void setDisabledImage(java.awt.Image i)
          Method to specify the image to display in the button when it is disabled
void setImage(java.awt.Image i)
          Method to specify the image to display in the button when it is enabled and unarmed
 
Methods inherited from class uk.co.ist.mwt.BoxedButton
addActionListener, onMouseDown, onMouseEnter, onMouseExit, onMouseUp, paint, removeActionListener
 
Methods inherited from class uk.co.ist.mwt.ShadowedComponent
draw3DRect, draw3DRect, draw3DRect, draw3DRect, drawShadow, drawShadow, getBottomShadowColor, getShadowThickness, getTopShadowColor, setBottomShadowColor, setShadowThickness, setTopShadowColor
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, 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, getMinimumSize, getName, getParent, getPeer, getPreferredSize, 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, paint, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, 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, notifyAll, notify, toString, wait, wait, wait
 

Constructor Detail

ImageButton

public ImageButton()
Constructor; simply sets a sensible shadow thickness
Method Detail

setImage

public void setImage(java.awt.Image i)
Method to specify the image to display in the button when it is enabled and unarmed
Parameters:
i - the image to display

getImage

public java.awt.Image getImage()
Method to get the image displayed in the button when it is enabled and unarmed

setDisabledImage

public void setDisabledImage(java.awt.Image i)
Method to specify the image to display in the button when it is disabled
Parameters:
i - the image to display

getDisabledImage

public java.awt.Image getDisabledImage()
Method to get the image displayed in the button when it is disabled

setArmedImage

public void setArmedImage(java.awt.Image i)
Method to specify the image to display in the button when it is enabled and armed
Parameters:
i - the image to display

getArmedImage

public java.awt.Image getArmedImage()
Method to get the image displayed in the button when it is enabled and armed
Parameters:
i - the image to display

paint

public void paint(java.awt.Graphics g)
Method to paint the button - its shadow box and its image.
Parameters:
g - the graphics context into which we should draw
Overrides:
paint in class BoxedButton

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of the ImageButton. This is the same as its minimum size, and is large enough to hold the image with a shadow box surrounding it.
Overrides:
getPreferredSize in class java.awt.Component
See Also:
getMinimumSize

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minimum size of the ImageButton. This is the same as its preferred size, and is large enough to hold the image with a shadow box surrounding it.
Overrides:
getMinimumSize in class java.awt.Component
See Also:
getPreferredSize

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Routine to repaint the image when it changes; we ask the parent to relayout if our idea of its size has changed.
Overrides:
imageUpdate in class java.awt.Component

Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD