|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Listener
danger.ui.View
danger.ui.Container
danger.ui.Control
danger.ui.GroupBox
danger.ui.IconLabel
public class IconLabel
An IconLabel is a Container that has an icon and title over a
rounded rect background. It has a convenience method for adding a
Button, as well.
| Field Summary | |
|---|---|
static int |
ICON_ALIGNMENT_BOTTOM
For use with setIconVerticalAlignment(int). |
static int |
ICON_ALIGNMENT_TOP
For use with setIconVerticalAlignment(int). |
static int |
ICON_ALIGNMENT_VERTICAL_CENTER
For use with setIconVerticalAlignment(int). |
| Fields inherited from class danger.ui.GroupBox |
|---|
CONTROL_POS_LEFT, CONTROL_POS_TOP |
| Constructor Summary | |
|---|---|
IconLabel()
Construct an IconLabel with no bitmp and no title. |
|
IconLabel(Bitmap inIcon,
String inTitle)
Construct an IconLabel with the specified bitmap and title. |
|
| Method Summary | |
|---|---|
Button |
addButton(CharSequence inButtonTitle)
Add a button with the specified title to this icon label. |
Button |
addButton(String inButtonTitle)
Add a button with the specified title to this icon label. |
int |
getBaseline()
Get the baseline of this Control's text or label. |
Button |
getButton()
Get the button for this icon label, as set by addButton(String) or
addButton(CharSequence). |
Bitmap |
getIcon()
Get the icon for this IconLabel. |
void |
paint(Pen p)
Draw the contents of this View. |
void |
setIcon(Bitmap inIcon)
Set the icon to display in the icon label. |
void |
setIconVerticalAlignment(int inAlign)
Set the vertical alignment for the icon. |
void |
setSize(int inWidth,
int inHeight)
Simultaneously set the width and height of this View. |
| Methods inherited from class danger.ui.Control |
|---|
drawFocusBox, drawIdleBox, drawIdleBox, getEvent, getEventListener, getEventType, getHasBorder, getMaxToolTipLines, getTitle, getTitleSequence, getToolTip, getValue, hasToolTip, loseFocus, notifyWhenBaselineChanges, onBaselineChanged, onControlBaselineChanged, onSetHasBorder, onSetTitle, sendEvent, setEvent, setEvent, setEvent, setEvent, setEvent, setEventArg, setEventListener, setEventMethod, setHasBorder, setMaxToolTipLines, setTitle, setTitle, setToolTip, showToolTip, takeFocus |
| Methods inherited from class danger.app.Listener |
|---|
cancelEvents, childEventPump, childEventPumpDone, eventProblem, isDispatchingThread, sendEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendLowPriorityEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ICON_ALIGNMENT_VERTICAL_CENTER
setIconVerticalAlignment(int). Specifies that
the icon should be centered vertically.
public static final int ICON_ALIGNMENT_TOP
setIconVerticalAlignment(int). Specifies that
the icon should be placed at the top.
public static final int ICON_ALIGNMENT_BOTTOM
setIconVerticalAlignment(int). Specifies that
the icon should be placed at the bottom.
| Constructor Detail |
|---|
public IconLabel()
public IconLabel(Bitmap inIcon,
String inTitle)
inIcon - the icon to display in the icon label.inTitle - the title to display in the icon label.| Method Detail |
|---|
public void paint(Pen p)
ViewThe implementation of this method in this class will merely call
clear() pen, if this View is opaque (not transparent),
and will do nothing otherwise. If you don't need this behavior, then
there is no point in calling super.paint() in an
overriding method.
paint in class GroupBoxp - non-null; the pen to use for drawing operationspublic int getBaseline()
ControlView.getHeight(), but subclasses that display text
should override it to return something more appropriate.
getBaseline in class Control
public void setSize(int inWidth,
int inHeight)
View
setSize in class GroupBoxpublic void setIcon(Bitmap inIcon)
inIcon - the icon to display in the icon label.public Bitmap getIcon()
setIcon(danger.ui.Bitmap).
public Button addButton(String inButtonTitle)
inButtonTitle - the title of the button to add.public Button addButton(CharSequence inButtonTitle)
inButtonTitle - the title of the button to add.public Button getButton()
addButton(String) or
addButton(CharSequence). Returns null if there is no button.
public void setIconVerticalAlignment(int inAlign)
ICON_ALIGNMENT_VERTICAL_CENTER.
inAlign - the vertical alignment for the icon; can be
ICON_ALIGNMENT_VERTICAL_CENTER,
ICON_ALIGNMENT_TOP, or
ICON_ALIGNMENT_BOTTOM.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||