Using the Code Sourcerer
Every code area in the Composer has a Code Sourcerer button. When the user presses this button, a dialog will appear which will guide the user through a context-sensitive set of pages. By making a few selections, and filling in a few entry fields, the user can construct Java statements to perform a wide variety of activities.
The Code Sourcerer presents the user with a series of panels. Once finished with a panel, the user can proceed to the next panel by pressing the Next button. The user can return to a previous panel using the Back button. At any time the user can quit the Code Sourcerer by pressing the Cancel button. Once the Code Sourcerer has obtained enough information to completely write the requested code, the Done button will become enabled. Pressing Done will write the code. Each of these buttons will become enabled or disabled in a context-sensitive manner. In some cases, both Next and Done will be disabled. This indicates that there are still critical fields to be filled in before the Code Sourcerer can proceed.
Each time the Code Sourcerer is invoked, the code which is produced is added to the code area. This code can be used as is, combined with other user code, or edited to meet particular needs. The code will be appended to the end of the code area unless the control key is held down when the Code Sourcerer is pressed. In this case, the code will be inserted at the current cursor location.
The first panel of the Code Sourcerer contains at least ten categories. The user can choose from
- Change a property of an existing part... Choose a part and then modify any attribute of the part.
- Ask a part about one of its properties... Choose a part and then retrieve the value of any attribute.
- MIDlet control operations... Set the current screen, pause the MIDlet, exit the MIDlet, get information about the display capabilities of the current device, more...
- RMS data storage operations... Interact with record stores, which are used to store information on MID-enabled devices.
- Network operations... Get the contents of a web page or connect to another machine over the internet using HTTP.
- Perform floating point computations... Obtain the results of a floating point computation.
- Declare a new variable... Create a new variable of any type and optionally initialize it.
- Miscellaneous... Play a sound, convert from Strings to other variables, or variables to Strings.
- Java system operations... Interact with the Java Virtual Machine.
- Java Language Statements... Conditional statements (if, if else) and loop statements.
In addition, Code Areas which are part of a Canvas have an additional option,
The paint Code Area in the Canvas has another additional option,
| Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |