You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Oscar Picasso <os...@yahoo.com> on 2006/01/11 00:48:29 UTC

TextFlow and actual surface or lines

Hi,
 
 Is it possible to retrieve the actual 'bounding box' of a flow text on a particular flow region? 
 
 Same question with the actual number of lines.
 
 Thanks
 
 Oscar
 
 
 
			
---------------------------------
Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Re: NullPointerException for flow text 'text content' interfaces [Oups]

Posted by Oscar Picasso <os...@yahoo.com>.
Oups, forget about my previous post.

Just when I just hit the sent button, I realized that I missed to call the methods inside an 'on load' listener'.

Sorry

Oscra

Oscar Picasso <os...@yahoo.com> wrote: Hi,

on a previous reply to one of my post thomas.deweese@kodak.com wrote:
>> 'text content' interfaces from the SVG DOM should be fully
>> functional for flow text.

It seems that the TextContentElement method returns a NullPointerException. This is what happen at least with flowPara and flowSpan. 

These elements where retrieved from a DOM built based on a SVG file. The file itself render correctly in squiggle and I have checked that the elements themselves are not null.

The methods I have tried are :
- getExtentOfChar
- getEndPositionOfChar
- getNumberOfChars
- getComputedTextLength

They all return the exception. I have not tried the other 'text content' methods.

Any  idea?

Oscar


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



		
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.

NullPointerException for flow text 'text content' interfaces

Posted by Oscar Picasso <os...@yahoo.com>.
Hi,

on a previous reply to one of my post thomas.deweese@kodak.com wrote:
>> 'text content' interfaces from the SVG DOM should be fully
>> functional for flow text.

It seems that the TextContentElement method returns a NullPointerException. This is what happen at least with flowPara and flowSpan. 

These elements where retrieved from a DOM built based on a SVG file. The file itself render correctly in squiggle and I have checked that the elements themselves are not null.

The methods I have tried are :
- getExtentOfChar
- getEndPositionOfChar
- getNumberOfChars
- getComputedTextLength

They all return the exception. I have not tried the other 'text content' methods.

Any idea?

Oscar



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by Oscar Picasso <os...@yahoo.com>.
Follow-up about the image disapearing on flowText5.svg with values less than 9.8. 

I get the following message on squiggle: Rendering document failed.

And the following exception trace on the console:

