public class ButtonDef
extends java.lang.Object
implements java.lang.Cloneable
Button
.Button
Constructor and Description |
---|
ButtonDef(java.lang.String actionName,
javax.swing.ImageIcon icon,
java.lang.String buttonText,
boolean centerIconText)
Constructs a ButtonDef.
|
ButtonDef(java.lang.String actionName,
javax.swing.ImageIcon icon,
java.lang.String buttonText,
boolean centerIconText,
java.awt.Font buttonTextFont)
Constructs a ButtonDef.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones this ButtonDef
|
java.lang.String |
getActionName()
Gets the action name for this button definition.
|
java.lang.String |
getButtonText()
Gets the text for this button definition.
|
java.awt.Font |
getFont()
Returns the button text font.
|
javax.swing.Icon |
getIcon()
Gets the original icon (set by the constructor).
|
javax.swing.Icon |
getIconDisabled()
Returns a disabled icon.
|
boolean |
isCenterIconText()
Returns true if the text and/or the icon is centered on the button.
|
boolean |
isUpdateToPopupSelection() |
void |
setFont(java.awt.Font font)
Sets the button text font.
|
void |
setIcon(javax.swing.Icon icon)
Sets the icon to use.
|
void |
setText(java.lang.String buttonText)
Sets the text for this button definition.
|
void |
setUpdateToPopupSelection(boolean updateToPopupSelection)
If true (default), set this ButtonDef active if the main button has a ButtonGroup.
|
public ButtonDef(java.lang.String actionName, javax.swing.ImageIcon icon, java.lang.String buttonText, boolean centerIconText)
actionName
- the action name that will be fired (required)icon
- an icon to display (optional)buttonText
- the text to display (optional)centerIconText
- is the icon and / or the text will be centeredpublic ButtonDef(java.lang.String actionName, javax.swing.ImageIcon icon, java.lang.String buttonText, boolean centerIconText, java.awt.Font buttonTextFont)
actionName
- the action name that will be fired (required)icon
- an icon to display (optional)buttonText
- the text to display (optional)centerIconText
- is the icon and / or the text will be centeredbuttonTextFont
- the button text fontpublic java.lang.String getActionName()
public javax.swing.Icon getIcon()
null
public void setIcon(javax.swing.Icon icon)
null
for noneicon
- an iconpublic java.lang.String getButtonText()
null
public void setText(java.lang.String buttonText)
null
for nonebuttonText
- the new textpublic boolean isCenterIconText()
public javax.swing.Icon getIconDisabled()
public java.awt.Font getFont()
UIManager.getFont("Label.font")
public void setFont(java.awt.Font font)
null
is passed, the default UI font will be set.font
- public void setUpdateToPopupSelection(boolean updateToPopupSelection)
updateToPopupSelection
- public boolean isUpdateToPopupSelection()
public java.lang.Object clone()
clone
in class java.lang.Object