|
||||||||
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
chrriis.dj.swingsuite.JComboButton
public class JComboButton
A button primarily targeted for toolbars which features a sub-section containing an arrow.
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
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 | |
---|---|
JComboButton(Action action,
boolean isDivided)
Construct a combo button with an action. |
|
JComboButton(boolean isDivided)
Construct a combo button. |
|
JComboButton(Icon icon,
boolean isDivided)
Construct a combo button with an icon. |
|
JComboButton(String text,
boolean isDivided)
Construct a combo button with some text. |
|
JComboButton(String text,
Icon icon,
boolean isDivided)
Construct a combo button with an icon and some text. |
Method Summary | |
---|---|
protected void |
fireActionPerformed(ActionEvent e)
|
JPopupMenu |
getArrowPopupMenu()
Get the popup menu that is currently associated to the arrow. |
static boolean |
isArrowEvent(ActionEvent e)
Indicate whether the event originates from the arrow of a combo button. |
boolean |
isDivided()
Indicate whether the button is divided in two different parts. |
protected void |
paintComponent(Graphics g)
|
protected void |
processKeyEvent(KeyEvent e)
|
void |
setArrowPopupMenu(JPopupMenu arrowPopupMenu)
Set a popup menu that is automatically shown when the arrow is pressed. |
void |
setDivided(boolean isDivided)
Set whether the combo button is divided in two different parts each with their own events: the button and the arrow. |
void |
setUI(ButtonUI ui)
|
Methods inherited from class javax.swing.JButton |
---|
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 |
Constructor Detail |
---|
public JComboButton(Action action, boolean isDivided)
action
- the action to use.isDivided
- true if the button is to be devided in two sections (button area, arrow area), false otherwise.public JComboButton(boolean isDivided)
isDivided
- true if the button is to be devided in two sections (button area, arrow area), false otherwise.public JComboButton(Icon icon, boolean isDivided)
icon
- the icon to use.isDivided
- true if the button is to be devided in two sections (button area, arrow area), false otherwise.public JComboButton(String text, boolean isDivided)
text
- the text to use.isDivided
- true if the button is to be devided in two sections (button area, arrow area), false otherwise.public JComboButton(String text, Icon icon, boolean isDivided)
text
- the text to use.icon
- the icon to use.isDivided
- true if the button is to be devided in two sections (button area, arrow area), false otherwise.Method Detail |
---|
public void setUI(ButtonUI ui)
setUI
in class AbstractButton
protected void processKeyEvent(KeyEvent e)
processKeyEvent
in class JComponent
public static boolean isArrowEvent(ActionEvent e)
e
- the event to test.
protected void fireActionPerformed(ActionEvent e)
fireActionPerformed
in class AbstractButton
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public void setDivided(boolean isDivided)
isDivided
- true if the button should be divided, false otherwise.public boolean isDivided()
public void setArrowPopupMenu(JPopupMenu arrowPopupMenu)
arrowPopupMenu
- the popup menu to show, or null to remove the popup menu.public JPopupMenu getArrowPopupMenu()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |