From: brett l. <bre...@gm...> - 2011-08-17 21:53:04
|
Not to pick nits needlessly, but SVG *is* XML. The whole file format is XML. Personally, I'd like to see Rails simply make use of the information contained within the SVG rather than duplicate the exact same information in some other alternative format that's also XML. However, that would require leveraging Batik more extensively, not less. I think I wrote most of the Swing and drawing code. It's crap. ;-) This is because I was learning my way around Swing while writing it. I definitely would like to see it refactored and improved upon. Adam - can you post your patches to show your ideas? It sounds like there's some interest in at least seeing how far you got with your ideas. ---Brett. On Wed, Aug 17, 2011 at 1:48 PM, Adam Badura <ab...@o2...> wrote: > In general I do like thinking that I'm working on it. Yet in reality I > haven't done anything for a long time now. Mostly due to now 2 children > consuming way to much time. ;) (And this requires serious investigations > into Java, SVG and Rails itself thus I have to be rather focused and fresh > to work on it...) > > I would not mind anyone taking over the patch especially that I cannot > promise when I will do it myself. I could serve with advice or reviewing if > that was desired. > > > The patch itself showed only how the map looks like when drawn by providing > SVG document. It was far from usable. (No selection, no proper scrolling, no > stations, ...) > > > I chose generating SVG document (as XML DOM) based on map and current state > (as opposed to drawing through Batik) because: > (1) I think it adds a reasonable layer of abstraction. It is much easier to > write (and then maintain) code that generates XML then code that draws. > (2) I think it is more reusable generally. Such document could be saved and > used outside of Rails. > (3) I simply like XML. And that was part of my investigations in maintining > a better XML+SVG tiles repository for 18xx. > > -----Oryginalna wiadomość----- > From: Stefan Frey > Sent: Wednesday, August 17, 2011 10:43 PM > To: Development list for Rails: an 18xx game > Subject: Re: [Rails-devel] batik and svg documents (was: Background Maps) > > Adam & Erik, > going back through the archives of mails, which I did not read carefully > before, I saw this patch. > > What happened to it, it seems that it was not applied to the trunk, but > maybe > it went into a svn branch and was not imported into git? > > I did not look into the display code too much (only a few fixes until now > and > the train paths), however even at that time I was surprised that the > existing > code mainly used standard awt/swing functions instead of the batik svg > functionality. > > The approach of Adam to create a SVG document directly is one way. Another > possibility is to create the SVG document indirectly by replacing the > Graphics2D implementation with the batik provided SVGGraphics2D engine. > > This redirects the Java graphics functions to store the output as SVG > elements > into the SVG document. > > So questions are: Adam are you still working on this? And what was the > reason > for you Erik to not following up this direction (most likely many other to- > dos)? > > I imagine that creating a unified SVG document would make the adding > alternative GUIs much easier than now. > > Stefan > > > > On Monday, June 06, 2011 11:45:57 pm Adam Badura wrote: >> Sorry for the delay but I decided to adapt the patch to current code >> revision and have a look whether it does what I recall it did. Also I >> removed some additional works on symbols which I was doing along (this was >> the reason to start this work) but would be only distracting now. >> >> The code is mostly not documented as it is a working patch. Its not also >> "clean". But it does show that SVG Document isn't that hard. (To scroll or >> zoom use standard Batik components ways: Shift/Ctrl + moves with mouse >> buttons pressed.) >> >> So what do you think? Should I continue my work in this area? >> >> Adam Badura >> >> -----Oryginalna wiadomość----- >> From: Erik Vos >> Sent: Monday, June 06, 2011 2:43 PM >> To: 'Development list for Rails: an 18xx game' >> Subject: Re: [Rails-devel] Background Maps >> >> Adam, >> >> Congratulations with your second child! >> >> I'm certainly interested to have a look at your code, to check if I can >> merge it with my map display code. >> >> Some more comments below. >> >> > -----Oorspronkelijk bericht----- >> > Van: Adam Badura [mailto:ab...@o2...] >> > >> > I was working on moving entire drawing to SVG (and this was one of >> > the >> > >> > reasons I tried to push Batik 1.7). But recently my second child was >> > born >> > and >> > there is some little chaos in my life with not much time for such tasks. >> > I still have SVN Patch yet it is already conflicting at some places with >> > new >> > code. >> > >> > What I managed to get was to create an SVG document containing map >> > >> > (all >> > the tiles, either from map or track tiles). It looked significantly >> > better than our >> > previous drawing mechanism. While it was much less and much simpler >> > code. >> > Also it scaled nicely. >> > >> > What the code was missing was: >> > (1) drawing station tokens, >> > (2) drawing train paths, >> > (3) handling scaling and scrolling well, >> > (4) support tile selection. >> > >> > First two would likely require some "hacking" as there is no easy >> > way >> > >> > currently to do it in SVG Document as there is not "specification" of >> > tracks >> > and stations on an SVG tile. But previous code did it somehow and I >> > guess >> > that solution could be used with SVG Document as well until (if ever) >> > SVG >> > tiles will receive better description. (That is a topic interesting on >> > its own...) >> >> The tracks and the token spot locations are also (somewhat cryptically) >> defined in Tiles.xml, and these definitions are currently used to draw the >> train paths and tokens. >> For the time being (or perhaps forever) that can be left as is, drawing >> these objects in the top layer of the JLayeredPane that I'm currently >> using. However, that would still require achieving correct alignment of >> the two layers after zooming. >> >> > I tries to handle third by using JSVGSrolledPane (or something >> > called >> > >> > similarly) but didn't achieve much. Then I had to interrupt my >> > investigations. >> >> I have also been thinking about JSVGScrolledPane, but I think using that >> will only become possible once we manage to do all drawing via JSVG. >> >> > Fourth should be easy as Batik provides some events to detect this. >> > I >> > >> > expect this could be even easier then current mouse handling. Borders >> > around selected or marked tiles could likely be achieved easily with CSS >> > in the >> > SVG Document. >> >> Sounds good. >> >> Erik. >> >> >> --------------------------------------------------------------------------- >> --- Simplify data backup and recovery for your virtual environment with >> vRanger. Installation's a snap, and flexible recovery options mean your >> data is safe, secure and there when you need it. Discover what all the >> cheering's about. Get your free trial download today. >> http://p.sf.net/sfu/quest-dev2dev2 >> _______________________________________________ >> Rails-devel mailing list >> Rai...@li... >> https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel > |