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 Chimera <ch...@Ennersea.net> on 2004/01/19 03:37:59 UTC

JSVGCanvas run problems. Crimson?

---- Problem:

When trying to run the JSVGCanvas tutorial, I get errors, presumably because
Crimson is not in my path?  Compiles fine, even runs, just will not load any
files with the 'Open...' button.  Errors thrown are below.

I suspect this is because Crimson is not on my path.  Where do I find
Crimson, or is the tutorial simply out of date (like many of the tutorials I
have found on the web dealing with Java + SVG, including Sun's site)?  I
cannot find Crimson, as all references and sources I locate show Crimson is
now deprecated in favor of Xerces (which Xerces 1.6.0 -is- in my path in
Netbeans, it is loaded).

Any help or pointers?  Sorry if this is an FAQ, but the list FAQ doesn't
seem to give anything on this, and I cannot find the archives (not noted in
the List subscribe, info or faq replies).

Is it just because this tutorial is old?

---- Environment:

Windows 2000 SP4
SDK 1.4.2 (source)
Netbeans 3.5.1

---- Output window in Netbeans shows:

java.lang.ExceptionInInitializerError
        at
org.apache.batik.swing.svg.JSVGComponent$BridgeUserAgent.getXMLParserClassNa
me(Unknown Source)
        at
org.apache.batik.swing.svg.JSVGComponent$BridgeUserAgentWrapper.getXMLParser
ClassName(Unknown Source)
        at org.apache.batik.bridge.DocumentLoader.<init>(Unknown Source)
        at org.apache.batik.swing.svg.JSVGComponent$1.run(Unknown Source)
        at org.apache.batik.swing.svg.JSVGComponent.stopThenRun(Unknown
Source)
        at org.apache.batik.swing.svg.JSVGComponent.loadSVGDocument(Unknown
Source)
        at org.apache.batik.swing.JSVGCanvas.setURI(Unknown Source)
        at SVGApplication$2.actionPerformed(SVGApplication.java:67)
        at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
        at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButto
n.java:1839)
        at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:4
20)
        at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener
.java:245)
        at java.awt.Component.processMouseEvent(Component.java:5100)
        at java.awt.Component.processEvent(Component.java:4897)
        at java.awt.Container.processEvent(Container.java:1569)
        at java.awt.Component.dispatchEventImpl(Component.java:3615)
        at java.awt.Container.dispatchEventImpl(Container.java:1627)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
        at java.awt.Container.dispatchEventImpl(Container.java:1613)
        at java.awt.Window.dispatchEventImpl(Window.java:1606)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:201)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:151)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: java.util.MissingResourceException: Can't find bundle for base
name org.apache.batik.util.resources.XMLResourceDescriptor, locale en_US
        at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:8
04)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:538)
        at org.apache.batik.util.XMLResourceDescriptor.<clinit>(Unknown
Source)
        ... 31 more



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


Re: JSVGCanvas run problems. Crimson?

Posted by Chimera <ch...@Ennersea.net>.
> now deprecated in favor of Xerces (which Xerces 1.6.0 -is- in
> my path in Netbeans, it is loaded).

Sorry, that should be 2.6.0 for Xerces version.

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


Re: JSVGCanvas run problems. Crimson?

Posted by Chimera <ch...@Ennersea.net>.
----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Monday, January 19, 2004 2:50 AM
Subject: Re: JSVGCanvas run problems. Crimson?

>     It looks to me like you are missing one or more of the Batik
> Jar files.  In particular the method that throws the initializer
> error is most likely trying to reference a class from batik-util.jar.
> If you are working from source you are probably missing the
> 'resources' directory from your classpath.
>
>     For a complete description of the Batik Jar file dependencies
> take a look at: http://xml.apache.org/batik/install.html
> page it has a section which shows all of the jar file dependencies.
>

Right now I am attempting to figure out what I didn't download or compile.
I downloaded the source package and built it with the script.  Do the Jars
not get built in the source build?

Where should the resources directory be?

Is there a document on the website that is maintained that shows the built
directory tree for newbies like myself to compare against?

Thanks in advance.


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


Re: JSVGCanvas run problems. Crimson?

Posted by Thomas DeWeese <Th...@Kodak.com>.
> From: "Thomas DeWeese" <Th...@Kodak.com>
> 
>>    It looks to me like you are missing one or more of the Batik
>>Jar files.  In particular the method that throws the initializer
>>error is most likely trying to reference a class from batik-util.jar.
>>If you are working from source you are probably missing the
>>'resources' directory from your classpath.

Chimera wrote:

> Okay, color me silly.  I mounted my \Batik Source\resources directory in
> Netbeans and reran.  Bingo.  I just figured everything I would need would be
> in the sources directory.

    No only Java source is in the sources directory.  All of the
resource files to handle internationalization and some customization
are in the resources directory.

> SNQ2:  Does this mean that if I build an application, that these files need
> to be loaded/distributed with the Java app?

    Yes, the ant build files include targets to build jar files which
will included the appropriate parts of the resources tree in the
appropriate jar files.

> Sorry, I am still learning to think/speak/read like a real programmer.  Only
> been learning this for 6 months in my hobby time (I am a systems/security
> admin for an anti-spam/anti-virus company in the real world). :)
> 
> I hope to use Batik to build an open-source war simulator game, using SVG
> content for all graphics such as the maps and units and whatnot.

    Good luck, it should be pretty neat.



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


Re: JSVGCanvas run problems. Crimson?

Posted by Chimera <ch...@Ennersea.net>.
----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Monday, January 19, 2004 2:50 AM
Subject: Re: JSVGCanvas run problems. Crimson?



>     It looks to me like you are missing one or more of the Batik
> Jar files.  In particular the method that throws the initializer
> error is most likely trying to reference a class from batik-util.jar.
> If you are working from source you are probably missing the
> 'resources' directory from your classpath.

Okay, color me silly.  I mounted my \Batik Source\resources directory in
Netbeans and reran.  Bingo.  I just figured everything I would need would be
in the sources directory.

SNQ2:  Does this mean that if I build an application, that these files need
to be loaded/distributed with the Java app?

Sorry, I am still learning to think/speak/read like a real programmer.  Only
been learning this for 6 months in my hobby time (I am a systems/security
admin for an anti-spam/anti-virus company in the real world). :)

I hope to use Batik to build an open-source war simulator game, using SVG
content for all graphics such as the maps and units and whatnot.


Chimera


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


Re: Selection and deselection

Posted by Thomas DeWeese <Th...@Kodak.com>.
Fabio Biscaro wrote:

> Thanks for your previous suggestions with selection.

Hi Fabio,

   No problem.

> Selection is really a big problem for me because i Need to know what
> text is selected. I saw that there are not info about selected text, so
> I tried to force selectio with selectSubString. 

   Sure, I understand.

> The problem is that I should also force deselection.
> 
> I tried to modify SVGOMTextContentElement adding a new method
> deselectText(). I added this method to many classes
> (SVGTextContentSupport, SVGTextContent, ...) up to ConcreteTextSelector
> where I call your method clearSelection().

    It would be much better to implement the official SVG DOM
method on SVGSVGElement rather than introducing a proprietary
method on Text Content.

> clearSelection() works very well many times but not every time. Sometime
> selection is not cleared. Instead i see that selection is correctly
> cleared by your checkSelectGesture(). I copied code from
> checkSelectGesture():
>             if (selectionNode != null)
>                 selectionNode.getRoot()
>                     .removeTreeGraphicsNodeChangeListener(this);
> To my deselectText() and sometime work, some other gave me a
> concurrentException.

    Well a concurrentException is a dead giveaway that you aren't
making your changes in the UpdateManager Thread.  I suspect
that if you make your code that calls the method on the DOM
call it in the UpdateManager thread that all your problems will
go away (I suspect even just the 'clearSelection()' will work
- although the remove call doesn't hurt - it probably would be
a good idea to move that into the clearSelection method actually.

> You last time said that it would be easy to add deselectAll() function
> to SVGSVGElement but you couldnt add it because 1.5.1 is Stable.
> 
> Can you suggest me some code to implement deselectAll() or to correct my
> deselectText()? 
> 
> Thanks,
> Just for reading,
> fabio
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 




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


Selection and deselection

Posted by Fabio Biscaro <bi...@webscience.it>.
Hi Thomas. Thanks for your previous suggestions with selection.

Selection is really a big problem for me because i Need to know what
text is selected. I saw that there are not info about selected text, so
I tried to force selectio with selectSubString. 

The problem is that I should also force deselection.

I tried to modify SVGOMTextContentElement adding a new method
deselectText(). I added this method to many classes
(SVGTextContentSupport, SVGTextContent, ...) up to ConcreteTextSelector
where I call your method clearSelection().
clearSelection() works very well many times but not every time. Sometime
selection is not cleared. Instead i see that selection is correctly
cleared by your checkSelectGesture(). I copied code from
checkSelectGesture():
            if (selectionNode != null)
                selectionNode.getRoot()
                    .removeTreeGraphicsNodeChangeListener(this);
To my deselectText() and sometime work, some other gave me a
concurrentException.

You last time said that it would be easy to add deselectAll() function
to SVGSVGElement but you couldnt add it because 1.5.1 is Stable.

Can you suggest me some code to implement deselectAll() or to correct my
deselectText()? 

Thanks,
Just for reading,
fabio


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


Re: SVGSVGElement ???

Posted by Thomas DeWeese <Th...@Kodak.com>.
Fabio Biscaro wrote:
> What is exactly SVGSVGElement?

    This is the interface implemented by the 'svg' element in
SVG.  The Batik implementation the interface is
'batik.dom.svg.SVGOMSVGElement'.

> I looked at the java code and I saw that there is a deselectAll()
> function onto SVGSVGElement.

    Yes, well I pointed it out in response to your original question.

> How can I use it?

    You can't, as I said then Batik doesn't implement this method
yet.  It actually isn't that hard to implement but I would
prefer not to introduce instability at this point.  Once
1.5.1 goes final (probably soon, I'm just updating adding
documentation at this point) then I'll look at implementing
some of the methods on the SVG element, and rolling in
Cameron's patches.



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


SVGSVGElement ???

Posted by Fabio Biscaro <bi...@webscience.it>.
What is exactly SVGSVGElement?

I looked at the java code and I saw that there is a deselectAll()
function onto SVGSVGElement.

How can I use it?

Thanks, 
Fabio


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


Re: JSVGCanvas run problems. Crimson?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Chimera wrote:

> ---- Problem:
> 
> When trying to run the JSVGCanvas tutorial, I get errors, presumably because
> Crimson is not in my path?  Compiles fine, even runs, just will not load any
> files with the 'Open...' button.  Errors thrown are below.

    It looks to me like you are missing one or more of the Batik
Jar files.  In particular the method that throws the initializer
error is most likely trying to reference a class from batik-util.jar.
If you are working from source you are probably missing the
'resources' directory from your classpath.

    For a complete description of the Batik Jar file dependencies
take a look at: http://xml.apache.org/batik/install.html
page it has a section which shows all of the jar file dependencies.

> I suspect this is because Crimson is not on my path.  Where do I find
> Crimson, or is the tutorial simply out of date (like many of the tutorials I
> have found on the web dealing with Java + SVG, including Sun's site)?  

    Crimson is no longer used, so yes the text referencing 'crimson' is
out of date, the rest seems pretty good, thanks for pointing this out.




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