Skip navigation links
Dashboard

Class BBjWidget

Inheritance:
    • Method Detail

      • create

        public void create(BBjControl p_widgetControlWindow!)

        Creates a BBjWidget in the specified BBjChildWindow

        Parameters:
        p_widgetControlWindow! The BBjChildWindow that will contain the widget
      • destroy

        public void destroy()

        Destroys the BBjWidget and its interior BBjControl

      • display

        public void display(BBjNumber p_display)

        If the BBjWidget's interior BBjControl has already been created, then this method sets its visibiity

        Parameters:
        p_display Indicates the control's visibility. 0=invisible, 1=visible
      • getDevicePixelRatio

        public BBjNumber getDevicePixelRatio()

        An internal method used to set/get the device pixel ratio for the widget

        This is first called upon widget creation to set the device pixel ratio (DPR) for the widget, which is a static to prevent the code from being executed several times per dashboard. If the BASIS_UTILITY_DEVICE_PIXEL_RATIO STBL is set it will be used preferentially over all other other values. If the STBL is not set, the method will determine the DPR for the widget. If the widget already has a UI, then it uses the DPR for the screen on which the widget is displayed. If the widget does not have a UI it will use the DPR for the default screen.

        Returns:
        A BBjNumber corresponding to the widget's device pixel ratio
        See Also:
        BBjWidget::setPixelRatio() to override the value derived from this method
      • isDestroyed

        public BBjNumber isDestroyed()

        Returns whether the BBjWidget is destroyed

        Returns:
        Returns 1 if destroyed, otherwise 0 is returned
      • logQueryPerformance

        public static void logQueryPerformance(BBjString p_widgetName$, BBjString p_sql$, BBjNumber p_startTime)

        This method is used internally by the Dashboard Utility to optionally log the performance of SQL Queries for Widgets

        Before analyzing the SQL timings, you must first instruct the Dashboard Utility to log all SQL timing results to the BBj Debug log file located in the <BBj_HOME>/log directory. This is done by setting the "BASIS_UTILITY_LOG_QUERY_PERFORMANCE" global string entry to the number one, either via code or in a configuration file. Here are two examples:

          1) Setting the global string entry in code, before creating any widgets or running a dashboard:
              temp$ = STBL("BASIS_UTILITY_LOG_QUERY_PERFORMANCE", "1")

          2) Setting the global string entry in the config file, without changing any code:
              SET BASIS_UTILITY_LOG_QUERY_PERFORMANCE=1

        Parameters:
        p_widgetName$ The name of the widget associated with the timing
        p_sql$ The widget's SQL query that is responsible for providing data to the widget
        p_startTime The starting time of the query from System.nanoTime()
        Since:
        BBj 16.00
      • resize

        public void resize(BBjNumber p_width, BBjNumber p_height)

        Resizes the widget using the provided with and height if the BBjWidget's interior BBjControl has already been created

        Parameters:
        p_width The control's desired width in pixels
        p_height The control's desired height in pixels
      • setDevicePixelRatio

        public void setDevicePixelRatio(BBjNumber p_pixelRatio)

        A BBjNumber identifying the screen's pixel ratio. Any real number between 0.5 and 4.0 is allowed.

        This numeric field variable may be set as desired to any real number, although a minimum of 0.5 and maximum of 4 will be enforced by the utility to avoid rendering enormous images that consume a huge amount of memory. If it is not modified, it will be set according to the pixel ratio of the current screen. Here is an example showing how to set the DevicePixelRatio via a widget:

            widget!.setDevicePixelRatio(2)

        Note that you may also set the "BASIS_UTILITY_DEVICE_PIXEL_RATIO" global string entry either via code or in a configuration file in order to control the pixel ratio used when generating images, such as charts or reports. Here are two examples:

          1) Setting the global string entry in code, before creating any widgets or reports:
              temp$ = STBL("BASIS_UTILITY_DEVICE_PIXEL_RATIO", "2")

          2) Setting the global string entry in the config file, without changing any code:
              SET BASIS_UTILITY_DEVICE_PIXEL_RATIO=2

        Parameters:
        p_pixelRatio A BBjNumber specifying the screen's pixel ratio to use when creating the widget's graphics