|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--ach.IconButton
IconButton.java (compatible to JDK 1.0.x)
Copyright (c) 2004 Helge Hackbarth, All Rights Reserved.
IconButton is an extension of class Canvas that behaves similar
to the JButton of JFC/Swing without the need to include that
library. It can be used as toggle (two state) button as well.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
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 | |
IconButton(java.lang.String imgName)
Constructor |
|
IconButton(java.lang.String imgName,
java.lang.String toolTipText)
Constructor |
Method Summary | |
void |
disable()
Disable button |
void |
enable()
enable button |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
boolean |
getToggleMode()
get toggle (two state) mode |
boolean |
getToggleState()
get toggle state (true means button is selected (pushed down)) |
boolean |
handleEvent(java.awt.Event evt)
|
boolean |
isEnabled()
|
void |
mapComponent(java.awt.Component c)
Map another component to this button in order to be controlled together with IconButon methods. |
java.awt.Dimension |
minimumSize()
|
void |
paint(java.awt.Graphics g)
|
java.awt.Dimension |
preferredSize()
|
void |
setEnabled(boolean enabledFlag)
Set enabled state of button |
void |
setIcon(java.lang.String imgName)
Set icon image |
void |
setToggleMode(boolean b)
set toggle (two state) mode |
void |
setToggleState(boolean b)
set toggle state |
void |
setToolTipText(java.lang.String text)
Set tooltip text to be displayed when mouse moves over button |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disableEvents, dispatchEvent, doLayout, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IconButton(java.lang.String imgName)
imgName
- String representing the path to the image
(if imageName == null it will look like a seperator)public IconButton(java.lang.String imgName, java.lang.String toolTipText)
imgName
- String representing the path to the image
(if imageName == null it will look like a seperator)toolTipText
- String that should be displayed when mouse moves over buttonMethod Detail |
public void mapComponent(java.awt.Component c)
c
- the component to be controlled together with this buttonpublic void setIcon(java.lang.String imgName)
imgName
- String representing the path to the imagepublic void setEnabled(boolean enabledFlag)
setEnabled
in class java.awt.Component
enabledFlag
- true if button is enabledpublic void disable()
disable
in class java.awt.Component
public void enable()
enable
in class java.awt.Component
public boolean isEnabled()
isEnabled
in class java.awt.Component
public void setToggleMode(boolean b)
b
- true sets button to two state modepublic boolean getToggleMode()
public void setToggleState(boolean b)
b
- true sets button to selected (pushed down) modepublic boolean getToggleState()
public void setToolTipText(java.lang.String text)
toolTipText
- String containing the tooltip textpublic java.awt.Dimension minimumSize()
minimumSize
in class java.awt.Component
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Component
public java.awt.Dimension preferredSize()
preferredSize
in class java.awt.Component
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Component
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public boolean handleEvent(java.awt.Event evt)
handleEvent
in class java.awt.Component
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |