|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.droplets.api.Component | +--com.droplets.api.Label | +--com.droplets.api.LabelButton
A component that is meant to be clicked like a button to trigger events, but displays like a label. It supports the following features:
DropListener
), whose support is inherited from
Label
LabelButton
when it is clicked. To use this feature, set the
horizontalTextDisplacement
and
verticalTextDisplacement
properties to some value other
than 0. These values determine how far to move the text when the user
clicks on the button. Use positive values to move it to the right or
down or negative values to move it to the left or up.downBorders
) than when it is up (upBorders
).
getValue
and setValue
.
Fields inherited from class com.droplets.api.Label |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT |
Fields inherited from class com.droplets.api.Component |
ANCHOR_CENTER, ANCHOR_EAST, ANCHOR_NORTH, ANCHOR_NORTHEAST, ANCHOR_NORTHWEST, ANCHOR_SOUTH, ANCHOR_SOUTHEAST, ANCHOR_SOUTHWEST, ANCHOR_WEST, FILL_BOTH, FILL_HORIZONTAL, FILL_NONE, FILL_VERTICAL |
Constructor Summary | |
LabelButton(LayoutPlacement p,
Window window)
Constructs a new LabelButton . |
Method Summary | |
protected void |
action(java.lang.String action,
java.lang.String args)
Called by the server when the user has performed an action on this component. |
void |
addClickListener(ClickListener l)
Adds a click listener to the list. |
java.lang.String |
getActionCommand()
Gets the action command for this button. |
Borders |
getDownBorders()
Gets the borders that are displayed when the button is "down" - in other words, when the mouse button is depressed over the button. |
int |
getHorizontalTextDisplacement()
Gets the horizontalTextDisplacement property, which
determines how far to the right the text will move while the user is
clicking on the button. |
java.lang.String |
getImageSetName()
Gets the name of the image set to use for the button. |
java.lang.String |
getLabel()
Gets the label of the button. |
Borders |
getOverBorders()
Gets the borders that are displayed when the button is "over" - in other words, when the mouse is on the button but the mouse button is not depressed. |
Borders |
getUpBorders()
Gets the borders that are displayed when the button is "up" - in other words, when the mouse button is not depressed over the button. |
int |
getVerticalTextDisplacement()
Gets the verticalTextDisplacement property, which
determines how far down the text will move while the user is
clicking on the button. |
protected boolean |
isFocusTraversableDefault()
See Component.isFocusTraversableDefault() . |
void |
removeClickListener(ClickListener l)
Removes a click listener from the list. |
void |
setActionCommand(java.lang.String actionCommand)
Sets the action command for this button. |
void |
setDownBorders(Borders value)
Sets the borders that are displayed when the button is "down" - in other words, when the mouse button is depressed over the button. |
void |
setDownBorders(Borders value,
java.lang.String skin)
Sets the borders that are displayed when the button is "down" - in other words, when the mouse button is depressed over the button. |
void |
setHorizontalTextDisplacement(int value)
Sets the horizontalTextDisplacement property, which
determines how far to the right the text will move while the user is
clicking on the button. |
void |
setHorizontalTextDisplacement(int value,
java.lang.String skin)
Sets the horizontalTextDisplacement property, which
determines how far to the right the text will move while the user is
clicking on the button. |
void |
setImageSetName(java.lang.String value)
Sets the name of the image set to use for the button. |
void |
setImageSetName(java.lang.String value,
java.lang.String skin)
Sets the name of the image set to use for the button. |
void |
setLabel(java.lang.String newLabel)
Sets the value of the label. |
void |
setOverBorders(Borders value)
Sets the borders that are displayed when the button is "over" - in other words, when the mouse is on the button but the mouse button is not depressed. |
void |
setOverBorders(Borders value,
java.lang.String skin)
Sets the borders that are displayed when the button is "over" - in other words, when the mouse is on the button but the mouse button is not depressed. |
void |
setTextDisplacement(int horizontal,
int vertical)
Convenience method for setting the horizontalTextDisplacement
and the verticalTextDisplacement at the same time. |
void |
setTextDisplacement(int horizontal,
int vertical,
java.lang.String skin)
Convenience method for setting the horizontalTextDisplacement
and the verticalTextDisplacement at the same time. |
void |
setUpBorders(Borders value)
Sets the borders that are displayed when the button is "up" - in other words, when the mouse button is not depressed over the button. |
void |
setUpBorders(Borders value,
java.lang.String skin)
Sets the borders that are displayed when the button is "up" - in other words, when the mouse button is not depressed over the button. |
void |
setVerticalTextDisplacement(int value)
Sets the verticalTextDisplacement property, which
determines how far down the text will move while the user is
clicking on the button. |
void |
setVerticalTextDisplacement(int value,
java.lang.String skin)
Sets the verticalTextDisplacement property, which
determines how far down the text will move while the user is
clicking on the button. |
Methods inherited from class com.droplets.api.Label |
addAcceptDrop, addDropListener, getAlignment, getDragOverBgColor, getDragOverFgColor, getIsMoveHandle, getMargin, getShadow, getWidth, removeAcceptDrop, removeDropListener, setAlignment, setAlignment, setDragOverBgColor, setDragOverBgColor, setDragOverFgColor, setDragOverFgColor, setIsMoveHandle, setIsMoveHandle, setMargin, setMargin, setShadow, setShadow, setWidth, setWidth |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LabelButton(LayoutPlacement p, Window window)
LabelButton
. Call setValue
to set its text, but only after the enclosing window's specification
has been created.p
- specifies how this component should be laid out in the
enclosing panel (see LayoutPlacement
)window
- the window in which this component will be placedMethod Detail |
public int getHorizontalTextDisplacement()
horizontalTextDisplacement
property, which
determines how far to the right the text will move while the user is
clicking on the button.public void setHorizontalTextDisplacement(int value, java.lang.String skin)
horizontalTextDisplacement
property, which
determines how far to the right the text will move while the user is
clicking on the button.value
- the valueskin
- the skin name to use for this attributepublic void setHorizontalTextDisplacement(int value)
horizontalTextDisplacement
property, which
determines how far to the right the text will move while the user is
clicking on the button.value
- the valuepublic int getVerticalTextDisplacement()
verticalTextDisplacement
property, which
determines how far down the text will move while the user is
clicking on the button.public void setVerticalTextDisplacement(int value, java.lang.String skin)
verticalTextDisplacement
property, which
determines how far down the text will move while the user is
clicking on the button.the
- valueskin
- the skin name to use for this attributepublic void setVerticalTextDisplacement(int value)
verticalTextDisplacement
property, which
determines how far down the text will move while the user is
clicking on the button.the
- valuepublic void setTextDisplacement(int horizontal, int vertical, java.lang.String skin)
horizontalTextDisplacement
and the verticalTextDisplacement
at the same time.horizontal
- number of pixels to the right to move the text while
the mouse button is depressed over the componenthorizontal
- number of pixels down to move the text while
the mouse button is depressed over the componentskin
- the skin name to use for this attributepublic void setTextDisplacement(int horizontal, int vertical)
horizontalTextDisplacement
and the verticalTextDisplacement
at the same time.horizontal
- number of pixels to the right to move the text while
the mouse button is depressed over the componenthorizontal
- number of pixels down to move the text while
the mouse button is depressed over the componentpublic Borders getUpBorders()
public void setUpBorders(Borders value, java.lang.String skin)
value
- the desired "up" bordersskin
- skin name to use for this attributepublic void setUpBorders(Borders value)
value
- the desired "up" borderspublic Borders getOverBorders()
public void setOverBorders(Borders value, java.lang.String skin)
value
- the desired "over" bordersskin
- skin name to use for this attributepublic void setOverBorders(Borders value)
value
- the desired "over" borderspublic Borders getDownBorders()
public void setDownBorders(Borders value, java.lang.String skin)
value
- the desired "down" bordersskin
- skin name to use for this attributepublic void setDownBorders(Borders value)
value
- the desired "down" borderspublic java.lang.String getImageSetName()
ImageButton
for details.public void setImageSetName(java.lang.String value, java.lang.String skin)
ImageButton
for details.value
- the image set nameskin
- the skin name to use for this attributepublic void setImageSetName(java.lang.String value)
ImageButton
for details.value
- the image set nameprotected void action(java.lang.String action, java.lang.String args)
Component
action
in class Label
com.droplets.api.Component
action
- Identifies the type of action that occurredargs
- Action-specific arguments (extra information)public void addClickListener(ClickListener l)
Clickable
addClickListener
in interface Clickable
com.droplets.api.Clickable
l
- the listener to addpublic void removeClickListener(ClickListener l)
Clickable
removeClickListener
in interface Clickable
com.droplets.api.Clickable
l
- the listener to removepublic void setActionCommand(java.lang.String actionCommand)
ActionEvent
that this button fires when
it has been clicked.actionCommand
- the new action commandpublic java.lang.String getActionCommand()
public void setLabel(java.lang.String newLabel)
public java.lang.String getLabel()
protected boolean isFocusTraversableDefault()
Component.isFocusTraversableDefault()
.isFocusTraversableDefault
in class Label
com.droplets.api.Component
Component.setFocusTraversable(boolean)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |