This is the automatically generated IRC log made by the logger bot from the SVG IRC chat at irc.freenode.net port 6667 channel #svg
You are here: Logs Home / 2008-07-15
06:24:46 <dkao> hello
06:24:52 <dkao> is anyone here?
07:35:09 <[AD]Turbo> hi all
12:36:08 <stelt> 1.Mozilla 6.096 43,90%
12:36:08 <stelt> 2.Microsoft Internet Explorer 6.095 43,90%
12:36:08 <stelt> That's what just happened for running 2008 total of http://svg.startpagina.nl
12:36:38 <heycam> hehe
15:02:15 <Sirak> Ok, so.. in Batik, I have an SVGDocument object which, supprisingly enough, contains my entire SVG document. I want to spit out the raw XML into a String object
15:02:50 <Sirak> Are there any quickfire ways of doing this without looping through all nodes and building the XML that way?
15:04:39 <shellac> I'm don't know batik, but SVGDocument is a subinterface of org.w3c.dom.Document
15:05:06 <shellac> so anything that serialises that to a string ought to work
15:06:42 <shellac> Sirak: the method I use is http://faq.javaranch.com/java/DocumentToString
15:08:01 <Sirak> Yeah, I can do it that way by looping through all nodes
15:08:15 <emzic> you could use an SVGTranscoder
15:08:45 <emzic> SVGTranscoder.transcoder(TranscorderInput, TranscoderOutput);
15:08:56 <emzic> where transcoder output could be a stringwriter
15:12:02 <Sirak> Hrm...
15:12:32 <Sirak> It might be easier to use DOMUtilities and create my own Writer
15:18:57 <emzic> ok
15:20:06 <emzic> i would like to use SVG-interaction in batik
15:21:00 <emzic> will i need to implement my own DOMMouseEvents and dispatch them with the EventSupport ?
15:28:40 <Sirak> The app I'm writing catches MouseEvents ^_^
15:29:12 <emzic> yeah catching is not the problem, but dispatching :)
15:29:26 <Sirak> HOw do you mean? o.O
15:29:46 <emzic> how does the bufferedimage know when it is clicked?
15:30:00 <emzic> and what event do i need to dispatch when it is clicked
15:30:06 <Sirak> Ahh, there we go. I created my own Writer class to return the XML string... Probably hacky and there must be a better way, but this works for meeeeee
15:30:19 <emzic> ok :)
15:31:25 <Sirak> Every time you add something to your SVGDocument, you do so by creating an Element
15:31:32 <Sirak> You can cast the Element as an EventTarget
15:31:52 <Sirak> so every time that element is clicked, you can fire off bog standard Java events
15:32:25 <emzic> thanks but how does the element know when it is clicked?
15:33:28 <Sirak> When you cast the Element as an EventTarget, you can just do "eventTarget.addEventListener ("mouseup", new OnMouseUpAction() ,false);"
15:33:38 <Sirak> Every time it's clicked, it will call OnMouseUpAction();
15:33:43 <emzic> ok, yeah i already got that
15:33:50 <emzic> but this is never triggered
15:33:58 <Sirak> :-\
15:34:10 <emzic> because the svg is rasterized to a bufferedimage
15:34:18 <emzic> and displayed somewhere on screen
15:34:32 <emzic> i only get a java-event on that bufferedimage
15:34:32 <Sirak> Ahh I see
15:34:40 <Sirak> if you're using Batik why not just display the SVG?
15:34:44 <emzic> which i will need to transform into a DOM-event
15:34:55 <emzic> thats a long story :-)
15:35:22 <emzic> basically because it is for a game running with OpenGL, which can only display textures and no SVGs
15:36:04 <Sirak> Then why use SVG at all? :p
15:36:23 <emzic> good question! the answer is another long story ;)
15:37:10 <emzic> our artists use illustrator for the textures which exports very good SVGs. and SVGs can easily be manipulated at runtime. colorize shapes, add strokes, etc....
15:37:37 <emzic> if we were to use pixelimages there would be a large overhead, so SVGs are ideally suited.
15:37:41 <Sirak> Then why not add Mouse events once they're out in your OpenGL world?
15:38:08 <emzic> hmmm, how do you mean that?
15:39:34 <Sirak> Well, if you're rasterizing the SVG and exporting it to your OpenGL game, it will lose all MousEvents attached to it
15:40:20 <emzic> exactly thats my problem
15:40:33 <emzic> so i thought about "faking" these event
15:40:53 <emzic> by using batik's EventSupport class
15:41:07 <emzic> which will let me create DOMMouseEvents which i can then dispatch
15:41:16 <emzic> the problem is, that they never seem to reach their target
15:41:24 <emzic> so the eventhandler is never triggered
15:47:34 <Sirak> I don't think what your trying to do will work
15:47:35 <Sirak> Hence why... it's.. not working XD
15:47:51 <Sirak> I've gotta move my computer to another desk. Damn office manager making me move *Sigh*
15:47:54 <Sirak> Laters
15:48:16 <emzic> alright
15:48:20 <emzic> thanks anyways
20:41:04 <luke-jr> know any decent svg viewers?
The chat logged here contains content written by the chat participants identified by their IRC nick. No other identity is recorded.
Scripts provided by Dave Beckett, logger hosted by Jim Ley