Java 3D Sidebar
 All Classes Namespaces Functions Variables
ImageWidget Class Reference
Inheritance diagram for ImageWidget:
Widget

Public Member Functions

 ImageWidget (String tag)
 
void setPath (String path)
 Sets the path of image. More...
 
void setSize (int width, int height)
 Sets the width and height of image in widget. More...
 
void setPosition (int left, int top)
 Sets the top-left position of the image in the widget. More...
 
void setRect (int left, int top, int width, int height)
 Sets the top-left position and dimensions of image in widget. More...
 
String getPath ()
 
int getLeft ()
 
int getTop ()
 
int getWidth ()
 
int getHeight ()
 
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_IMAGE_CLICKED = 1
 Event ID: image was clicked. More...
 
static final int SIZE_FIT = -1
 Use this size to stretch the width or height to fit the widget window. More...
 
static final int SIZE_DEFAULT = -2
 Use this size to keep the width or height of bitmap. More...
 

Constructor & Destructor Documentation

ImageWidget ( String  tag)

Member Function Documentation

int getHeight ( )
Returns
height value of image
int getLeft ( )
Returns
X coordinate of image's starting point
String getPath ( )
Returns
path full (absolute) path to the image
String getTag ( )
inherited

Returns tag of the widget given in constructor.

Returns
tag of the widget

Referenced by Sidebar.setWidget().

int getTop ( )
Returns
Y coordinate of image's starting point
int getWidth ( )
Returns
width value of image
void invokeOnSidebarActionCallback ( int  action,
Bundle  extras 
)
inherited

This method shouldn't be called manually!

References OnSidebarActionListener.onSidebarAction().

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 setPath ( String  path)

Sets the path of image.

Parameters
pathfull (absolute) path to the image

Example:

imageWidget.setPath(Environment.getExternalStorageDirectory() + "/image.bmp");
void setPosition ( int  left,
int  top 
)

Sets the top-left position of the image in the widget.

Parameters
left
top
void setRect ( int  left,
int  top,
int  width,
int  height 
)

Sets the top-left position and dimensions of image in widget.

For width and height constants SIZE_FIT and SIZE_DEFAULT can be used.

Parameters
left
top
width
height
void setSize ( int  width,
int  height 
)

Sets the width and height of image in widget.

Constants SIZE_FIT and SIZE_DEFAULT can be used.

Parameters
width
height

Member Data Documentation

final int EVENT_IMAGE_CLICKED = 1
static

Event ID: image was clicked.

final int SIZE_DEFAULT = -2
static

Use this size to keep the width or height of bitmap.

Referenced by ImageWidget.ImageWidget().

final int SIZE_FIT = -1
static

Use this size to stretch the width or height to fit the widget window.