Java 3D Sidebar
 All Classes Namespaces Functions Variables
ButtonWidget Class Reference

Widget with one or two buttons. More...

Inheritance diagram for ButtonWidget:
Widget

Public Member Functions

 ButtonWidget (String tag)
 
int getCount ()
 
void setCount (int count)
 Sets the count of buttons in widget. More...
 
String getText (int buttonId)
 
void setText (int buttonId, String text)
 Sets text pf button. More...
 
Color getBgColor (int buttonId)
 
void setBgColor (int buttonId, Color bgColor)
 Sets background color of button. More...
 
int getFont (int buttonId)
 
void setFont (int buttonId, int font)
 Sets font of button. More...
 
Color getTextColor (int buttonId)
 
void setTextColor (int buttonId, Color textColor)
 Sets text color of button. More...
 
String getTag ()
 Returns tag of the widget given in constructor. More...
 
void setOnSidebarActionListener (OnSidebarActionListener listener)
 Register a callback to be invoked when an action happens on this widget. More...
 
void invokeOnSidebarActionCallback (int action, Bundle extras)
 This method shouldn't be called manually! More...
 

Static Public Attributes

static final int EVENT_BUTTON_1_CLICKED = 1
 Event ID: button 1 was clicked. More...
 
static final int EVENT_BUTTON_2_CLICKED = 2
 Event ID: button 2 was clicked. More...
 
static final int BUTTON_1 = 0
 Identifier of button 1. More...
 
static final int BUTTON_2 = 1
 Identifier of button 2. More...
 

Detailed Description

Widget with one or two buttons.

Constructor & Destructor Documentation

ButtonWidget ( String  tag)

Member Function Documentation

Color getBgColor ( int  buttonId)
Parameters
buttonIduse BUTTON_1 or BUTTON_2
Returns
background color of button
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2
int getCount ( )
Returns
count of buttons in widget (1 or 2)
int getFont ( int  buttonId)
Parameters
buttonIduse BUTTON_1 or BUTTON_2
Returns
font of button
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2
String getTag ( )
inherited

Returns tag of the widget given in constructor.

Returns
tag of the widget

Referenced by Sidebar.setWidget().

String getText ( int  buttonId)
Parameters
buttonIduse BUTTON_1 or BUTTON_2
Returns
text of button
Color getTextColor ( int  buttonId)
Parameters
buttonIduse BUTTON_1 or BUTTON_2
Returns
text color of button
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2
void invokeOnSidebarActionCallback ( int  action,
Bundle  extras 
)
inherited

This method shouldn't be called manually!

References OnSidebarActionListener.onSidebarAction().

void setBgColor ( int  buttonId,
Color  bgColor 
)

Sets background color of button.

Parameters
buttonIduse BUTTON_1 or BUTTON_2
bgColormust not be null
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2, or bgColor is null
void setCount ( int  count)

Sets the count of buttons in widget.

Parameters
countshould be 1 or 2
Exceptions
IllegalArgumentExceptionif count is not 1 or 2
void setFont ( int  buttonId,
int  font 
)

Sets font of button.

Parameters
buttonIduse BUTTON_1 or BUTTON_2
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2
Parameters
font
void setOnSidebarActionListener ( OnSidebarActionListener  listener)
inherited

Register a callback to be invoked when an action happens on this widget.

Parameters
listenerthe callback that will run
See also
OnSidebarActionListener
void setText ( int  buttonId,
String  text 
)

Sets text pf button.

Parameters
buttonIduse BUTTON_1 or BUTTON_2
text
void setTextColor ( int  buttonId,
Color  textColor 
)

Sets text color of button.

Parameters
buttonIduse BUTTON_1 or BUTTON_2
textColormust not be null
Exceptions
IllegalArgumentExceptionif buttonId is not BUTTON_1 or BUTTON_2, or textColor is null

Member Data Documentation

final int BUTTON_1 = 0
static

Identifier of button 1.

final int BUTTON_2 = 1
static

Identifier of button 2.

final int EVENT_BUTTON_1_CLICKED = 1
static

Event ID: button 1 was clicked.

final int EVENT_BUTTON_2_CLICKED = 2
static

Event ID: button 2 was clicked.