BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   SVG Buttons from Plazmic Composer in Java Apps (http://www.blackberryforums.com/developer-forum/219083-svg-buttons-plazmic-composer-java-apps.html)

wuzzo87 02-08-2010 12:56 AM

SVG Buttons from Plazmic Composer in Java Apps
 
Hi guys,

I need help on the following.

I created an svg file containing a rectangle button using the Plazmic Composer.

I so far managed to display it via the following way (which I'm not sure is correct), using ScalableGraphics overriding the void paint() method.

Code:

public void paint(net.rim.device.api.ui.Graphics graphics)
{
            super.paint(graphics);

            // Make sure image is non-null
            if (_image == null)
            {
                return;
            }

            // Bind target Graphics
            _scalableGraphics.bindTarget(graphics);

            // Set the viewport  dimensions       
            _image.setViewportWidth(MAX_WIDTH);
            _image.setViewportHeight(MAX_HEIGHT);

            // Render the svg image/ model
            _scalableGraphics.render(0, 0, _image);

            // Release bindings on Graphics     
            _scalableGraphics.releaseTarget();
}

My only problem is, how do I get the button to be focused or activated. All it does at the moment is to display a static SVG file with the buttons. I've made the focus in/out animations for the buttons, but nothing happens.

What I'd like to accomplish is to write custom Java code for button click events utilizing focus in/out animations already in the svg file (rather than using java to render individual images).

Any help would be much appreciated! Thank you! (y)

ravisoni18 02-12-2010 05:42 AM

two images for on and off button
 
you better write code for navigationclick() function . you set two images one is for on button and one for off button set off image by default and set on image in navigationclick() event...........


All times are GMT -5. The time now is 05:40 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.