|
NextApp Echo2 v2.1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo2.app.Component nextapp.echo2.app.button.AbstractButton
public abstract class AbstractButton
An abstract base class for button components. Provides basic properties, a model, and event handling facilities.
Field Summary | |
---|---|
static java.lang.String |
ACTION_LISTENERS_CHANGED_PROPERTY
|
static java.lang.String |
INPUT_CLICK
|
static java.lang.String |
PROPERTY_ALIGNMENT
|
static java.lang.String |
PROPERTY_BACKGROUND_IMAGE
|
static java.lang.String |
PROPERTY_BORDER
|
static java.lang.String |
PROPERTY_DISABLED_BACKGROUND
|
static java.lang.String |
PROPERTY_DISABLED_BACKGROUND_IMAGE
|
static java.lang.String |
PROPERTY_DISABLED_BORDER
|
static java.lang.String |
PROPERTY_DISABLED_FONT
|
static java.lang.String |
PROPERTY_DISABLED_FOREGROUND
|
static java.lang.String |
PROPERTY_DISABLED_ICON
|
static java.lang.String |
PROPERTY_HEIGHT
|
static java.lang.String |
PROPERTY_ICON
|
static java.lang.String |
PROPERTY_ICON_TEXT_MARGIN
|
static java.lang.String |
PROPERTY_INSETS
|
static java.lang.String |
PROPERTY_LINE_WRAP
|
static java.lang.String |
PROPERTY_MODEL
|
static java.lang.String |
PROPERTY_PRESSED_BACKGROUND
|
static java.lang.String |
PROPERTY_PRESSED_BACKGROUND_IMAGE
|
static java.lang.String |
PROPERTY_PRESSED_BORDER
|
static java.lang.String |
PROPERTY_PRESSED_ENABLED
|
static java.lang.String |
PROPERTY_PRESSED_FONT
|
static java.lang.String |
PROPERTY_PRESSED_FOREGROUND
|
static java.lang.String |
PROPERTY_PRESSED_ICON
|
static java.lang.String |
PROPERTY_ROLLOVER_BACKGROUND
|
static java.lang.String |
PROPERTY_ROLLOVER_BACKGROUND_IMAGE
|
static java.lang.String |
PROPERTY_ROLLOVER_BORDER
|
static java.lang.String |
PROPERTY_ROLLOVER_ENABLED
|
static java.lang.String |
PROPERTY_ROLLOVER_FONT
|
static java.lang.String |
PROPERTY_ROLLOVER_FOREGROUND
|
static java.lang.String |
PROPERTY_ROLLOVER_ICON
|
static java.lang.String |
PROPERTY_TEXT
|
static java.lang.String |
PROPERTY_TEXT_ALIGNMENT
|
static java.lang.String |
PROPERTY_TEXT_POSITION
|
static java.lang.String |
PROPERTY_TOOL_TIP_TEXT
|
static java.lang.String |
PROPERTY_WIDTH
|
Constructor Summary | |
---|---|
AbstractButton()
|
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Adds an ActionListener to receive notification of user
actions, i.e., button presses. |
void |
doAction()
Programmatically performs a click/activation of the button. |
void |
fireActionPerformed(ActionEvent e)
Notifies all listeners that have registered for this event type. |
java.lang.String |
getActionCommand()
Retrieves the action command from the ButtonModel . |
Alignment |
getAlignment()
Returns the alignment of the button's content. |
FillImage |
getBackgroundImage()
Returns the background image of the button. |
Border |
getBorder()
Returns the border displayed around the button. |
Color |
getDisabledBackground()
Returns the background color of the button when the button is disabled. |
FillImage |
getDisabledBackgroundImage()
Returns the background image displayed when the button is disabled. |
Border |
getDisabledBorder()
Returns the border displayed around the button when the button is disabled. |
Font |
getDisabledFont()
Returns the font of the button when the button is disabled. |
Color |
getDisabledForeground()
Returns the foreground color of the button when the button is disabled. |
ImageReference |
getDisabledIcon()
Returns the icon of the button that is displayed when the button is disabled. |
Extent |
getHeight()
Returns the height of the button. |
ImageReference |
getIcon()
Returns the icon displayed in the button. |
Extent |
getIconTextMargin()
Returns the margin size between the icon and the text. |
Insets |
getInsets()
Returns the margin between the buttons edge and its content. |
ButtonModel |
getModel()
Returns the model that this button represents. |
Color |
getPressedBackground()
Returns the background color of the button when the button is pressed. |
FillImage |
getPressedBackgroundImage()
Returns the background image displayed when the button is pressed. |
Border |
getPressedBorder()
Returns the border displayed around the button when the button is pressed. |
Font |
getPressedFont()
Returns the font of the button when the button is pressed. |
Color |
getPressedForeground()
Returns the foreground color of the button when the button is pressed. |
ImageReference |
getPressedIcon()
Returns the icon of the button that is displayed when the button is pressed. |
Color |
getRolloverBackground()
Returns the background color of the button when the mouse cursor is inside its bounds. |
FillImage |
getRolloverBackgroundImage()
Returns the background image displayed when the mouse cursor is inside the button's bounds. |
Border |
getRolloverBorder()
Returns the border displayed around the button when the mouse cursor is inside its bounds. |
Font |
getRolloverFont()
Returns the font of the button when the mouse cursor is inside its bounds. |
Color |
getRolloverForeground()
Returns the foreground color of the button when the mouse cursor is inside its bounds. |
ImageReference |
getRolloverIcon()
Returns the icon of the button that is displayed when the mouse cursor is inside its bounds. |
java.lang.String |
getText()
Returns the text label of the button. |
Alignment |
getTextAlignment()
Returns the alignment of the text relative to the icon. |
Alignment |
getTextPosition()
Returns the position of the text relative to the icon. |
java.lang.String |
getToolTipText()
Returns the tool tip text (displayed when the mouse cursor is hovered over the component). |
Extent |
getWidth()
Returns the width of the button. |
boolean |
hasActionListeners()
Determines if the button has any ActionListener s
registered. |
boolean |
isLineWrap()
Determines if the text of the button should wrap in the event that horizontal space is limited. |
boolean |
isPressedEnabled()
Determines if pressed effects are enabled. |
boolean |
isRolloverEnabled()
Determines if rollover effects are enabled. |
boolean |
isValidChild(Component component)
This component does not support children. |
void |
processInput(java.lang.String name,
java.lang.Object value)
Processes client input specific to the Component
received from the UpdateManager . |
void |
removeActionListener(ActionListener l)
Removes an ActionListener from being notified of user
actions, i.e., button presses. |
void |
setActionCommand(java.lang.String newValue)
Sets the action command of the ButtonModel . |
void |
setAlignment(Alignment newValue)
Sets the alignment of the button's content. |
void |
setBackgroundImage(FillImage newValue)
Sets the background image of the button. |
void |
setBorder(Border newValue)
Sets the border displayed around the button. |
void |
setDisabledBackground(Color newValue)
Sets the background color of the button when the button is disabled. |
void |
setDisabledBackgroundImage(FillImage newValue)
Sets the background image displayed when the button is disabled. |
void |
setDisabledBorder(Border newValue)
Sets the border displayed around the button when the button is disabled. |
void |
setDisabledFont(Font newValue)
Sets the font of the button when the button is disabled. |
void |
setDisabledForeground(Color newValue)
Sets the foreground color of the button when the button is disabled. |
void |
setDisabledIcon(ImageReference newValue)
Sets the icon of the button that is displayed when the button is disabled. |
void |
setHeight(Extent newValue)
Sets the height of the button. |
void |
setIcon(ImageReference newValue)
Sets the icon displayed in the button. |
void |
setIconTextMargin(Extent newValue)
Sets the margin size between the icon and the text. |
void |
setInsets(Insets newValue)
Sets the margin between the buttons edge and its content. |
void |
setLineWrap(boolean newValue)
Sets whether the text of the button should wrap in the event that horizontal space is limited. |
void |
setModel(ButtonModel newValue)
Sets the model that this button represents. |
void |
setPressedBackground(Color newValue)
Sets the background color of the button when the button is pressed. |
void |
setPressedBackgroundImage(FillImage newValue)
Sets the background image displayed when the button is pressed. |
void |
setPressedBorder(Border newValue)
Sets the border displayed around the button when the button is pressed. |
void |
setPressedEnabled(boolean newValue)
Sets whether pressed effects are enabled when the button is pressed. |
void |
setPressedFont(Font newValue)
Sets the font of the button when the button is pressed. |
void |
setPressedForeground(Color newValue)
Sets the foreground color of the button when the button is pressed. |
void |
setPressedIcon(ImageReference newValue)
Sets the icon of the button that is displayed when the button is pressed. |
void |
setRolloverBackground(Color newValue)
Sets the background color of the button when the mouse cursor is inside its bounds. |
void |
setRolloverBackgroundImage(FillImage newValue)
Sets the background image displayed when the mouse cursor is inside the button's bounds |
void |
setRolloverBorder(Border newValue)
Sets the border displayed around the button when the mouse cursor is inside its bounds. |
void |
setRolloverEnabled(boolean newValue)
Sets whether rollover effects are enabled when the mouse cursor is inside the button's bounds. |
void |
setRolloverFont(Font newValue)
Sets the font of the button when the mouse cursor is inside its bounds. |
void |
setRolloverForeground(Color newValue)
Sets the foreground color of the button when the mouse cursor is inside its bounds. |
void |
setRolloverIcon(ImageReference newValue)
Sets the icon of the button that is displayed when the mouse cursor is inside its bounds. |
void |
setText(java.lang.String newValue)
Sets the text label of the button. |
void |
setTextAlignment(Alignment newValue)
Sets the alignment of the text relative to the icon. |
void |
setTextPosition(Alignment newValue)
Sets the position of the text relative to the icon. |
void |
setToolTipText(java.lang.String newValue)
Sets the tool tip text (displayed when the mouse cursor is hovered over the component). |
void |
setWidth(Extent newValue)
Sets the width of the button. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
public static final java.lang.String INPUT_CLICK
public static final java.lang.String PROPERTY_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_BORDER
public static final java.lang.String PROPERTY_DISABLED_BACKGROUND
public static final java.lang.String PROPERTY_DISABLED_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_DISABLED_BORDER
public static final java.lang.String PROPERTY_DISABLED_FONT
public static final java.lang.String PROPERTY_DISABLED_FOREGROUND
public static final java.lang.String PROPERTY_DISABLED_ICON
public static final java.lang.String PROPERTY_HEIGHT
public static final java.lang.String PROPERTY_ICON
public static final java.lang.String PROPERTY_ALIGNMENT
public static final java.lang.String PROPERTY_ICON_TEXT_MARGIN
public static final java.lang.String PROPERTY_INSETS
public static final java.lang.String PROPERTY_LINE_WRAP
public static final java.lang.String PROPERTY_MODEL
public static final java.lang.String PROPERTY_PRESSED_BACKGROUND
public static final java.lang.String PROPERTY_PRESSED_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_PRESSED_BORDER
public static final java.lang.String PROPERTY_PRESSED_ENABLED
public static final java.lang.String PROPERTY_PRESSED_FONT
public static final java.lang.String PROPERTY_PRESSED_FOREGROUND
public static final java.lang.String PROPERTY_PRESSED_ICON
public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND
public static final java.lang.String PROPERTY_ROLLOVER_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_ROLLOVER_BORDER
public static final java.lang.String PROPERTY_ROLLOVER_ENABLED
public static final java.lang.String PROPERTY_ROLLOVER_FONT
public static final java.lang.String PROPERTY_ROLLOVER_FOREGROUND
public static final java.lang.String PROPERTY_ROLLOVER_ICON
public static final java.lang.String PROPERTY_TEXT
public static final java.lang.String PROPERTY_TEXT_ALIGNMENT
public static final java.lang.String PROPERTY_TEXT_POSITION
public static final java.lang.String PROPERTY_TOOL_TIP_TEXT
public static final java.lang.String PROPERTY_WIDTH
Constructor Detail |
---|
public AbstractButton()
Method Detail |
---|
public void addActionListener(ActionListener l)
ActionListener
to receive notification of user
actions, i.e., button presses.
l
- the listener to addpublic void doAction()
public void fireActionPerformed(ActionEvent e)
e
- the ActionEvent
to sendpublic java.lang.String getActionCommand()
ButtonModel
.
ButtonModel.getActionCommand()
public Alignment getAlignment()
public FillImage getBackgroundImage()
public Border getBorder()
public Color getDisabledBackground()
public FillImage getDisabledBackgroundImage()
public Border getDisabledBorder()
public Font getDisabledFont()
public Color getDisabledForeground()
public ImageReference getDisabledIcon()
public Extent getHeight()
Extent
s with
fixed (i.e., not percent) units.
public ImageReference getIcon()
public Extent getIconTextMargin()
Extent
s with
fixed (i.e., not percent) units.
public Insets getInsets()
public ButtonModel getModel()
public Color getPressedBackground()
public FillImage getPressedBackgroundImage()
public Border getPressedBorder()
public Font getPressedFont()
public Color getPressedForeground()
public ImageReference getPressedIcon()
public Color getRolloverBackground()
public FillImage getRolloverBackgroundImage()
public Border getRolloverBorder()
public Font getRolloverFont()
public Color getRolloverForeground()
public ImageReference getRolloverIcon()
public java.lang.String getText()
public Alignment getTextAlignment()
public Alignment getTextPosition()
public java.lang.String getToolTipText()
public Extent getWidth()
Extent
s with
fixed or percentile units.
public boolean hasActionListeners()
ActionListener
s
registered.
public boolean isLineWrap()
public boolean isPressedEnabled()
setPressedEnabled(boolean)
public boolean isRolloverEnabled()
setRolloverEnabled(boolean)
public boolean isValidChild(Component component)
isValidChild
in class Component
component
- the Component
to evaluate as a child
Component
is a valid childComponent.isValidChild(nextapp.echo2.app.Component)
public void processInput(java.lang.String name, java.lang.Object value)
Component
Component
received from the UpdateManager
.
Derivative implementations should take care to invoke
super.processInput()
.
processInput
in class Component
name
- the name of the inputvalue
- the value of the inputComponent.processInput(java.lang.String, java.lang.Object)
public void removeActionListener(ActionListener l)
ActionListener
from being notified of user
actions, i.e., button presses.
l
- the listener to removepublic void setActionCommand(java.lang.String newValue)
ButtonModel
.
newValue
- the action commandButtonModel.setActionCommand(java.lang.String)
public void setAlignment(Alignment newValue)
newValue
- the new alignmentpublic void setBackgroundImage(FillImage newValue)
newValue
- the new background imagepublic void setBorder(Border newValue)
newValue
- the new borderpublic void setDisabledBackground(Color newValue)
newValue
- the new Color
public void setDisabledBackgroundImage(FillImage newValue)
newValue
- the new background imagepublic void setDisabledBorder(Border newValue)
newValue
- the new borderpublic void setDisabledFont(Font newValue)
newValue
- the new Font
public void setDisabledForeground(Color newValue)
newValue
- the new Color
public void setDisabledIcon(ImageReference newValue)
newValue
- the new iconpublic void setHeight(Extent newValue)
Extent
s with
fixed (i.e., not percent) units.
newValue
- the new heightpublic void setIcon(ImageReference newValue)
newValue
- the new iconpublic void setIconTextMargin(Extent newValue)
Extent
s with
fixed (i.e., not percent) units.
newValue
- the margin sizepublic void setInsets(Insets newValue)
newValue
- the new marginpublic void setLineWrap(boolean newValue)
newValue
- the new line wrap statepublic void setModel(ButtonModel newValue)
newValue
- the new ButtonModel
public void setPressedBackground(Color newValue)
newValue
- the new Color
public void setPressedBackgroundImage(FillImage newValue)
newValue
- the new background imagepublic void setPressedBorder(Border newValue)
newValue
- the new borderpublic void setPressedEnabled(boolean newValue)
newValue
- true if pressed effects should be enabledpublic void setPressedFont(Font newValue)
newValue
- the new Font
public void setPressedForeground(Color newValue)
newValue
- the new Color
public void setPressedIcon(ImageReference newValue)
newValue
- the new iconpublic void setRolloverBackground(Color newValue)
newValue
- the new Color
public void setRolloverBackgroundImage(FillImage newValue)
newValue
- the new background imagepublic void setRolloverBorder(Border newValue)
newValue
- the new borderpublic void setRolloverEnabled(boolean newValue)
newValue
- true if rollover effects should be enabledpublic void setRolloverFont(Font newValue)
newValue
- the new Font
public void setRolloverForeground(Color newValue)
newValue
- the new Color
public void setRolloverIcon(ImageReference newValue)
newValue
- the new iconpublic void setText(java.lang.String newValue)
newValue
- the new text labelpublic void setTextAlignment(Alignment newValue)
Alignment
's
settings should be non-default.
newValue
- the new text alignmentpublic void setTextPosition(Alignment newValue)
Alignment
's
settings should be non-default.
newValue
- the new text positionpublic void setToolTipText(java.lang.String newValue)
newValue
- the new tool tip textpublic void setWidth(Extent newValue)
Extent
s with
fixed or percentile units.
newValue
- the new width
|
NextApp Echo2 v2.1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |