Intel

Developer Zone

Dialog

com.intel.ui

Class Dialog

  • java.lang.Object
    • 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

      Methods
      Modifier and Type Method and Description
      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, getClass, hashCode, toString
    • Field Detail

      • DIALOG_MIN_WIDTH

        public static final short DIALOG_MIN_WIDTH
        Limit to dialog width.
        See Also:
        Constant Field Values
      • DIALOG_MAX_WIDTH

        public static final short DIALOG_MAX_WIDTH
        Limit to dialog width.
        See Also:
        Constant Field Values
      • DIALOG_MAX_HEIGHT

        public static final short DIALOG_MAX_HEIGHT
        Limit to dialog height.
        See Also:
        Constant Field Values
    • 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 - in one of the following cases:
        • Dialog width is less than Dialog.MIN_WIDTH
        • Dialog width is more than Dialog.MAX_WIDTH
        • Dialog height is non-positive or exceeds Dialog.MAX_HEIGHT
        • 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.
        UiIllegalParameterException - if clicked location is either negative or bigger than the Dialog width or height.
        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