From: Erik V. <eri...@xs...> - 2011-06-06 12:44:12
|
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. |