squiggle:
     [java] java.lang.NullPointerException
     [java]     at org.apache.batik.gvt.flow.FlowRegions.getNumRangeOnLine(FlowRegions.java:84)
     [java]     at org.apache.batik.gvt.flow.LineInfo.updateRangeInfo(LineInfo.java:207)
     [java]     at org.apache.batik.gvt.flow.LineInfo.<init>(LineInfo.java:71)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.textWrap(FlowTextPainter.java:188)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.getTextRuns(FlowTextPainter.java:93)
     [java]     at org.apache.batik.gvt.renderer.StrokingTextPainter.getBounds2D(StrokingTextPainter.java:1109)
     [java]     at org.apache.batik.gvt.TextNode.getPrimitiveBounds(TextNode.java:244)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(AbstractGraphicsNode.java:852)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:296)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:215)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:285)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:215)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:285)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:198)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.getBounds2D(GraphicsNodeRable8Bit.java:155)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.createRendering(GraphicsNodeRable8Bit.java:260)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.renderGNR(StaticRenderer.java:487)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.updateWorkingBuffers(StaticRenderer.java:514)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:381)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:350)
     [java]     at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:122)
     [java] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     [java]     at org.apache.batik.gvt.flow.FlowRegions.getNumRangeOnLine(FlowRegions.java:84)
     [java]     at org.apache.batik.gvt.flow.LineInfo.updateRangeInfo(LineInfo.java:207)
     [java]     at org.apache.batik.gvt.flow.LineInfo.<init>(LineInfo.java:71)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.textWrap(FlowTextPainter.java:188)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.getTextRuns(FlowTextPainter.java:93)
     [java]     at org.apache.batik.gvt.renderer.StrokingTextPainter.getOutline(StrokingTextPainter.java:1040)
     [java]     at org.apache.batik.gvt.renderer.BasicTextPainter.getGeometryBounds(BasicTextPainter.java:90)
     [java]     at org.apache.batik.gvt.TextNode.getGeometryBounds(TextNode.java:259)
     [java]     at org.apache.batik.gvt.TextNode.getSensitiveBounds(TextNode.java:271)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedSensitiveBounds(AbstractGraphicsNode.java:900)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:439)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:434)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:439)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:395)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:428)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:395)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:428)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:390)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.nodeHitAt(CompositeGraphicsNode.java:484)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchMouseEvent(AbstractAWTEventDispatcher.java:451)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(AbstractAWTEventDispatcher.java:382)
     [java]     at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(AWTEventDispatcher.java:69)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mouseMoved(AbstractAWTEventDispatcher.java:210)
     [java]     at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.dispatchMouseMoved(AbstractJGVTComponent.java:1181)
     [java]     at org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.dispatchMouseMoved(AbstractJSVGComponent.java:2133)
     [java]     at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.mouseMoved(AbstractJGVTComponent.java:1173)
     [java]     at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
     [java]     at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
     [java]     at java.awt.Component.processMouseMotionEvent(Component.java:5533)
     [java]     at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
     [java]     at java.awt.Component.processEvent(Component.java:5257)
     [java]     at java.awt.Container.processEvent(Container.java:1966)
     [java]     at java.awt.Component.dispatchEventImpl(Component.java:3955)
     [java]     at java.awt.Container.dispatchEventImpl(Container.java:2024)
     [java]     at java.awt.Component.dispatchEvent(Component.java:3803)
     [java]     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
     [java]     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
     [java]     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
     [java]     at java.awt.Container.dispatchEventImpl(Container.java:2010)
     [java]     at java.awt.Window.dispatchEventImpl(Window.java:1774)
     [java]     at java.awt.Component.dispatchEvent(Component.java:3803)
     [java]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
     [java]     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     [java]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     [java]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     [java]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     [java]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
     [java] java.lang.NullPointerException
     [java]     at org.apache.batik.gvt.flow.FlowRegions.getNumRangeOnLine(FlowRegions.java:84)
     [java]     at org.apache.batik.gvt.flow.LineInfo.updateRangeInfo(LineInfo.java:207)
     [java]     at org.apache.batik.gvt.flow.LineInfo.<init>(LineInfo.java:71)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.textWrap(FlowTextPainter.java:188)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.getTextRuns(FlowTextPainter.java:93)
     [java]     at org.apache.batik.gvt.renderer.StrokingTextPainter.getBounds2D(StrokingTextPainter.java:1109)
     [java]     at org.apache.batik.gvt.TextNode.getPrimitiveBounds(TextNode.java:244)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(AbstractGraphicsNode.java:852)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:296)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:215)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:285)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:215)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:285)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:198)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.getBounds2D(GraphicsNodeRable8Bit.java:155)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRable8Bit.createRendering(GraphicsNodeRable8Bit.java:260)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.renderGNR(StaticRenderer.java:487)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.updateWorkingBuffers(StaticRenderer.java:514)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:381)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:350)
     [java]     at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:122)
     [java] Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     [java]     at org.apache.batik.gvt.flow.FlowRegions.getNumRangeOnLine(FlowRegions.java:84)
     [java]     at org.apache.batik.gvt.flow.LineInfo.updateRangeInfo(LineInfo.java:207)
     [java]     at org.apache.batik.gvt.flow.LineInfo.<init>(LineInfo.java:71)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.textWrap(FlowTextPainter.java:188)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.getTextRuns(FlowTextPainter.java:93)
     [java]     at org.apache.batik.gvt.renderer.StrokingTextPainter.getOutline(StrokingTextPainter.java:1040)
     [java]     at org.apache.batik.gvt.renderer.BasicTextPainter.getGeometryBounds(BasicTextPainter.java:90)
     [java]     at org.apache.batik.gvt.TextNode.getGeometryBounds(TextNode.java:259)
     [java]     at org.apache.batik.gvt.TextNode.getSensitiveBounds(TextNode.java:271)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedSensitiveBounds(AbstractGraphicsNode.java:900)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:439)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:434)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:439)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:395)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:428)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:395)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedSensitiveBounds(CompositeGraphicsNode.java:428)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getSensitiveBounds(CompositeGraphicsNode.java:390)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.nodeHitAt(CompositeGraphicsNode.java:484)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchMouseEvent(AbstractAWTEventDispatcher.java:451)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(AbstractAWTEventDispatcher.java:382)
     [java]     at org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(AWTEventDispatcher.java:69)
     [java]     at org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mouseMoved(AbstractAWTEventDispatcher.java:210)
     [java]     at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.dispatchMouseMoved(AbstractJGVTComponent.java:1181)
     [java]     at org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener.dispatchMouseMoved(AbstractJSVGComponent.java:2133)
     [java]     at org.apache.batik.swing.gvt.AbstractJGVTComponent$Listener.mouseMoved(AbstractJGVTComponent.java:1173)
     [java]     at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
     [java]     at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:271)
     [java]     at java.awt.Component.processMouseMotionEvent(Component.java:5533)
     [java]     at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
     [java]     at java.awt.Component.processEvent(Component.java:5257)
     [java]     at java.awt.Container.processEvent(Container.java:1966)
     [java]     at java.awt.Component.dispatchEventImpl(Component.java:3955)
     [java]     at java.awt.Container.dispatchEventImpl(Container.java:2024)
     [java]     at java.awt.Component.dispatchEvent(Component.java:3803)
     [java]     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
     [java]     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
     [java]     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
     [java]     at java.awt.Container.dispatchEventImpl(Container.java:2010)
     [java]     at java.awt.Window.dispatchEventImpl(Window.java:1774)
     [java]     at java.awt.Component.dispatchEvent(Component.java:3803)
     [java]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
     [java]     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
     [java]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
     [java]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
     [java]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
     [java]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
     [java] java.lang.NullPointerException
     [java]     at org.apache.batik.gvt.flow.FlowRegions.getNumRangeOnLine(FlowRegions.java:84)
     [java]     at org.apache.batik.gvt.flow.LineInfo.updateRangeInfo(LineInfo.java:207)
     [java]     at org.apache.batik.gvt.flow.LineInfo.<init>(LineInfo.java:71)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.textWrap(FlowTextPainter.java:188)
     [java]     at org.apache.batik.gvt.flow.FlowTextPainter.getTextRuns(FlowTextPainter.java:93)
     [java]     at org.apache.batik.gvt.renderer.StrokingTextPainter.getBounds2D(StrokingTextPainter.java:1109)
     [java]     at org.apache.batik.gvt.TextNode.getPrimitiveBounds(TextNode.java:244)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(AbstractGraphicsNode.java:852)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:291)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:818)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:215)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.getBounds(AbstractGraphicsNode.java:766)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:442)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:159)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:508)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:159)
     [java]     at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:158)
     [java]     at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:508)
     [java]     at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:159)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(GraphicsNodeRed8Bit.java:139)
     [java]     at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(GraphicsNodeRed8Bit.java:115)
     [java]     at org.apache.batik.ext.awt.image.rendered.TileCacheRed.genRect(TileCacheRed.java:62)
     [java]     at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlockInPlace(AbstractTiledRed.java:609)
     [java]     at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlock(AbstractTiledRed.java:541)
     [java]     at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyToRasterByBlocks(AbstractTiledRed.java:429)
     [java]     at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyData(AbstractTiledRed.java:296)
     [java]     at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(TranslateRed.java:102)
     [java]     at org.apache.batik.ext.awt.image.rendered.PadRed.copyData(PadRed.java:87)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:400)
     [java]     at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:350)
     [java]     at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:122)


Oscar Picasso <os...@yahoo.com> wrote: Hi Thomas,

I finally got it. Thank you very much. And as you said it has much more capabilities. Very interesting.

As a side note I have notice something strange with the flowText5.svg example.

If you set any of its flowRegion font-size to less than 9.8 everything on the 'page' disappears when viewing with squiggle.

Oscar


thomas.deweese@kodak.com wrote: Hi Oscar,

Oscar Picasso  wrote on 01/21/2006 02:11:47 PM:

> I'm sorry but it still don't get it. See below.
> 
> thomas.deweese@kodak.com wrote:
> [...]
> You should look at 
> batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
> if you are using the proprietary batik.extension.svg.FlowTextElement I
> would suggest that the newer flow stuff is in general _much_   more  
capable.
> [...]

> I build my DOM from an SVG file which contains flowText elements. 

   In on of the SVG 1.2 draft they introduce a group of elements for
flowing text.  Take a look at samples/tests/spec12/text for examples
of how to use these elements.

> If I  don't set a version attribute in the svg element the flow elements 
are 
> from the org.apache.batik.extension.svg package.

   This is a fore-runner of the SVG 1.2 stuff.  The only thing this does
better is vertical alignment - but that is because it only supports
flowing into rectangles.

> How do I go from there to 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element?

   If you use the SVG flowRoot element (in the svg namespace with 
version="1.2")
then your elements will be the above with the TextContent interfaces.


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



   

---------------------------------
Yahoo! Photos
  Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by Oscar Picasso <os...@yahoo.com>.
Hi Thomas,

I finally got it. Thank you very much. And as you said it has much more capabilities. Very interesting.

As a side note I have notice something strange with the flowText5.svg example.

If you set any of its flowRegion font-size to less than 9.8 everything on the 'page' disappears when viewing with squiggle.

Oscar


thomas.deweese@kodak.com wrote: Hi Oscar,

Oscar Picasso  wrote on 01/21/2006 02:11:47 PM:

> I'm sorry but it still don't get it. See below.
> 
> thomas.deweese@kodak.com wrote:
> [...]
> You should look at 
> batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
> if you are using the proprietary batik.extension.svg.FlowTextElement I
> would suggest that the newer flow stuff is in general _much_ more 
capable.
> [...]

> I build my DOM from an SVG file which contains flowText elements. 

   In on of the SVG 1.2 draft they introduce a group of elements for
flowing text.  Take a look at samples/tests/spec12/text for examples
of how to use these elements.

> If I  don't set a version attribute in the svg element the flow elements 
are 
> from the org.apache.batik.extension.svg package.

   This is a fore-runner of the SVG 1.2 stuff.  The only thing this does
better is vertical alignment - but that is because it only supports
flowing into rectangles.

> How do I go from there to 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element?

   If you use the SVG flowRoot element (in the svg namespace with 
version="1.2")
then your elements will be the above with the TextContent interfaces.


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




		
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.

Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by th...@kodak.com.
Hi Oscar,

Oscar Picasso <os...@yahoo.com> wrote on 01/21/2006 02:11:47 PM:

> I'm sorry but it still don't get it. See below.
> 
> thomas.deweese@kodak.com wrote:
> [...]
> You should look at 
> batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
> if you are using the proprietary batik.extension.svg.FlowTextElement I
> would suggest that the newer flow stuff is in general _much_ more 
capable.
> [...]

> I build my DOM from an SVG file which contains flowText elements. 

   In on of the SVG 1.2 draft they introduce a group of elements for
flowing text.  Take a look at samples/tests/spec12/text for examples
of how to use these elements.

> If I  don't set a version attribute in the svg element the flow elements 
are 
> from the org.apache.batik.extension.svg package.

   This is a fore-runner of the SVG 1.2 stuff.  The only thing this does
better is vertical alignment - but that is because it only supports
flowing into rectangles.

> How do I go from there to 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element?

   If you use the SVG flowRoot element (in the svg namespace with 
version="1.2")
then your elements will be the above with the TextContent interfaces.


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


Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by Oscar Picasso <os...@yahoo.com>.
Hi Thomas,

I'm sorry but it still don't get it. See below.

thomas.deweese@kodak.com wrote:[...]
   You should look at 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
if you are using the proprietary batik.extension.svg.FlowTextElement I
would suggest that the newer flow stuff is in general _much_ more capable.
[...]

I build my DOM from an SVG file which contains flowText elements. 

If I  don't set a version attribute in the svg element the flow elements are from the org.apache.batik.extension.svg package.

If I set the svg version attribute to 1.2 all the flow elements are all org.apache.batik.dom.svg12.BindableElement objects. 

How do I go from there to  batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element?

Thanks.




		
---------------------------------
 
 What are the most popular cars?  Find out at Yahoo! Autos

Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by Oscar Picasso <os...@yahoo.com>.
Hi Thomas,

thomas.deweese@kodak.com wrote:
   You should look at 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
if you are using the proprietary batik.extension.svg.FlowTextElement I
would suggest that the newer flow stuff is in general _much_ more capable.[...]

Happy to know it. 

But do you mean that you added capibilities to the existing FlowXXX elements or that you added new elements with much more capabilities? 

Is it documented somewhere?

> 2- I have also make a 'batik-all' jar and added to the classpath along 
with 
> - js.jar
> -xerces_2_5_0.jar
> -xalan-2.6.0.jar

        For some reason it appears that xalan isn't on your classpath.
Solved. I rebuilt the batik-all.jar and it works. 



		
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.

Re: Trouble with SVN [Re: TextFlow and actual ...]

Posted by th...@kodak.com.
Hi Oscar,

Oscar Picasso <os...@yahoo.com> wrote on 01/20/2006 07:56:06 AM:

> I am trying to use the code from SVN to use the TextContentElement 
methods of 
> FlowText but I have a lot of trouble.
> 
> 1- I have looked at FlowTextElement and still don't see the 
TextContentElementinterface.

   You should look at 
batik.dom.svg12.SVGOMFlow(Div|Para|Line|Span)Element,
if you are using the proprietary batik.extension.svg.FlowTextElement I
would suggest that the newer flow stuff is in general _much_ more capable.
Although regrettably, currently it appears that it will be just as 
proprietary in the foreseeable future.


> 2- I have also make a 'batik-all' jar and added to the classpath along 
with 
> - js.jar
> -xerces_2_5_0.jar
> -xalan-2.6.0.jar

        For some reason it appears that xalan isn't on your classpath.

>     PrefixResolver cannot be resolved to a type
> 
>     at 
org.apache.batik.dom.AbstractDocument.<init>(AbstractDocument.java:46)

--------------------

> thomas.deweese@kodak.com wrote:
> Hi Oscar,
> 
> Oscar Picasso wrote on 01/12/2006 08:14:41 AM:
> 
> > Actually I want to something similar to what I do with a regular text 
> element 
> > (as I asked in a previous thread): calculate a new font-size to let 
the 
> text 
> > fit on a particular region.
> 
> 
> >> 'text content' interfaces from the SVG DOM should be fully
> >> functional f or flow text.
> 
> > How do I get these interfaces? I have looked at the different FlowXXX 
> and I 
> > don't see which are the 'text content' interfaces and their BBox 
> methods.
> 
> You are correct the Flow elements didn't have the TextContent
> interfaces. I have fixed this in SVN (it was really just a matter
> of basing them on the right baseclass). Sorry about that... 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgrraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

> 
> Yahoo! Photos – Showcase holiday pictures in hardcover
> Photo Books. You design it and we’ll bind it!

Onload event and svg12

Posted by Oscar Picasso <os...@yahoo.com>.
Hi,

I succeeded to dynamically get the computed lengths for text elements thanks to Thomas and Andreas explanations.

In order to get the 'onload' event fired, I set an onload attribute with a dummy value to the text element. 

Something like: <text onload="i=1">....

Not very elegant but it worked. Let me know if there a better way.

I have a more serious problem though when doing this with svg12. If there is element with an onload attribute, I get a ClassCastException (see trace below)

Any idea?

java.lang.ClassCastException: org.apache.batik.bridge.BridgeContext
    at org.apache.batik.bridge.svg12.SVG12TextElementBridge.addTextEventListeners(Unknown Source)
    at org.apache.batik.bridge.SVGTextElementBridge.initializeDynamicSupport(Unknown Source)
    at org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
    at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
[...]

		
---------------------------------
 
 What are the most popular cars?  Find out at Yahoo! Autos

Trouble with SVN [Re: TextFlow and actual ...]

Posted by Oscar Picasso <os...@yahoo.com>.
Hi Thomas,

I am trying to use the code from SVN to use the TextContentElement methods of FlowText but I have a lot of trouble.

1- I have looked at FlowTextElement and still don't see the TextContentElement interface.

2- I have also make a 'batik-all' jar and added to the classpath along with 
- js.jar
-xerces_2_5_0.jar
-xalan-2.6.0.jar
-xml-apis-dom3.jar

And while it compiles I get a strange error at run time (see below).

Any idea?

Thanks.

java.lang.Error: Unresolved compilation problems: 
    The import org.apache.xml.utils cannot be resolved
    The import org.apache.xpath cannot be resolved
    The import org.apache.xpath cannot be resolved
    The import org.apache.xpath cannot be resolved
    XPath cannot be resolved to a type
    XPathContext cannot be resolved to a type
    xpath cannot be resolved
    XPath cannot be resolved to a type
    XPath cannot be resolved
    context cannot be resolved
    XPathContext cannot be resolved to a type
    context cannot be resolved
    XObject cannot be resolved to a type
    xpath cannot be resolved
    context cannot be resolved
    xpath cannot be resolved
    XObject cannot be resolved to a type
    XObject cannot be resolved to a type
    XObject cannot be resolved to a type
    XObject cannot be resolved to a type
    XObject cannot be resolved to a type
    PrefixResolver cannot be resolved to a type

    at org.apache.batik.dom.AbstractDocument.<init>(AbstractDocument.java:46)
    at org.apache.batik.dom.AbstractStylableDocument.<init>(AbstractStylableDocument.java:61)
    at org.apache.batik.dom.svg.SVGOMDocument.<init>(SVGOMDocument.java:126)
    at org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(SVGDOMImplementation.java:152)
    at org.apache.batik.dom.util.SAXDocumentFactory.startElement(SAXDocumentFactory.java:595)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:411)
    at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:344)
    at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:200)
    at test.AppTest.testApp(AppTest.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)





thomas.deweese@kodak.com wrote: Hi Oscar,

Oscar Picasso  wrote on 01/12/2006 08:14:41 AM:

> Actually I want to something similar to what I do with a regular text 
element 
> (as I  asked in a previous thread): calculate a new font-size to let the 
text 
> fit on a particular region.


>> 'text content' interfaces from the SVG DOM should be fully
>> functional for flow text.

> How do I get these interfaces? I have looked at the different FlowXXX 
and I 
> don't see which are the 'text content' interfaces and their BBox 
methods.

   You are correct the Flow elements didn't have the TextContent
interfaces.  I have fixed this in SVN (it was really just a matter
of basing them on the right baseclass).  Sorry about that... 

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




		
---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
 Photo Books. You design it and we’ll bind it!

Re: TextFlow and actual surface or lines

Posted by th...@kodak.com.
Hi Oscar,

Oscar Picasso <os...@yahoo.com> wrote on 01/12/2006 08:14:41 AM:

> Actually I want to something similar to what I do with a regular text 
element 
> (as I  asked in a previous thread): calculate a new font-size to let the 
text 
> fit on a particular region.


>> 'text content' interfaces from the SVG DOM should be fully
>> functional for flow text.

> How do I get these interfaces? I have looked at the different FlowXXX 
and I 
> don't see which are the 'text content' interfaces and their BBox 
methods.

   You are correct the Flow elements didn't have the TextContent
interfaces.  I have fixed this in SVN (it was really just a matter
of basing them on the right baseclass).  Sorry about that... 

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


Re: TextFlow and actual surface or lines

Posted by Oscar Picasso <os...@yahoo.com>.
Hi Thomas,

thomas.deweese@kodak.com wrote:  Hi Oscar,

Oscar Picasso  wrote on 01/10/2006 06:48:29 PM:

> Is it possible to retrieve the actual 'bounding box' of a flow text on a 
> particular flow region? 

   I'm not 100% certain what you are asking here.  
   
    Actually I want to something similar to what I do with a regular text element (as I  asked in a previous thread): calculate a new font-size to let the text fit on a particular region.
  'text content' interfaces from the SVG DOM should be fully
functional for flow text.  Which enables you to request the
BBox of any text element, as well as the bbox of individual
chars.
 How do I get these interfaces? I have looked at the different FlowXXX and I don't see which are the 'text content' interfaces and their BBox methods.
 
 Thanks.
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: TextFlow and actual surface or lines

Posted by th...@kodak.com.
Hi Oscar,

Oscar Picasso <os...@yahoo.com> wrote on 01/10/2006 06:48:29 PM:

> Is it possible to retrieve the actual 'bounding box' of a flow text on a 

> particular flow region? 

   I'm not 100% certain what you are asking here.  But the
'text content' interfaces from the SVG DOM should be fully
functional for flow text.  Which enables you to request the
BBox of any text element, as well as the bbox of individual
chars.

> Same question with the actual number of lines.

   This is not provided in any direct manner.  One might be 
able to infer the change of line from changes in the 
character positions, but this would be a little slow
and depending on how much you are doing with the
text might not be 100% accurate.


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