SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                      http://netbeans.org/kb/68/javame/svgtouch.html?print=yes



           Creating a Touch Enabled SVG UI for Java ME Devices
           This tutorial shows you how to develop rich UI's for Java ME based touch screen devices using SVG UI widgets. The
           rapidly growing number of Java ME based touch screen devices like the Samsung Omnia and Instinct, Nokia 5800 Xpress
           Music or Blackbery Storm make developing for these devices required reading for any serious mobile application
           developer. The application created in this tutorial works on most devices that support the SVG API for J2ME (JSR226)
           since Rich SVG UI widgets are also supported by devices without touch screens.


           Contents
                  Tutorial Requirements

                  Getting the Project Environment Set Up

                  Creating the UI in the SVG Composer

                  Using the Visual Mobile Designer to Create the Application Flow

                  Adding Application Logic to the UI

                  Testing the Application in A Touch Screen Device Emulator

                  Summary


           Requirements
           To complete this tutorial, you need the following software and resources:

              Software or Resource        Version Required

            NetBeans IDE with Java ME     Version 6.7 or later

            Java Development Kit (JDK) Version 6

            Contact Browser Project       NetBeans project

            SVG UI Snippets               NetBeans plugin


                 To ensure that the Java ME features are enabled, we recommend performing a Custom Installation and unchecking
                 the Features on Demand component during installation of the IDE.


           Getting the Project Environment Set Up
           In addition to the required software listed above you should have the following installed on your computer:

                  The ContactBrowser.zip file should be unzipped into your NetBeans project folder.

                  The SVG snippets plugin should be downloaded and installed into NetBeans:
                     1. In the IDE go to Tools > Plugins. Click the Downloaded tab and click Add Plugins.

                     2. Navigate to the local folder containing the svg-snippets.nbm file, select the file and click Open.

                  Click Install and the IDE will guide you through the plugin installation. After the plugin is installed, you must
                  restart the IDE.

                  After restarting the IDE, go to Tools > Options. Click Miscellaneous in the Options dialog window then click the
                  SVG tab.

                  In the SVG Rich Components Snippets section open the Snippets drop down menu and choose J1 HOL SVG
                  Snippets. Click OK.




1 de 19                                                                                                                           10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                       http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




           Creating the UI in the SVG Composer
           We are going to build a basic SVG-based application UI. Though the application is quite simple, it will show you how to
           create a new Java ME application, how to import SVG images from the SVG Composer into a visual MIDlet and how to run
           the project on a MIDP device emulator. In NetBeans 6.5 a new feature was introduced that enables developers to create
           UIs with SVG technology in a way similar to Java SE Swing.


           Background Information
           SVG: JSR-226 specifies the API for rendering scalable, two-dimensional vector graphics in XML. Instead of encoding the
           contents of each pixel like the GIF and JPG formats, vector graphics contain only the drawing instructions for each pixel.
           This gives vector images several advantages:

                  They are scalable, so the image quality remains the same on displays of different sizes and resolutions. You can
                  also stretch, flip, or reverse an image without losing quality.

                  They support scripting and animations, so they are ideal for interactive, data-driven graphics.

                  They are compact. Vector-based images can be as much as ten times smaller than an identical image in GIF or
                  JPEG format. This important advantage makes it possible to create graphically rich applications for handheld
                  devices with limited resources.

                  They allow users to interact with image content.

                  They are searchable, allowing users to search for text within the image. For example, users can search a map for
                  specific street names, or search a list of restaurant menus for their favorite dish.

           A full-featured subset of SVG aimed toward mobile devices is called SVG-Tiny and JSR-226 adopts version 1.1 of the
           SVG-Tiny profile as the official file format for J2ME vector graphics.


           Introduction to SVG widgets and their function.
           Creating User Interfaces is made easier using the SVG Composer and SVG Form Rich UI Components in NetBeans.

           Overview of the SVG UI snippets available in the SVG Composer palette:

                  SVG List - Allows developer to create a list of UI elements needed for the UI.

                  SVG Radio Button - In the SVG snippets we are using this allows user to select gender.

                  SVG Combo Box - UI component for drop down list menus.

                  SVG Text - A field where text such as names of people, product ID's, etc can be displayed.

                  SVG Button - Buttons are used for Next, Previous, OK and other UI functions.




2 de 19                                                                                                                          10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


                  SVG Spinner - Enables user to scroll through a variable using Up and Down button.

                  SVG Slider - Allows user adjust a variable feature. For example, from light to dark, or 0-100%

                  SVG Label - Lets User Label a text field or other UI component.




           This was only a streamlined introduction to the SVG UI Rich Components. For more details, please see the in the
           Netbeans Visual Mobile Designer Wiki page.


           Steps to Create the SVG UI
           To get us started quickly we will begin by opening the prepared ContactBrowser project that we use as a foundation to
           create the project.


               1. Open the prepared ContactBrowser Java ME project in NetBeans 6.7 IDE.
                  Overview of the ContactBrowser project




               2. Open the employeeList.svg image in the SVG Composer and drag and drop two SVG Buttons and one SVG List
                  Form Component into the Preview canvas from the palette as shown below. We will rename the buttons later in
                  the exercise.
                  Troubleshooting Tip: to align the buttons and other SVG components into the correct positions, click on the
                  component, then click the orange upward pointing arrow as shown below. Sometimes its necessary to click on the
                  arrow twice to make sure the entire component is selected, not just one part.




3 de 19                                                                                                                       10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                     http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




                         Below is the completed form with the following components added:

                                2 x Buttons

                                1 x List




               3. In the Preview window click the text in the OK button in the upper right and drag it to the left as shown in the
                  screenshot below. This will allow the word "Select" to display correctly on the UI button.




4 de 19                                                                                                                         10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                      http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




               4. Our SVG UI needs an additional SVG File, employeeForm.svg, so again we open the file, and add the buttons,
                  text fields, labels and buttons from the palette onto the image in the SVG composer and rename them to create
                  the UI. When finished, it should look something like the image below.

                         Added components

                               3 x Buttons

                               4 x Labels

                               2 x Text Fields

                               1 x Radio Button

                               1 x Spinner




5 de 19                                                                                                                         10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                     http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




               5. In the Preview window click the text of the OK button on the lower left and drag it to the left as shown in the
                  screenshot below. This will allow the word "Previous" to display correctly on the UI button.




           Step 3: Creating a MIDlet in Visual Mobile Designer

           The SVG Rich UI components framework is split into two parts:

                  SVG Snippets are used to build the UI in the SVG Composer or other SVG editor

                  Java ME libraries that support the UI functionality




6 de 19                                                                                                                         10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


           We have already covered the SVG Composer and snippets, so our next step is to look at the runtime libraries in the
           Visual Mobile Designer which help to merge the SVG images with the application logic in the Java ME source code.


               1. To create new a Visual MIDlet select File->New File and then in New File window under Categories choose MIDP
                  and in File Types choose Visual MIDlet. The new file should be part of org.netbeans.lab.ui.svg package.




               2. Inside of the newly created MIDlet switch to the Flow view. Find the SVG Components section of the Palette then
                  drag and drop two SVG Form components onto the design canvas of the Flow view and use the right-click
                  contextual menu to rename them employeeForm and employeeList.




               3. The next step is to connect the SVG images to the source code. To connect the SVG UI components to the source




7 de 19                                                                                                                         10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                   http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


                  code we just drag and drop the employeeList.svg file from the Project window onto the employeeList
                  component and repeat this action for the employeeForm.svg by dragging it onto the employeeForm.




               4. Now we have to change the instance name of the svgButtons to correspond with the actions they perform. Note
                  that this does not change the button UI, we will do that later. To change the instance name of the svgButtons
                  right-click on the button and select Rename from the contextual menu. Type the action name you want for the
                  svgButtons instance in the New Name field of the Rename Instance Name dialog.
                  Tip: be sure that the new name corresponds to the UI button's function when changing the instance names of UI
                  components.




               5. In next step we have to change the default SVG Labels for the buttons and text fields to match the information



8 de 19                                                                                                                      10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                     http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


                  displayed by the ContactBrowser application. To do so switch to the Screen view and display employeeForm.
                  Then select the Label item in the Screen view and edit the text properties for each label and button so that they
                  are like the screenshot below.




               6. We also need to change the instance name of the SVG text fields. Right-click the First Name and choose Rename
                  from the contextual menu and change the name to svgTextFieldFirstName. Repeat this step for the Last Name
                  field and rename it svgTextFieldLastName.

               7. Now in the drop down menu of the IDE project window, switch from employeeForm to employeeList and
                  rename the buttons as shown in the screenshot below. You can see the changes in the Text field of the Properties
                  window.




9 de 19                                                                                                                        10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




           Using the Visual Mobile Designer to Create the Application Flow
           Now we are ready to create the application flow using the Flow view of Visual Mobile Designer.


               1. Switch from the Screen to the Flow view in the IDE.

               2. Connect the components as they are shown below. Start by clicking Started on the Mobile Device element and
                  drag the mouse to the employeeList element. Repeat this method to make the other component connections.




10 de 19                                                                                                                      10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                   http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




           In the Source view you can see the mechanism that binds the SVG XML UI Component snippets with Java ME runtime
           libraries. In the example below you can see how the SVG Button snippets are bound to Java ME objects. The SVG
           Component is recognized based on the XML snippet ID, in this example, it is button_0.




           Running the Application
           Before we add the application logic we should test the Contact Browser UI on the emulator.

           In the menu choose Run Main Project (F6) and after the emulator launches you can see and test your UI. We have not
           implemented the application logic yet, but can verify that the UI displays as expected based on the work done in the
           Visual Mobile Designer.

           Please note that the UI displays the same way no matter which emulator is bundled in your installation of NetBeans. For
           6.5 and non-Windows users of the 6.7 IDE, the Sun Java Wireless Toolkit 2.5.2 is bundled in the IDE. The Windows




11 de 19                                                                                                                      10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                      http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


           distribution of 6.7 is bundled with the Java ME SDK 3.0.

           The Employee List and Employee Form displayed in the Wireless Toolkit DefaultColorPhone emulator.




           Adding application logic to the SVG User Interface
           Now we can use the Visual Mobile Designer to create the application logic for the UI we created in the previous step. We
           will use some additional components and methods and finish by running the application in the Java ME SDK 3.0
           emulator.


           Background Information
                  SVG ListModel: This defines the methods components like the one SVGList uses to get the value of each cell in a
                  list and the calculate the number of cells needed to display it. Logically the model is a vector, indices vary from 0
                  to ListDataModel.getSize() - 1. Any change to the contents or length of the data model must be reported to all of
                  the SVGListDataListeners. If you are familiar with Swing's JList model, the SVGListModel should be easy to
                  understand.

                  Entry Point component: The Entry Point component allows us to represent a method in a designed class. The
                  method contains code specified by an action assigned to it, the "Entry Called" pin. This method is very useful
                  when it is is necessary to execute code when switching between application screens, or in our case, to show the
                  SVGButton logic in the Flow view of a Visual Midlet.




12 de 19                                                                                                                          10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes



           Creating a Custom SVGList Model
           In this step we are going to create our own implementation of SVGListModel. Our implemention of SVGListModel is an
           anonymous class inside of the getSvgList method.


               1. Use the Navigator (Ctrl+7 if it is not already displayed) to find the getSvgList element under the employeeList
                  component by right-clicking and choosing Got To Source from contextual menu.

               2. Inside of the getSVGList method add the folowing code (highlighted in the red box) which contains an
                  implementation of the ListModel interface as an anonymous class.

           You can use the code completion feature in the IDE to create the code in the screenshot below.




           Next and Previous Button Logic
           In this step we will add logic for the SVGButtons which are a part of the employeeForm. These buttons allow application
           users to browse through employee data. By clicking Next, the user can jump to the next Empoloyee Contact. By pressing
           the Previous button, the user should see the previous employee record. In this step we are going to use the Entry Point
           element which we described earlier.


               1. Switch to to the Flow view and add two Entry Point components from the Flow category of the Palette. Right-click




13 de 19                                                                                                                      10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


                  on the components and rename them to Next and Previous as shown below:




               2. Now we have to add a global private integer property index to the Visual MIDlet. Let's switch to the Source view
                  and add the following under the Generated Fields guarded block:



               3. Now we must add logic to update the UI in the employeeForm. The method we use here updates the SVG UI
                  elements in the employeeForm component. In the Source editor at the end of the class add the following method:
                  Note: you can use the IDE's code completion feature to reproduce the code in the screenshot below.




14 de 19                                                                                                                      10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                   http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




                  Now we can start adding logic to the nextMethod and previousMethod

               4. Switch to the Flow view and right-click on the nextMethod Entry Point and choose the Go To Source option from
                  the contextual menu.

               5. In Source editor add the folowing code to the method "nextMethod()". This code displays the next record in the
                  queue of the employee data records. It also invokes the UI to update the information displayed.




               6. Repeat the two steps above for the previousMethod to enable the data browsing functionality to work.




                  Next we need to make sure that the UI will be updated when employeeForm and set global index based on a
                  selection done in in the employee list.

               7. Switch to the Flow view and right-click the select button in the employeeList and choose Go To Source from the




15 de 19                                                                                                                     10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes


                  contextual menu.

               8. In the Source editor add the following code to the method getSelect() :




           Testing the Application in A Touch Screen Device Emulator
           We are ready to test our application in a Java ME device emulator. We can use either the Java ME SDK 3.0
           DefaultFxTouchPhone1 that comes bundled in the NetBeans 6.7 IDE installer or the Sun Java Wireless Toolkit 2.5.2
           that is bundled with non-Windows and earlier distributions of the IDE. In order to launch the application in the Java ME
           SDK 3.0 or other touch screen device emulator we need edit the the Project Properties.


               1. Right-click the Project node and choose Properties from the contextual menu. In the Project dialog under Category
                  choose Platform then select Java Platform Micro Edition SDK 3.0 from the Emulator Platform drop down menu.

               2. For touch screen device emulation select DefaultFxTouchPhone1 from the Device drop down menu as shown below
                  and click OK.




16 de 19                                                                                                                       10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                   http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




               3. Go to Run > Run Main Project (F6) and the application launches in the emulator. You can verify that touch screen
                  properties are enabled by placing the mouse pointer over the SVG Components. The mouse cursor will appear as a
                  cross and can be moved around the screen to navigate the application menus as a user would do with their
                  fingertip.

               4. In the emulator we can perform some basic UI tests such as using the Previous or Next button to verify that the
                  UI elements are working properly.




17 de 19                                                                                                                     10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                    http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




           Enabling Touch Screen Behavior in the WTK 2.5.2 Emulator
           To activate touch screen emulation in the WTK we have to modify the DefaultColorPhone configuration properties file.
           The properties file that we need to modify is DefaultColorPhone.properties


               1. Go to the folder WTK_HOME_FOLDERwtklibdevicesDefaultColorPhone and locate the configuration file
                  DefaultColorPhone.properties




                  Troubleshooting Tip: You can find the directory location of the WTK by checking the Project Properties of the SVG
                  application we created.

               2. Open the DefaultColorPhone.properties using a text editor and change the value of property touch_screen
                  to "true."

                  Note: If you are using the Java ME SDK 3.0 it is not necessary to modify the properties file to enable touch screen
                  emulation.




18 de 19                                                                                                                       10/04/2012 17:46
Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID...                   http://netbeans.org/kb/68/javame/svgtouch.html?print=yes




               3. After restarting the WTK you can test the application in a touch enabled enviroment.


                                                                                                          Send Us Your Feedback


           Summary
           In this tutorial you learned how to create an SVG-based, touch screen enabled UI for Java ME devices using the NetBeans
           IDE.


           See Also
                  Rich SVG UI Components Reference

                  Rich SVG UI Application

                  Using SVG Rich UI Components

                  Reference: Visual Mobile Designer Palette Guide

                  NetBeans Java ME Applications Learning Trail




19 de 19                                                                                                                     10/04/2012 17:46

Mais conteúdo relacionado

Mais procurados

The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFxMohd Shamweel
 
2013 04-02-server-side-backbone
2013 04-02-server-side-backbone2013 04-02-server-side-backbone
2013 04-02-server-side-backboneSC5.io
 
Workshop Fo Wa
Workshop Fo WaWorkshop Fo Wa
Workshop Fo WaJoschi -
 
36 WordPress Visual Design Plugins
36 WordPress Visual Design Plugins36 WordPress Visual Design Plugins
36 WordPress Visual Design PluginsVisme
 
Hybrid Mobile Application Framework
Hybrid Mobile Application FrameworkHybrid Mobile Application Framework
Hybrid Mobile Application Framework동수 장
 
Mriganka Sundar Mondal
Mriganka Sundar MondalMriganka Sundar Mondal
Mriganka Sundar Mondalmrigankam
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjavaAnil Kumar
 
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And TomorrowAD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrowpjanzen11
 
Enabling the mobile Web for a Dojo component
Enabling the mobile Web for a Dojo componentEnabling the mobile Web for a Dojo component
Enabling the mobile Web for a Dojo componentcjolif
 
Dojo mobile web5-2013
Dojo mobile web5-2013Dojo mobile web5-2013
Dojo mobile web5-2013cjolif
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applicationstechbed
 

Mais procurados (12)

The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
 
2013 04-02-server-side-backbone
2013 04-02-server-side-backbone2013 04-02-server-side-backbone
2013 04-02-server-side-backbone
 
Workshop Fo Wa
Workshop Fo WaWorkshop Fo Wa
Workshop Fo Wa
 
36 WordPress Visual Design Plugins
36 WordPress Visual Design Plugins36 WordPress Visual Design Plugins
36 WordPress Visual Design Plugins
 
Hybrid Mobile Application Framework
Hybrid Mobile Application FrameworkHybrid Mobile Application Framework
Hybrid Mobile Application Framework
 
Screencasting for the budget-friendly teacher
Screencasting for the budget-friendly teacherScreencasting for the budget-friendly teacher
Screencasting for the budget-friendly teacher
 
Mriganka Sundar Mondal
Mriganka Sundar MondalMriganka Sundar Mondal
Mriganka Sundar Mondal
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
 
AD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And TomorrowAD201 - IBM Domino Application Development Today And Tomorrow
AD201 - IBM Domino Application Development Today And Tomorrow
 
Enabling the mobile Web for a Dojo component
Enabling the mobile Web for a Dojo componentEnabling the mobile Web for a Dojo component
Enabling the mobile Web for a Dojo component
 
Dojo mobile web5-2013
Dojo mobile web5-2013Dojo mobile web5-2013
Dojo mobile web5-2013
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applications
 

Destaque

Unidad jme-03--ingbarcia-final
Unidad jme-03--ingbarcia-finalUnidad jme-03--ingbarcia-final
Unidad jme-03--ingbarcia-finalOrlando Barcia
 
Wielka Brytania Weronik
Wielka Brytania WeronikWielka Brytania Weronik
Wielka Brytania WeronikTeresa
 
Ldp session8 ideasand_innovation_handout
Ldp session8 ideasand_innovation_handoutLdp session8 ideasand_innovation_handout
Ldp session8 ideasand_innovation_handoutJerome Landrito
 
Intuit Online Billing User Guide
Intuit Online Billing User GuideIntuit Online Billing User Guide
Intuit Online Billing User GuideJerome Landrito
 
LDP Session10 life_line_handout
LDP Session10 life_line_handoutLDP Session10 life_line_handout
LDP Session10 life_line_handoutJerome Landrito
 
Taller envio de sms por código 2012
Taller envio de sms por código 2012Taller envio de sms por código 2012
Taller envio de sms por código 2012Orlando Barcia
 
News Corp\'s Global Energy Initiative
News Corp\'s Global Energy InitiativeNews Corp\'s Global Energy Initiative
News Corp\'s Global Energy Initiativegerardochapa
 

Destaque (8)

Unidad jme-03--ingbarcia-final
Unidad jme-03--ingbarcia-finalUnidad jme-03--ingbarcia-final
Unidad jme-03--ingbarcia-final
 
Wielka Brytania Weronik
Wielka Brytania WeronikWielka Brytania Weronik
Wielka Brytania Weronik
 
Ldp session8 ideasand_innovation_handout
Ldp session8 ideasand_innovation_handoutLdp session8 ideasand_innovation_handout
Ldp session8 ideasand_innovation_handout
 
Intuit Online Billing User Guide
Intuit Online Billing User GuideIntuit Online Billing User Guide
Intuit Online Billing User Guide
 
LDP Session10 life_line_handout
LDP Session10 life_line_handoutLDP Session10 life_line_handout
LDP Session10 life_line_handout
 
Taller envio de sms por código 2012
Taller envio de sms por código 2012Taller envio de sms por código 2012
Taller envio de sms por código 2012
 
ohjaus
ohjausohjaus
ohjaus
 
News Corp\'s Global Energy Initiative
News Corp\'s Global Energy InitiativeNews Corp\'s Global Energy Initiative
News Corp\'s Global Energy Initiative
 

Semelhante a touch

Applications use in Java GUIThe Java GUI consists of a separate, .pdf
Applications use in Java GUIThe Java GUI consists of a separate, .pdfApplications use in Java GUIThe Java GUI consists of a separate, .pdf
Applications use in Java GUIThe Java GUI consists of a separate, .pdfakshay1213
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-eehomeworkping3
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptGjokica Zafirovski
 
Easy charting with
Easy charting withEasy charting with
Easy charting withMajor Ye
 
Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsSvetlin Denkov
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.pptTabassumMaktum
 
Tutorial Inkscape untuk membuat desain Infografik
Tutorial Inkscape untuk membuat desain InfografikTutorial Inkscape untuk membuat desain Infografik
Tutorial Inkscape untuk membuat desain InfografikYudi Herdiana
 
Get started with Sketch: a fast (and awesome) communication and design tool
Get started with Sketch: a fast (and awesome) communication and design toolGet started with Sketch: a fast (and awesome) communication and design tool
Get started with Sketch: a fast (and awesome) communication and design toolChristopher Azar
 
Canvas Based Presentation tool - First Review
Canvas Based Presentation tool - First ReviewCanvas Based Presentation tool - First Review
Canvas Based Presentation tool - First ReviewArvind Krishnaa
 
What is an SVG and How Should it be Used in Web Design?
What is an SVG and How Should it be Used in Web Design?What is an SVG and How Should it be Used in Web Design?
What is an SVG and How Should it be Used in Web Design?Katie Hecox
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGExove
 
SVG Strikes Back
SVG Strikes BackSVG Strikes Back
SVG Strikes BackMatt Baxter
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009eCommConf
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by CitytechRitwik Das
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentRyan Stewart
 
Ways to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingWays to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingIam Vector
 

Semelhante a touch (20)

Applications use in Java GUIThe Java GUI consists of a separate, .pdf
Applications use in Java GUIThe Java GUI consists of a separate, .pdfApplications use in Java GUIThe Java GUI consists of a separate, .pdf
Applications use in Java GUIThe Java GUI consists of a separate, .pdf
 
Drawing Tool
Drawing ToolDrawing Tool
Drawing Tool
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-ee
 
Rich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScriptRich Media Advertising with SVG and JavaScript
Rich Media Advertising with SVG and JavaScript
 
Easy charting with
Easy charting withEasy charting with
Easy charting with
 
Building Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web FontsBuilding Axure Icon Widget Libraries Using Web Fonts
Building Axure Icon Widget Libraries Using Web Fonts
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.ppt
 
Tutorial Inkscape untuk membuat desain Infografik
Tutorial Inkscape untuk membuat desain InfografikTutorial Inkscape untuk membuat desain Infografik
Tutorial Inkscape untuk membuat desain Infografik
 
Get started with Sketch: a fast (and awesome) communication and design tool
Get started with Sketch: a fast (and awesome) communication and design toolGet started with Sketch: a fast (and awesome) communication and design tool
Get started with Sketch: a fast (and awesome) communication and design tool
 
Netbeans gui tutorial
Netbeans gui tutorialNetbeans gui tutorial
Netbeans gui tutorial
 
Canvas Based Presentation tool - First Review
Canvas Based Presentation tool - First ReviewCanvas Based Presentation tool - First Review
Canvas Based Presentation tool - First Review
 
What is swing
What is swingWhat is swing
What is swing
 
What is an SVG and How Should it be Used in Web Design?
What is an SVG and How Should it be Used in Web Design?What is an SVG and How Should it be Used in Web Design?
What is an SVG and How Should it be Used in Web Design?
 
Switch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVGSwitch Away from Icon Fonts to SVG
Switch Away from Icon Fonts to SVG
 
SVG Strikes Back
SVG Strikes BackSVG Strikes Back
SVG Strikes Back
 
Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009Christopher Allen's Presentation at eComm 2009
Christopher Allen's Presentation at eComm 2009
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
GUI_part_1.pptx
GUI_part_1.pptxGUI_part_1.pptx
GUI_part_1.pptx
 
Flash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen DevelopmentFlash Builder and Flex Future - Multiscreen Development
Flash Builder and Flex Future - Multiscreen Development
 
Ways to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desingWays to enhance accessibility in a SVG icon desing
Ways to enhance accessibility in a SVG icon desing
 

Mais de Orlando Barcia

orlando barcia curriculum vitae hoja de vida
orlando barcia curriculum vitae hoja de vidaorlando barcia curriculum vitae hoja de vida
orlando barcia curriculum vitae hoja de vidaOrlando Barcia
 
Tesis orlandobarcia-tomo1-maestria-educacion-superior
Tesis orlandobarcia-tomo1-maestria-educacion-superiorTesis orlandobarcia-tomo1-maestria-educacion-superior
Tesis orlandobarcia-tomo1-maestria-educacion-superiorOrlando Barcia
 
Unidad3 03 tamanio_archivos_3-2012
Unidad3 03 tamanio_archivos_3-2012Unidad3 03 tamanio_archivos_3-2012
Unidad3 03 tamanio_archivos_3-2012Orlando Barcia
 
Taller7 grabacion-partes-audio
Taller7 grabacion-partes-audioTaller7 grabacion-partes-audio
Taller7 grabacion-partes-audioOrlando Barcia
 
Unidad3 02 formatosdeaudio_2-2012
Unidad3 02 formatosdeaudio_2-2012Unidad3 02 formatosdeaudio_2-2012
Unidad3 02 formatosdeaudio_2-2012Orlando Barcia
 
Unidad6 grabacion de_audio-2012
Unidad6 grabacion de_audio-2012Unidad6 grabacion de_audio-2012
Unidad6 grabacion de_audio-2012Orlando Barcia
 
Taller envio de sms por código 2012
Taller envio de sms por código 2012Taller envio de sms por código 2012
Taller envio de sms por código 2012Orlando Barcia
 
Planteamiento de-ejercicios-2011
Planteamiento de-ejercicios-2011Planteamiento de-ejercicios-2011
Planteamiento de-ejercicios-2011Orlando Barcia
 
Taller1 1-recordatorio-conceptos
Taller1 1-recordatorio-conceptosTaller1 1-recordatorio-conceptos
Taller1 1-recordatorio-conceptosOrlando Barcia
 
Configuracion cliente-outlook-2010-america-utah-syslan
Configuracion cliente-outlook-2010-america-utah-syslanConfiguracion cliente-outlook-2010-america-utah-syslan
Configuracion cliente-outlook-2010-america-utah-syslanOrlando Barcia
 
Unidad2 3 principios-acustica-audiodigital-ups
Unidad2 3 principios-acustica-audiodigital-upsUnidad2 3 principios-acustica-audiodigital-ups
Unidad2 3 principios-acustica-audiodigital-upsOrlando Barcia
 
Unidad jme-02--ingbarcia-final
Unidad jme-02--ingbarcia-finalUnidad jme-02--ingbarcia-final
Unidad jme-02--ingbarcia-finalOrlando Barcia
 
Unidad jme-01--ingbarcia-fina-2011
Unidad jme-01--ingbarcia-fina-2011Unidad jme-01--ingbarcia-fina-2011
Unidad jme-01--ingbarcia-fina-2011Orlando Barcia
 
Java micro edition 2012
Java micro edition 2012Java micro edition 2012
Java micro edition 2012Orlando Barcia
 

Mais de Orlando Barcia (20)

orlando barcia curriculum vitae hoja de vida
orlando barcia curriculum vitae hoja de vidaorlando barcia curriculum vitae hoja de vida
orlando barcia curriculum vitae hoja de vida
 
Tesis orlandobarcia-tomo1-maestria-educacion-superior
Tesis orlandobarcia-tomo1-maestria-educacion-superiorTesis orlandobarcia-tomo1-maestria-educacion-superior
Tesis orlandobarcia-tomo1-maestria-educacion-superior
 
Prueba jme-2012
Prueba jme-2012Prueba jme-2012
Prueba jme-2012
 
factor de potencia
factor de potenciafactor de potencia
factor de potencia
 
Proyecto ups-jme2012
Proyecto ups-jme2012Proyecto ups-jme2012
Proyecto ups-jme2012
 
Proyecto ups 2012
Proyecto ups 2012Proyecto ups 2012
Proyecto ups 2012
 
touch
touchtouch
touch
 
Taller uso-de-tablas
Taller uso-de-tablasTaller uso-de-tablas
Taller uso-de-tablas
 
Unidad3 03 tamanio_archivos_3-2012
Unidad3 03 tamanio_archivos_3-2012Unidad3 03 tamanio_archivos_3-2012
Unidad3 03 tamanio_archivos_3-2012
 
Taller7 grabacion-partes-audio
Taller7 grabacion-partes-audioTaller7 grabacion-partes-audio
Taller7 grabacion-partes-audio
 
Unidad3 02 formatosdeaudio_2-2012
Unidad3 02 formatosdeaudio_2-2012Unidad3 02 formatosdeaudio_2-2012
Unidad3 02 formatosdeaudio_2-2012
 
Unidad6 grabacion de_audio-2012
Unidad6 grabacion de_audio-2012Unidad6 grabacion de_audio-2012
Unidad6 grabacion de_audio-2012
 
Taller envio de sms por código 2012
Taller envio de sms por código 2012Taller envio de sms por código 2012
Taller envio de sms por código 2012
 
Planteamiento de-ejercicios-2011
Planteamiento de-ejercicios-2011Planteamiento de-ejercicios-2011
Planteamiento de-ejercicios-2011
 
Taller1 1-recordatorio-conceptos
Taller1 1-recordatorio-conceptosTaller1 1-recordatorio-conceptos
Taller1 1-recordatorio-conceptos
 
Configuracion cliente-outlook-2010-america-utah-syslan
Configuracion cliente-outlook-2010-america-utah-syslanConfiguracion cliente-outlook-2010-america-utah-syslan
Configuracion cliente-outlook-2010-america-utah-syslan
 
Unidad2 3 principios-acustica-audiodigital-ups
Unidad2 3 principios-acustica-audiodigital-upsUnidad2 3 principios-acustica-audiodigital-ups
Unidad2 3 principios-acustica-audiodigital-ups
 
Unidad jme-02--ingbarcia-final
Unidad jme-02--ingbarcia-finalUnidad jme-02--ingbarcia-final
Unidad jme-02--ingbarcia-final
 
Unidad jme-01--ingbarcia-fina-2011
Unidad jme-01--ingbarcia-fina-2011Unidad jme-01--ingbarcia-fina-2011
Unidad jme-01--ingbarcia-fina-2011
 
Java micro edition 2012
Java micro edition 2012Java micro edition 2012
Java micro edition 2012
 

Último

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Último (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

touch

  • 1. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Creating a Touch Enabled SVG UI for Java ME Devices This tutorial shows you how to develop rich UI's for Java ME based touch screen devices using SVG UI widgets. The rapidly growing number of Java ME based touch screen devices like the Samsung Omnia and Instinct, Nokia 5800 Xpress Music or Blackbery Storm make developing for these devices required reading for any serious mobile application developer. The application created in this tutorial works on most devices that support the SVG API for J2ME (JSR226) since Rich SVG UI widgets are also supported by devices without touch screens. Contents Tutorial Requirements Getting the Project Environment Set Up Creating the UI in the SVG Composer Using the Visual Mobile Designer to Create the Application Flow Adding Application Logic to the UI Testing the Application in A Touch Screen Device Emulator Summary Requirements To complete this tutorial, you need the following software and resources: Software or Resource Version Required NetBeans IDE with Java ME Version 6.7 or later Java Development Kit (JDK) Version 6 Contact Browser Project NetBeans project SVG UI Snippets NetBeans plugin To ensure that the Java ME features are enabled, we recommend performing a Custom Installation and unchecking the Features on Demand component during installation of the IDE. Getting the Project Environment Set Up In addition to the required software listed above you should have the following installed on your computer: The ContactBrowser.zip file should be unzipped into your NetBeans project folder. The SVG snippets plugin should be downloaded and installed into NetBeans: 1. In the IDE go to Tools > Plugins. Click the Downloaded tab and click Add Plugins. 2. Navigate to the local folder containing the svg-snippets.nbm file, select the file and click Open. Click Install and the IDE will guide you through the plugin installation. After the plugin is installed, you must restart the IDE. After restarting the IDE, go to Tools > Options. Click Miscellaneous in the Options dialog window then click the SVG tab. In the SVG Rich Components Snippets section open the Snippets drop down menu and choose J1 HOL SVG Snippets. Click OK. 1 de 19 10/04/2012 17:46
  • 2. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Creating the UI in the SVG Composer We are going to build a basic SVG-based application UI. Though the application is quite simple, it will show you how to create a new Java ME application, how to import SVG images from the SVG Composer into a visual MIDlet and how to run the project on a MIDP device emulator. In NetBeans 6.5 a new feature was introduced that enables developers to create UIs with SVG technology in a way similar to Java SE Swing. Background Information SVG: JSR-226 specifies the API for rendering scalable, two-dimensional vector graphics in XML. Instead of encoding the contents of each pixel like the GIF and JPG formats, vector graphics contain only the drawing instructions for each pixel. This gives vector images several advantages: They are scalable, so the image quality remains the same on displays of different sizes and resolutions. You can also stretch, flip, or reverse an image without losing quality. They support scripting and animations, so they are ideal for interactive, data-driven graphics. They are compact. Vector-based images can be as much as ten times smaller than an identical image in GIF or JPEG format. This important advantage makes it possible to create graphically rich applications for handheld devices with limited resources. They allow users to interact with image content. They are searchable, allowing users to search for text within the image. For example, users can search a map for specific street names, or search a list of restaurant menus for their favorite dish. A full-featured subset of SVG aimed toward mobile devices is called SVG-Tiny and JSR-226 adopts version 1.1 of the SVG-Tiny profile as the official file format for J2ME vector graphics. Introduction to SVG widgets and their function. Creating User Interfaces is made easier using the SVG Composer and SVG Form Rich UI Components in NetBeans. Overview of the SVG UI snippets available in the SVG Composer palette: SVG List - Allows developer to create a list of UI elements needed for the UI. SVG Radio Button - In the SVG snippets we are using this allows user to select gender. SVG Combo Box - UI component for drop down list menus. SVG Text - A field where text such as names of people, product ID's, etc can be displayed. SVG Button - Buttons are used for Next, Previous, OK and other UI functions. 2 de 19 10/04/2012 17:46
  • 3. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes SVG Spinner - Enables user to scroll through a variable using Up and Down button. SVG Slider - Allows user adjust a variable feature. For example, from light to dark, or 0-100% SVG Label - Lets User Label a text field or other UI component. This was only a streamlined introduction to the SVG UI Rich Components. For more details, please see the in the Netbeans Visual Mobile Designer Wiki page. Steps to Create the SVG UI To get us started quickly we will begin by opening the prepared ContactBrowser project that we use as a foundation to create the project. 1. Open the prepared ContactBrowser Java ME project in NetBeans 6.7 IDE. Overview of the ContactBrowser project 2. Open the employeeList.svg image in the SVG Composer and drag and drop two SVG Buttons and one SVG List Form Component into the Preview canvas from the palette as shown below. We will rename the buttons later in the exercise. Troubleshooting Tip: to align the buttons and other SVG components into the correct positions, click on the component, then click the orange upward pointing arrow as shown below. Sometimes its necessary to click on the arrow twice to make sure the entire component is selected, not just one part. 3 de 19 10/04/2012 17:46
  • 4. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Below is the completed form with the following components added: 2 x Buttons 1 x List 3. In the Preview window click the text in the OK button in the upper right and drag it to the left as shown in the screenshot below. This will allow the word "Select" to display correctly on the UI button. 4 de 19 10/04/2012 17:46
  • 5. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes 4. Our SVG UI needs an additional SVG File, employeeForm.svg, so again we open the file, and add the buttons, text fields, labels and buttons from the palette onto the image in the SVG composer and rename them to create the UI. When finished, it should look something like the image below. Added components 3 x Buttons 4 x Labels 2 x Text Fields 1 x Radio Button 1 x Spinner 5 de 19 10/04/2012 17:46
  • 6. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes 5. In the Preview window click the text of the OK button on the lower left and drag it to the left as shown in the screenshot below. This will allow the word "Previous" to display correctly on the UI button. Step 3: Creating a MIDlet in Visual Mobile Designer The SVG Rich UI components framework is split into two parts: SVG Snippets are used to build the UI in the SVG Composer or other SVG editor Java ME libraries that support the UI functionality 6 de 19 10/04/2012 17:46
  • 7. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes We have already covered the SVG Composer and snippets, so our next step is to look at the runtime libraries in the Visual Mobile Designer which help to merge the SVG images with the application logic in the Java ME source code. 1. To create new a Visual MIDlet select File->New File and then in New File window under Categories choose MIDP and in File Types choose Visual MIDlet. The new file should be part of org.netbeans.lab.ui.svg package. 2. Inside of the newly created MIDlet switch to the Flow view. Find the SVG Components section of the Palette then drag and drop two SVG Form components onto the design canvas of the Flow view and use the right-click contextual menu to rename them employeeForm and employeeList. 3. The next step is to connect the SVG images to the source code. To connect the SVG UI components to the source 7 de 19 10/04/2012 17:46
  • 8. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes code we just drag and drop the employeeList.svg file from the Project window onto the employeeList component and repeat this action for the employeeForm.svg by dragging it onto the employeeForm. 4. Now we have to change the instance name of the svgButtons to correspond with the actions they perform. Note that this does not change the button UI, we will do that later. To change the instance name of the svgButtons right-click on the button and select Rename from the contextual menu. Type the action name you want for the svgButtons instance in the New Name field of the Rename Instance Name dialog. Tip: be sure that the new name corresponds to the UI button's function when changing the instance names of UI components. 5. In next step we have to change the default SVG Labels for the buttons and text fields to match the information 8 de 19 10/04/2012 17:46
  • 9. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes displayed by the ContactBrowser application. To do so switch to the Screen view and display employeeForm. Then select the Label item in the Screen view and edit the text properties for each label and button so that they are like the screenshot below. 6. We also need to change the instance name of the SVG text fields. Right-click the First Name and choose Rename from the contextual menu and change the name to svgTextFieldFirstName. Repeat this step for the Last Name field and rename it svgTextFieldLastName. 7. Now in the drop down menu of the IDE project window, switch from employeeForm to employeeList and rename the buttons as shown in the screenshot below. You can see the changes in the Text field of the Properties window. 9 de 19 10/04/2012 17:46
  • 10. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Using the Visual Mobile Designer to Create the Application Flow Now we are ready to create the application flow using the Flow view of Visual Mobile Designer. 1. Switch from the Screen to the Flow view in the IDE. 2. Connect the components as they are shown below. Start by clicking Started on the Mobile Device element and drag the mouse to the employeeList element. Repeat this method to make the other component connections. 10 de 19 10/04/2012 17:46
  • 11. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes In the Source view you can see the mechanism that binds the SVG XML UI Component snippets with Java ME runtime libraries. In the example below you can see how the SVG Button snippets are bound to Java ME objects. The SVG Component is recognized based on the XML snippet ID, in this example, it is button_0. Running the Application Before we add the application logic we should test the Contact Browser UI on the emulator. In the menu choose Run Main Project (F6) and after the emulator launches you can see and test your UI. We have not implemented the application logic yet, but can verify that the UI displays as expected based on the work done in the Visual Mobile Designer. Please note that the UI displays the same way no matter which emulator is bundled in your installation of NetBeans. For 6.5 and non-Windows users of the 6.7 IDE, the Sun Java Wireless Toolkit 2.5.2 is bundled in the IDE. The Windows 11 de 19 10/04/2012 17:46
  • 12. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes distribution of 6.7 is bundled with the Java ME SDK 3.0. The Employee List and Employee Form displayed in the Wireless Toolkit DefaultColorPhone emulator. Adding application logic to the SVG User Interface Now we can use the Visual Mobile Designer to create the application logic for the UI we created in the previous step. We will use some additional components and methods and finish by running the application in the Java ME SDK 3.0 emulator. Background Information SVG ListModel: This defines the methods components like the one SVGList uses to get the value of each cell in a list and the calculate the number of cells needed to display it. Logically the model is a vector, indices vary from 0 to ListDataModel.getSize() - 1. Any change to the contents or length of the data model must be reported to all of the SVGListDataListeners. If you are familiar with Swing's JList model, the SVGListModel should be easy to understand. Entry Point component: The Entry Point component allows us to represent a method in a designed class. The method contains code specified by an action assigned to it, the "Entry Called" pin. This method is very useful when it is is necessary to execute code when switching between application screens, or in our case, to show the SVGButton logic in the Flow view of a Visual Midlet. 12 de 19 10/04/2012 17:46
  • 13. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Creating a Custom SVGList Model In this step we are going to create our own implementation of SVGListModel. Our implemention of SVGListModel is an anonymous class inside of the getSvgList method. 1. Use the Navigator (Ctrl+7 if it is not already displayed) to find the getSvgList element under the employeeList component by right-clicking and choosing Got To Source from contextual menu. 2. Inside of the getSVGList method add the folowing code (highlighted in the red box) which contains an implementation of the ListModel interface as an anonymous class. You can use the code completion feature in the IDE to create the code in the screenshot below. Next and Previous Button Logic In this step we will add logic for the SVGButtons which are a part of the employeeForm. These buttons allow application users to browse through employee data. By clicking Next, the user can jump to the next Empoloyee Contact. By pressing the Previous button, the user should see the previous employee record. In this step we are going to use the Entry Point element which we described earlier. 1. Switch to to the Flow view and add two Entry Point components from the Flow category of the Palette. Right-click 13 de 19 10/04/2012 17:46
  • 14. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes on the components and rename them to Next and Previous as shown below: 2. Now we have to add a global private integer property index to the Visual MIDlet. Let's switch to the Source view and add the following under the Generated Fields guarded block: 3. Now we must add logic to update the UI in the employeeForm. The method we use here updates the SVG UI elements in the employeeForm component. In the Source editor at the end of the class add the following method: Note: you can use the IDE's code completion feature to reproduce the code in the screenshot below. 14 de 19 10/04/2012 17:46
  • 15. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Now we can start adding logic to the nextMethod and previousMethod 4. Switch to the Flow view and right-click on the nextMethod Entry Point and choose the Go To Source option from the contextual menu. 5. In Source editor add the folowing code to the method "nextMethod()". This code displays the next record in the queue of the employee data records. It also invokes the UI to update the information displayed. 6. Repeat the two steps above for the previousMethod to enable the data browsing functionality to work. Next we need to make sure that the UI will be updated when employeeForm and set global index based on a selection done in in the employee list. 7. Switch to the Flow view and right-click the select button in the employeeList and choose Go To Source from the 15 de 19 10/04/2012 17:46
  • 16. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes contextual menu. 8. In the Source editor add the following code to the method getSelect() : Testing the Application in A Touch Screen Device Emulator We are ready to test our application in a Java ME device emulator. We can use either the Java ME SDK 3.0 DefaultFxTouchPhone1 that comes bundled in the NetBeans 6.7 IDE installer or the Sun Java Wireless Toolkit 2.5.2 that is bundled with non-Windows and earlier distributions of the IDE. In order to launch the application in the Java ME SDK 3.0 or other touch screen device emulator we need edit the the Project Properties. 1. Right-click the Project node and choose Properties from the contextual menu. In the Project dialog under Category choose Platform then select Java Platform Micro Edition SDK 3.0 from the Emulator Platform drop down menu. 2. For touch screen device emulation select DefaultFxTouchPhone1 from the Device drop down menu as shown below and click OK. 16 de 19 10/04/2012 17:46
  • 17. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes 3. Go to Run > Run Main Project (F6) and the application launches in the emulator. You can verify that touch screen properties are enabled by placing the mouse pointer over the SVG Components. The mouse cursor will appear as a cross and can be moved around the screen to navigate the application menus as a user would do with their fingertip. 4. In the emulator we can perform some basic UI tests such as using the Previous or Next button to verify that the UI elements are working properly. 17 de 19 10/04/2012 17:46
  • 18. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes Enabling Touch Screen Behavior in the WTK 2.5.2 Emulator To activate touch screen emulation in the WTK we have to modify the DefaultColorPhone configuration properties file. The properties file that we need to modify is DefaultColorPhone.properties 1. Go to the folder WTK_HOME_FOLDERwtklibdevicesDefaultColorPhone and locate the configuration file DefaultColorPhone.properties Troubleshooting Tip: You can find the directory location of the WTK by checking the Project Properties of the SVG application we created. 2. Open the DefaultColorPhone.properties using a text editor and change the value of property touch_screen to "true." Note: If you are using the Java ME SDK 3.0 it is not necessary to modify the properties file to enable touch screen emulation. 18 de 19 10/04/2012 17:46
  • 19. Creating a Touch Enabled SVG UI for Java ME Devices - NetBeans ID... http://netbeans.org/kb/68/javame/svgtouch.html?print=yes 3. After restarting the WTK you can test the application in a touch enabled enviroment. Send Us Your Feedback Summary In this tutorial you learned how to create an SVG-based, touch screen enabled UI for Java ME devices using the NetBeans IDE. See Also Rich SVG UI Components Reference Rich SVG UI Application Using SVG Rich UI Components Reference: Visual Mobile Designer Palette Guide NetBeans Java ME Applications Learning Trail 19 de 19 10/04/2012 17:46