Intel

Developer Zone

Dialog


com.intel.ui
Class Dialog

java.lang.Object
  extended by com.intel.ui.Dialog

public abstract class Dialog
extends java.lang.Object

This abstract class represents a top-level container for all the other Widgets. When all Widgets are in place, the dialog object can be passed to ProtectedOutput class to generate the image.

See Also:
ProtectedOutput

Method Summary
void addWidget(Widget widget)
Adds a child widget to this Dialog.
void addWidgets(Widget[] widgets)
Adds child widgets to this Dialog.
static Dialog create(int bgColor, XYPair size)
Factory method for creating a concrete instance initialized with the specified parameters
int getBgColor()
Returns the dialog background color in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).
abstract WidgetMapping[] getClickableWidgetMappings()
Returns the mappings of the Clickable widgets in this Dialog.
abstract Widget getClickedWidget(XYPair clickLocation)
Checks whether one of the Clickable widgets in this Dialog object intersects with a mouse click and returns the intersected widget.
XYPair getSize()
Returns the Dialog size in pixels
Widget[] getWidgets()
Returns the widget list this Dialog contains.
Methods inherited from class java.lang.Object
equals, hashCode, toString

Method Detail

create

public static final Dialog create(int bgColor,
                                  XYPair size)
                           throws UiException
Factory method for creating a concrete instance initialized with the specified parameters

Parameters:
bgColor - The background color of the Dialog in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).
size - The size of the Dialog.
Returns:
Dialog instance
Throws:
UiIllegalParameterException - if the dialog size is negative or 0.
UiException

getWidgets

public final Widget[] getWidgets()
Returns the widget list this Dialog contains.

Returns:
Returns the widget list this Dialog contains or null if there are no child widgets.

addWidget

public final void addWidget(Widget widget)
                     throws UiException
Adds a child widget to this Dialog.

Parameters:
widget - The Widget to add. Cannot be null.
Throws:
UiIllegalParameterException - if the size or location of the widget being added exceed the dialog boundaries.
UiException

addWidgets

public final void addWidgets(Widget[] widgets)
                      throws UiException
Adds child widgets to this Dialog.

Parameters:
widgets - The Widget array to add. Cannot be null or contain null members.
Throws:
UiIllegalParameterException - if the size or location of one of the widgets being added exceed the dialog boundaries.
UiException

getSize

public XYPair getSize()
Returns the Dialog size in pixels

Returns:
Returns the Dialog size in pixels

getBgColor

public int getBgColor()
Returns the dialog background color in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).

Returns:
Returns the background color in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).

getClickedWidget

public abstract Widget getClickedWidget(XYPair clickLocation)
                                 throws UiException
Checks whether one of the Clickable widgets in this Dialog object intersects with a mouse click and returns the intersected widget. If more than one widget in the same level intersects the mouse click, there is no guarantee which widget will be returned by this method. Note that the dialog must be rendered before calling this method.

Returns:
Returns the widget that intersects with the mouse click, or null of none of the Clickable widgets inside this dialog intersect with the mouse click.
Throws:
UiNotInitializedException - if this dialog was not rendered yet.
UiException

getClickableWidgetMappings

public abstract WidgetMapping[] getClickableWidgetMappings()
                                                    throws UiException
Returns the mappings of the Clickable widgets in this Dialog. Note that the dialog must be rendered before calling this method.

Returns:
Returns the mappings of the Clickable widgets in this Dialog.
Throws:
UiNotInitializedException - if this dialog was not rendered yet.
UiException