xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lasse Riis <lr...@tnb.aau.dk>
Subject Structuring an application.
Date Mon, 14 Feb 2005 13:08:02 GMT
Hello

I'm about to write a GUI app that displays maps of a building, and draws 
a point, or circle that indicates a position. (The coordinates for this 
or these positions will be fetched from a network socket btw.)

I'd like some pointers on how to structure my app.

INTRO, (can be skipped)___________
To allow proper zooming of the map, the choice fell on SVG, and as the 
only proper toolkit-implementation of SVG (that I know of*) is Batik. So 
the choice fell on Java and Batik. However, being quite the newcomer to 
Java, and so also to Awt/Swing and Batik, this toolkit is very complex 
and hard to really grasp with the very scarce tutorial-material on the 
Batik-page.

FEATURES________________________
The app will have multiple maps; of multiple buildings, and of the 
multiple levels in these. Switching between maps should be rather fast, 
so maybe some sort of layering is required? (i.e. keeping pre-rendered 
images in memory and just swapping between displays of them as to avoid 
a time-comsuming render for each map-change)

Given a set of coordinates (that I will somehow have to match with that 
of the SVG-map) a dot or some form of indicator should appear on this 
map and thus visualize the position you're at. As the coordinates are 
updated the indicator should appear at (or be moved to) a new position. 
It's of no importance that this indicator is actually part of the 
SVG(-map). This is strictly a matter of visualization, so as long as 
it's on top of the map at the proper coordinates it's fine. So maybe 
some sort of layering is required here as well (with maybe a non-svg 
layer)? (to avoid re-rendering upon each indicator update) Also I might 
want to display several indicators on the same map, so some sort of text 
hovering next to the indicator would maybe be a requirement.
Also I'd like zooming to be an option, specifically using a JSlider, and 
thus allowing "real-time" zooms (zoom as you slide), and not 
slide-to-point-then-render.
When zoomed I'd like the map to be movable, but I guess that's just a 
matter of moving the already rendered image.

HOW?____________________________
Currently all I have is a small app that creates a JSVGCanvas and then 
calls setURI() on it to display an image, also there's a JSlider, that 
serves no purpose yet, because i can't figure out how to zoom the image. 
Reading through the javadoc I gather that the JSVGCanvas is not really 
all that easy to manipulate and I should do all this in some other way. 
But as I said, I'm very confused from all the classes and different 
approaches to this. So what I'm looking for is some tips as to how this 
could be done. Not actual code, just a general outline**, from someone 
who's familiar with Batik. This will give me a chance to read up on the 
right things in possibly the right order. Because atm. I'm just reading 
at random and not getting any wiser on this project. Also I'd like links 
to any sort of tutorial material, I haven't been able to find anything 
myself.



Hope this sort of request is allowed on this list.
Lasse Riis

* My investigation concluded this: GTK+ with librsvg would require me 
to  write the entire toolkit-to-SVG-to-toolkit logic myself, and Qt's 
current SVG impl. is really bad, and can't for example do antialiasing. 
(I could very well be wrong, maybe Batik is not the proper tool for this 
job?)

**Something like: "create a JSVGComponent, then use an updatemanager and 
then do", and so on....

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


Mime
View raw message