|
|||||||
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 | +--IButton
An image button class that creates buttons that can have a text label or an image for its representation.
Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
Field Summary | |
static int |
CENTER
|
static int |
EAST
|
protected java.awt.Image |
image
The image for the IButton |
static int |
NORTH
|
static int |
NORTHEAST
|
static int |
NORTHWEST
|
static int |
SOUTH
|
static int |
SOUTHEAST
|
static int |
SOUTHWEST
|
static int |
STRETCH
|
static int |
WEST
|
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
componentListener,
componentListenerK,
componentOrientation,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Constructor Summary | |
(package private) |
IButton()
Creates a new IButton with a blank label, no image, an alignment of center and a border width of 1. |
(package private) |
IButton(java.awt.Image _image)
Creates a new IButton with a blank label, a specified image, an alignment of center and a border width of 1. |
(package private) |
IButton(java.lang.String _label)
Creates a new IButton with a specified label, no image, an alignment of center and a border width of 1. |
(package private) |
IButton(java.lang.String _label,
java.awt.Image _image)
Creates a new IButton with non-default label and image, an alignment of center and a border width of 1. |
(package private) |
IButton(java.lang.String _label,
java.awt.Image _image,
int _align)
Creates a new IButton with non-default label, image, and alignment, and a border width of 1. |
(package private) |
IButton(java.lang.String _label,
java.awt.Image _image,
int _align,
int _border)
Creates a new IButton with non-default label, image, alignment, and border width |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener l)
Adds an object that implements the ActionListener interface to this IButton's listener list |
void |
clear(java.awt.Graphics g)
Clears the button's graphic before painting it |
java.lang.String |
getActionCommand()
Gets the actionCommand used when an action event is triggered |
int |
getAlignment()
Gets the alignment |
int |
getBorder()
Gets the border width |
boolean |
getHighlight()
Gets the current highlight status |
java.lang.String |
getLabel()
Gets the IButton's current label |
java.awt.Dimension |
getMinimumSize()
Gets the minimum dimensions of the button. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred dimensions of the button. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Removes the specified ActionListener from the IButton's listener list |
void |
mouseEntered(java.awt.event.MouseEvent e)
Default handling mouseEntered events |
void |
mouseExited(java.awt.event.MouseEvent e)
Default handling mouseExited events |
void |
mousePressed(java.awt.event.MouseEvent e)
Default handling mousePressed events |
void |
mouseReleased(java.awt.event.MouseEvent e)
Default handling mouseReleased events |
void |
paint(java.awt.Graphics g)
Draws the IButton on the specified graphics object |
void |
repaint(int x,
int y,
int width,
int height)
Overrides the call to repaint a specific rectangle to repaint the entire IButton |
void |
setActionCommand(java.lang.String _actionCommand)
Sets the actionCommand specified by the IButton when an action event is triggered |
void |
setAlignment(int _align)
Sets the alignment to the input, which should be one of the constants defined in this class |
void |
setBorder(int _border)
Sets the border width to the input |
void |
setHighlight(boolean _highlight)
|
void |
setLabel(java.lang.String _label)
Sets the IButton's label |
void |
setPersistentHighlight(boolean _highlight)
|
java.lang.String |
toString()
Returns a string representation of this IButton |
void |
update(java.awt.Graphics g)
Is called whenever the button's graphic representation needs to be updated. |
Methods inherited from class java.awt.Canvas |
|
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
deliverEvent,
disable,
disableEvents,
dispatchEvent,
dispatchEventImpl,
doLayout,
enable,
enable,
enableEvents,
enableInputMethods,
eventEnabled,
firePropertyChange,
getAlignmentX,
getAlignmentY,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentAt,
getComponentAt,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getIntrinsicCursor,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getMaximumSize,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
invalidate,
isDisplayable,
isDoubleBuffered,
isEnabled,
isEnabledImpl,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
layout,
lightweightPrint,
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,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
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,
transferFocus,
validate |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int CENTER
public static final int WEST
public static final int EAST
public static final int NORTH
public static final int SOUTH
public static final int NORTHWEST
public static final int NORTHEAST
public static final int SOUTHWEST
public static final int SOUTHEAST
public static final int STRETCH
protected java.awt.Image image
Constructor Detail |
IButton(java.lang.String _label, java.awt.Image _image, int _align, int _border)
_label
- the label and actionCommand_image
- the icon_align
- the alignment, from IButton's constants_border
- the width of the border, in pixelsIButton(java.lang.String _label, java.awt.Image _image, int _align)
_label
- the label and actionCommand_image
- the icon_align
- the alignment, from IButton's constantsIButton(java.awt.Image _image)
_image
- the iconIButton(java.lang.String _label, java.awt.Image _image)
_label
- the label and actionCommand_image
- the iconIButton(java.lang.String _label)
_label
- the label and actionCommandIButton()
Method Detail |
public void setBorder(int _border)
_border
- the border width in pixelspublic int getBorder()
public void setAlignment(int _align)
_align
- the new alignmentpublic int getAlignment()
public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public boolean getHighlight()
public void setHighlight(boolean _highlight)
public void setPersistentHighlight(boolean _highlight)
public void repaint(int x, int y, int width, int height)
x
- x coordinatey
- y coordinatewidth
- the widthheight
- the heightpublic void clear(java.awt.Graphics g)
g
- The Graphics object to draw topublic void update(java.awt.Graphics g)
g
- The graphics object to draw topublic void paint(java.awt.Graphics g)
g
- the Graphics object to draw topublic void setLabel(java.lang.String _label)
_label
- the new labelpublic java.lang.String getLabel()
public java.lang.String toString()
public void setActionCommand(java.lang.String _actionCommand)
_actionCommand
- the new actionCommandpublic java.lang.String getActionCommand()
public void addActionListener(java.awt.event.ActionListener l)
l
- the ActionListener object to addpublic void mouseClicked(java.awt.event.MouseEvent e)
l
- the ActionListener object to remove
public synchronized void removeActionListenter (ActionListener l)
{
listeners.removeElement(l);
}
/**
Default handling mouseClicked eventse
- the triggered MouseEventspublic void mouseEntered(java.awt.event.MouseEvent e)
e
- the triggered MouseEventspublic void mouseExited(java.awt.event.MouseEvent e)
e
- the triggered MouseEventspublic void mousePressed(java.awt.event.MouseEvent e)
e
- the triggered MouseEventspublic void mouseReleased(java.awt.event.MouseEvent e)
e
- the triggered MouseEvents
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |