Installing and using Mobile Suite : Using webMethods Mobile Designer : Coding a Mobile Application : Mobile Designer-Provided Run-Time Classes : Run-Time Canvas Classes
Run-Time Canvas Classes
com.softwareag.mobile.runtime.core.CanvasCore
Use the CanvasCore class to control application state transitions and to create new threads when the application enters loading states so that the primary thread can animate the screen as required. In addition, the CanvasCore class:
*Detects interrupts and feeds information through to the application code so that it can respond appropriately, while automatically stopping any playing music or vibrations.
*Provides a frame-rate handling solution using either a variableRateUpdate, where millisecond update times are passed into the application code, or a fixedRateUpdate, a potentially preset rate.
*Performs safety checks to prevent large visual stutters if random long pauses occur in the device’s JVM.
*Provides touchscreen pointer support and the ability to define regions on screen that perform the same as defined keypresses would on non-touchscreen devices.
*Detects QA test-codes for ease of debugging.
*Provides standardized keypress detection.
Mobile Designer stores keypress information for each device. You can decide how the keypress response works in your application by setting the Mobile Designer project.numeric.keys.emulate.directionals project property.
You can set the parameter PARAM_MD_CORE_DEBUGFLAGS_TO_DISPLAY to 0 (zero) to avoid storing debug or output, removing of the debug method. However, this might not necessarily be true for all of the data associated with the debug method call. For example, in the following code:
debug ("Having a problem loading object #" + i, PARAM_MY_DEBUGFLAG);
The method call itself is obfuscated, but the creation of the String included in the debug method call could remain due to the way the compiled Java byte code is created. As a result, Mobile Designer recommends changing the call to:
if ((PARAM_MD_CORE_DEBUGFLAGS_TO_DISPLAY & PARAM_MY_DEBUGFLAG) != 0)
debug ("Having a problem loading object #" + i, PARAM_MY_DEBUGFLAG);
com.softwareag.mobile.runtime.core.CanvasBase
The CanvasBase class provides the canvas and interaction to events. Mobile Designer sets the value for each device. You can override the value Mobile Designer sets using the mobiledesigner.runtime.core.class.graphics.canvas project property.
com.softwareag.mobile.runtime.core.CanvasDimensions
Use the CanvasDimensions class to specify the screen height and width Mobile Designer sets the CURRENT_SCREEN_HEIGHT and CURRENT_SCREEN_WIDTH for each device. You can override the value Mobile Designer sets by setting the mobiledesigner.runtime.core.class.graphics.dimensions project property to either fixed or dynamic.
If the parameters MD_BASE_SCREEN_WIDTH and MD_BASE_SCREEN_HEIGHT are set to 0 (zero) in the build script, or the device is set up to require dynamic dimensional detection, this layer queries the canvas's getWidth and getHeight methods with each call to retrieve the current screen dimensions, rather than embedding the dimensions as static compile-time constants. Using dynamic dimensions means that means that some compile-time optimizations do not occur. If you want the user to be able to rotate the device screen, you need to use the dynamic dimensions value.
com.softwareag.mobile.runtime.core.CanvasInterrupts
Use the CanvasInterrupts class to control how your mobile application detects interrupts. Mobile Designer sets the value for each device in the project. You can override the value Mobile Designer sets using the mobiledesigner.runtime.core.class.interrupts project property.
com.softwareag.mobile.runtime.core.CanvasKeysandTouch
Use the CanvasKeysandTouch class to control how the mobile application detects keypress, touch, or pointer events. Mobile Designer sets the value for each device. You can override the value Mobile Designer sets using the mobiledesigner.runtime.core.class.keysandtouch project property.
When you want to override the keypress detection methods, the Mobile Designer run-time classes pass these keypress actions to the standard keyPressed and keyReleased methods, enabling methods overrides to work consistently regardless of the specified target.
com.softwareag.mobile.runtime.core.CanvasMenu
Use the CanvasMenu class to control the loading, creation and general data structures for all menus. You can create menus in the resource handler and manipulate them at run time.
Mobile Designer must determine whether the menu item type is the MENU_ITEMTYPE_SOFTKEY. Mobile Designer can automatically create the appropriate soft keys when a menu is loaded. You can create any other menu item based on the basic standard and soft key standard, as long as its initial data chunk remains unchanged, and default items such as header, text-item, button are included in Mobile Designer.
Menus are constructed from a list of menu types and a general menu definition that includes information about the number of items present, the menu type, and information on the previous menu and previous selected item.
Individual menu items are a simple list of integers of arbitrary length with the leading integer specifying:
*The top 1 byte (0xff000000) specifies the item type.
*The middle 2 bytes (0x00ffff00) specifies the item flags. You can use item flags as masks to indicate the items the user can select, or for any other user functionality.
*The bottom 1 byte (0x000000ff) specifies the item length including this standard int.
com.softwareag.mobile.runtime.core.CanvasNativeUI
Use the CanvasNativeUI class to control the loading, creation and general data structures of all the Native User Interface (NativeUI) menus. To enable the CanvasNativeUI class, set the project.runtime.uses.nativeui and the mobiledesigner.runtime.core.class.ui properties to true.
com.softwareag.mobile.runtime.core.CanvasSoftKeys
The CanvasSoftKeys class controls the creation and update of soft-key labels. Mobile Designer attempts to follow the forward and back standard expected for each device by informing the code where to display the forward and backward soft keys. The Mobile Designer run time and device profiling are based on a forward or back soft-key naming convention, rather than left or right.
Mobile Designer sets the value for each device. You can override the value Mobile Designer sets using the mobiledesigner.runtime.core.class.softkeys project property.
com.softwareag.mobile.runtime.core.CanvasThreading
Use the CanvasThreading class to control how the mobile application manages the primary thread using a java.lang.Thread or a java.lang.TimerTask. The mobile application always launches all secondary threads using a new java.lang.Thread.
Mobile Designer sets the value for each device. You can override the value Mobile Designer sets by setting the mobiledesigner.runtime.core.class.threading project property to either thread or timertask.
Copyright © 2007-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback