SVG Support in Mobility Pack

There will be new feature in NetBeans Mobility Pack 5.5. This feature appeared after Beta2.

Support for SVG grafics will be new feature in Mobility Pack 5.5. It was demoed at JavaOne this year. (Slides of the session TS-3301). Mobility Pack team will produce 5.5 qbuild together with NetBeans this week to present the feature to users.

SVG Support in Mobility Pack 5.5

Scalable Vector Graphic technology is convinient for J2ME. The image is usually small because it's only xml. The main power is the word "scalable". The screens of the devices has different sizes. The svg image will accommodate to any size in the same quality of the image.

New Custom Components in Palette

There are new custom components in palette. The behaviour of some of them is obvious - SVGSplashScreen, SVGWaitScreen, SVGImage. I'll explain a little bit only the "new" components.
  • SVGAnimatorWrapper - component wrapping 'javax.microedition.m2g.SVGAnimator' class. It allows user to simply show SVG image/animation on the screen.
  • SVGMenu, SVGMenu Element - these two works in the same way like List and List Element.
    Menu is is constructed from SVG image and MenuElements. This component can identify the menu elements in the SVG image and perform animation based using svgImage.focusOn(svgElement) method call. If you have SVG image with menu components following this pattern "menuItem_\*" then the menu elements are created automatically for you when you assign the image to the SVGMenu component.


SVG File Preview

You can open a SVG file directly in NetBeans. You can play the animation. You can browse the components tree. You cannot change the xml directy in NetBeans.


Launch External Editor

When you double click on an opened SVG image that external svg editor will open. You can setup the external editor in Options.






Export to PNG

It can happen that you have nice svg graphics but you need to port the application to phones that doesn't support JSR226. You can easily export the svg image to PNG. You can export even svg animation. It's obvious that it works for all configurations too.


Result of export of an animation




Please note that all visual designer files created in this q-build won't be backward compatible and you will not open them in Mobility Pack 5.0 or 5.5 Betas (1, 2). If you will open visual designer files from previous releases there should this warning appear.
Comments:

Hello Lukas. Do you know, if there are some real devices that implements jsr226 - Tiny SVG? Tom

Posted by Tom on January 03, 2007 at 01:47 AM CET #

there is lot of devices with the support. An list is available at http://j2mepolish.org/devices/devices-svg.html . I don't know if the list is up-to-date.

Posted by Lukas on January 03, 2007 at 02:06 AM CET #

Hi Lukas, I wonder do you know anyway to use Animator to show SVG with external PNG image tag like this <image x='90.0' y='69.46001' width='222.7' height='152.25' xlink:href='myimage.png'/> your early response will be appreciated.

Posted by kelly on January 09, 2007 at 01:35 PM CET #

really don't know :(

look at ExternalResourceHandler class.

Posted by Lukas on January 10, 2007 at 01:41 AM CET #

I tried. private static class CustomResourceHandler implements ExternalResourceHandler { public void requestResource(ScalableImage inImage, String inURI) { inURI = "file:///root1/"+inURI; try { Connector.openInputStream(inURI); } catch ( IOException ioe ) { ioe.printStackTrace(); } } } and got the following exception. Using Pisces Renderer (native version) >>>>>>>>>>>> loadStarting : true >>>>>>>>>>>> loadComplete : true >>>>>>>>>>>> loadingFailed: false >>>>>>>>>>>> loadStarting : true >>>>>>>>>>>> loadComplete : true >>>>>>>>>>>> loadingFailed: false Uncaught exception java/lang/ArrayIndexOutOfBoundsException. java.lang.ArrayIndexOutOfBoundsException at com.sun.perseus.model.Text.applyXMLSpaceDefault(+86) at com.sun.perseus.model.Text.applyXMLSpace(+37) at com.sun.perseus.model.Text.layoutText(+70) at com.sun.perseus.model.Text.checkLayout(+13) at com.sun.perseus.model.Text.paint(+12) at com.sun.perseus.model.ModelNode.paint(+9) at com.sun.perseus.model.StructureNode.paint(+16) at com.sun.perseus.model.ModelNode.paint(+9) at com.sun.perseus.model.StructureNode.paint(+16) at com.sun.perseus.model.ModelNode.paint(+9) at com.sun.perseus.model.DocumentNode.paint(+16) at com.sun.perseus.model.SimpleCanvasManager.fullPaint(+108) at com.sun.perseus.model.SimpleCanvasManager.updateCanvas(+18) at com.sun.perseus.midp.SVGCanvas$1.run(+87) at com.sun.perseus.util.RunnableQueue.run(+271) >>>>>>>>>>>>>> RunnableQueue terminating

Posted by kelly on January 10, 2007 at 08:06 AM CET #

I got a solution to compress SVG into java class I try a lot of times to get in touch with a SUN SVG specialist but nu chance so I try this way

Posted by Desprez on January 16, 2007 at 04:37 AM CET #

I got a solution to compress SVG into java class I try a lot of times to get in touch with a SUN SVG specialist but nu chance so I try this way

Posted by Desprez on January 16, 2007 at 04:38 AM CET #

Hi Lukas, I'm working with JSR 226. I need a map SVG tiny... Do you know a tool that generate those kind of maps?

Posted by vicky on June 04, 2008 at 10:34 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded