Java Reference
In-Depth Information
You can use the SVGAPI in one of two ways to render an image: you can use the
SVGImage class to render static images, or you can use the SVGAnimator class to render
dynamic images. These work with MIDP Canvas subclasses or AWT Component sub-
classes, depending on the Java ME configuration of the target device. It's generally
easiest to create an SVGImage instance and delegate rendering to an SVGAnimator , which
has its own rendering thread and state machine to manage animated SVG images as
well as any user interaction the SVG image requires. Finally, if you're just knocking out
an application using NetBeans and need a simple container to hold an animated SVG
(e.g., for a splash screen or interstitial display), NetBeans itself provides a package with
some simple components for rendering static or animated SVG images. You can use
those components right from the NetBeans GUI builder, making it easy to add SVG-
based features to your application.
Regardless of the kind of multimedia your application is going to render, thread
management in multimedia applications is crucial. You should never attempt to render
multimedia—using either the MMAPI or the SVGAPI—on the main application or MIDlet
thread, because the work necessary to perform the rendering may stall the UI thread,
making the device feel sluggish or unusable. Both the MMAPI and the SVGAPI provide
you with interfaces to schedule operations on the main thread, and you can coordinate
activities between the main UI thread and any multimedia threads using simple Java
primitives like synchronization via the synchronized keyword or a monitor variable.
 
Search WWH ::




Custom Search