|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
com.pepper.guiutils.ToolBarButton
public class ToolBarButton
ToolBarButton
is to be used in application toolbars. It is not
focusable, has no border, and is transparent to allow the gradient toolbar
background to show through. When pressed, the button highlights with the
default button press background color. This is to match the behavior of
the JavaScript buttons currently used in page-based applications.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JButton |
---|
JButton.AccessibleJButton |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected static Font |
TOOLBAR_FONT
Font for toolbar buttons |
protected static Color |
TOOLBAR_FONT_COLOR
Font color for toolbars |
protected static Color |
TOOLBAR_SELECTION_BACKGROUND_COLOR
Selection background color for toolbar buttons when pressed |
protected static Color |
TOOLBAR_SELECTION_FOREGROUND_COLOR
Selection foreground color for toolbar buttons when pressed |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ToolBarButton(Action action,
Icon icon)
Create a new instance of ToolBarButton that is associated with
the specified action and is displayed as in icon only. |
|
ToolBarButton(Action action,
Icon icon,
String text)
Create a new instance of ToolBarButton that is associated with
the specified action and is displayed as in icon with text to its right. |
|
ToolBarButton(Action action,
String text)
Create a new instance of ToolBarButton that is associated with
the specified action and is displayed as text only. |
Method Summary | |
---|---|
protected void |
deselect()
Turn off the selection highlight. |
boolean |
isFocusable()
Override to make the button not focusable. |
protected void |
processMouseEvent(MouseEvent evt)
Highlight the button when pressed. |
void |
requestFocus()
Override to make the button not focusable. |
protected void |
select()
Turn on the selection highlight. |
Methods inherited from class javax.swing.JButton |
---|
configurePropertiesFromAction, getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final Font TOOLBAR_FONT
protected static final Color TOOLBAR_FONT_COLOR
protected static final Color TOOLBAR_SELECTION_BACKGROUND_COLOR
protected static final Color TOOLBAR_SELECTION_FOREGROUND_COLOR
Constructor Detail |
---|
public ToolBarButton(Action action, String text)
ToolBarButton
that is associated with
the specified action and is displayed as text only.
action
- the action to be performed when the toolbar button is pressedtext
- the text to be displayed in the toolbar buttonpublic ToolBarButton(Action action, Icon icon)
ToolBarButton
that is associated with
the specified action and is displayed as in icon only.
action
- the action to be performed when the toolbar button is pressedicon
- the icon to be displayed in the toolbar buttonpublic ToolBarButton(Action action, Icon icon, String text)
ToolBarButton
that is associated with
the specified action and is displayed as in icon with text to its right.
action
- the action to be performed when the toolbar button is pressedicon
- the icon to be displayed in the toolbar buttontext
- the text to be displayed in the toolbar buttonMethod Detail |
---|
public boolean isFocusable()
isFocusable
in class Component
false
to make the button not focusable.public void requestFocus()
requestFocus
in class JComponent
protected void processMouseEvent(MouseEvent evt)
processMouseEvent
in class JComponent
protected void select()
protected void deselect()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |