Java Reference
In-Depth Information
private void initSvgPlayer()
throws IOException {
InputStream in = getClass().getResourceAsStream(mediaName);
SVGImage svgImage = (SVGImage)ScalableImage.createImage(in, null);
svgAnimator = SVGAnimator.createAnimator(svgImage);
Canvas svgCanvas = (Canvas)svgAnimator.getTargetComponent();
viewerDisplayable = (Displayable)svgCanvas;
svgImage.setViewportWidth(svgCanvas.getWidth());
svgImage.setViewportHeight(svgCanvas.getHeight());
}
private void configViewSound() {
// No-op
}
private void configViewSvg() {
// No-op
}
private void configViewVideo() {
captureCommand = new Command("Capture", Command.ITEM, 0);
mediaScreen.addCommand(captureCommand);
videoControl = (VideoControl) player.getControl("VideoControl");
if (videoControl != null) {
videoItem = (Item) videoControl.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE, null);
mediaScreen.append(videoItem);
}
capturedImage = new ImageItem(null, null,
ImageItem.LAYOUT_DEFAULT, null);
mediaScreen.append(capturedImage);
}
private void playFromResource() {
try {
if ( mediaType.equals("image/svg+xml")) {
initSvgPlayer();
configViewSvg();
svgAnimator.play();
}
 
Search WWH ::




Custom Search