|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas org.w3c.tools.widgets.ImageButton
public class ImageButton
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected java.awt.Image |
currentImg
|
protected java.awt.Image |
img1
|
protected java.awt.Image |
img2
|
protected boolean |
switchable
|
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(java.awt.Image img)
Construct an ImageButton with no action command |
|
ImageButton(java.awt.Image img1,
java.awt.Image img2)
Construct an ImageButton with the specified action command |
|
ImageButton(java.awt.Image img1,
java.awt.Image img2,
java.lang.String command)
Construct an ImageButton with the specified action command |
|
ImageButton(java.awt.Image img,
java.lang.String command)
Construct an ImageButton with the specified action command |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener al)
Adds an action listener to this ImageButton |
protected void |
fireActionEvent()
fire a new ActionEvent and process it, if some listeners are listening |
java.lang.String |
getActionCommand()
Returns the action command String |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of the ImageButton |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of the ImageButton |
boolean |
imageUpdate(java.awt.Image img,
int flaginfo,
int x,
int y,
int width,
int height)
called when more informations about the image are available. |
protected void |
initSize()
Gets the size of the Image to calculate the minimum size of the Button |
void |
paint(java.awt.Graphics g)
paint the ImageButton in its initial shape |
protected void |
paintShadow(boolean raised)
paints the ImageButton using double buffering |
void |
removeActionListener(java.awt.event.ActionListener al)
Removes an action listener to this ImageButton |
void |
setActionCommand(java.lang.String command)
Sets the action command String used when an ActionEvent is fired |
void |
switchImage()
|
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, 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, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, 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, 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, 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 |
---|
protected boolean switchable
protected java.awt.Image img1
protected java.awt.Image img2
protected java.awt.Image currentImg
Constructor Detail |
---|
public ImageButton(java.awt.Image img1, java.awt.Image img2, java.lang.String command)
img1
- The image of this ImageButtonimg2
- The image of this ImageButtoncommand
- The action command Stringpublic ImageButton(java.awt.Image img1, java.awt.Image img2)
img1
- The image of this ImageButtonrealesed
- The image of this ImageButtonpublic ImageButton(java.awt.Image img, java.lang.String command)
img
- The image of this ImageButtoncommand
- The action command Stringpublic ImageButton(java.awt.Image img)
img
- The image of this ImageButtonMethod Detail |
---|
protected void initSize()
public void switchImage()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- A Graphicsprotected void paintShadow(boolean raised)
raised
- A boolean which shows the state of the buttonpublic boolean imageUpdate(java.awt.Image img, int flaginfo, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
imageUpdate
in class java.awt.Component
ImageObserver
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void setActionCommand(java.lang.String command)
command
- The command Stringpublic java.lang.String getActionCommand()
public void addActionListener(java.awt.event.ActionListener al)
al
- The ActionListenerpublic void removeActionListener(java.awt.event.ActionListener al)
al
- The ActionListenerprotected void fireActionEvent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |