Huh......,
I didn't expect this,
Is there a point before which you should not try to get the UpdateManager?
In this code segment, toward the bottom, where UpdateManager is referenced,
it comes up as null, throwing, obviously, a NPE. I thought the
UpdateManager came with the Canvas, but at least after the document got
loaded.
Oddly enough, within eclipse, in the "variables" view I can run down from
the Canvas to the UpdateManager and the RunnableQueue(which was the first
NPE flagged). In any case, with UpdateManager null, RunnableQueue certainly
wouldn't be available.
public BluePearlViewer(JFrame frame) {
f = frame;
// Test Harness - Useful in debugging the Canvas, once fully tested
comment out for production
SVGCanvasListeners scl = new SVGCanvasListeners();
boolean ok = scl.addSVGCanvasListeners(svgCanvas);
// Remove for production
// Set before loading Document
svgCanvas.setDocumentState(JSVGComponent.ALWAYS_DYNAMIC);
// Build the SVG Document Object Model and then set the canvas to that
DOM
DOMMethod dm = new DOMMethod();
SVGDOMBuilder sdb = dm.getSVGDOMBuild();
svgDoc = sdb.buildSVGDOM(s_uri);
svgCanvas.setSVGDocument(svgDoc);
bc.setDynamicState(bc.DYNAMIC);
svgCanvas.setRecenterOnResize(true);
svgCanvas.setEnablePanInteractor(true);
svgCanvas.setEnableImageZoomInteractor(true);
svgCanvas.setEnableZoomInteractor(true);
svgCanvas.setFocusable(true);
svgCanvas.setBackground(new Color(0, 0, 0, 0));
svgCanvas.setDoubleBuffered(false);
// svgCanvas.setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION);
// svgCanvas.setDebugGraphicsOptions(DebugGraphics.FLASH_OPTION);
svgCanvas.setPreferredSize(new Dimension(700, 700));
svgCanvas.setSize(685, 685);
svgCanvas.setBackground( Color.blue );
svgPanel.add( svgCanvas );
svgCanvas.repaint();
svgCanvas.setVisible(true);
UpdateManager um = svgCanvas.getUpdateManager();
// Returns NULL.......................
RunnableQueue rq = um.getUpdateRunnableQueue();
//
f.add(svgCanvas);
Thanks,
KWL