xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnold Figueroa" <afigue...@altaira.com>
Subject Not updating
Date Thu, 02 May 2002 12:38:02 GMT
	I can not display the updated change I modified on the DOM tree. I can see
text change from "INIT" 		to "TEST" on the console(debug).
	It's supposed to display the change on the text "INIT" right below the LED
to "TEST".
	Am I missing anything.
	Does it matter how SVG was generated. I created it from Illustrator 10.

	// Create and add the SVG canvas.
		m_svgCanvas = new JSVGCanvas();
		m_svgCanvas.setDocumentState( JSVGCanvas.ALWAYS_DYNAMIC );
		m_svgCanvas.setURI( uri );
		panel.add( m_svgCanvas);

    public void doDynamicUpdate( ){

		// Obtain the XML text node containing the label to update.
		m_doc = m_svgCanvas.getSVGDocument();

		SVGTextElement thisElement =
(SVGTextElement)m_doc.getElementById("status_text");
		Node firstNode = thisElement.getFirstChild();		//tspan
		final Text textNode = (Text)firstNode.getFirstChild();  //"INIT"

		// Schedule the DOM tree update using the Batik update manager.
		UpdateManager updateMgr = m_svgCanvas.getUpdateManager();
		RunnableQueue svgEventQueue = updateMgr.getUpdateRunnableQueue();
		svgEventQueue.invokeLater( new Runnable( ){
			public void run( ){
				textNode.setData("TEST");
			}
	}
	//main
	// Create the AnimatedSVG panel.
	// Create and display a frame with the AnimatedSVG panel in it.
	//when button is press, do the updating
	final JButton btn = new JButton( "Loading..." );
			btn.addActionListener( new ActionListener( ){
				public void actionPerformed( ActionEvent event ){
					svg.doDynamicUpdate();
				}
			} );
// Resize the frame after the SVG document's size is known.
/ Do not enable the button until the SVG file has loaded.
// Make the button enabled and update the label on the button.


windows 2000, Batik1.5 beta1(updated cvs), JDK1.4


thanks
arnold












---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message