Greetings:
I'm new to Batik and naive in Java, though experienced in older languages and graphics environments. I have a student who is working to combine various technologies into a Java application--including SVG files and sketch recognition. The basic strategy is to load an externally generated SVG file which has associated style ID's with <g> elements, display this graphpic, allow the user to sketch marks on top of the SVG, categorize the sketch gesture, identify what was "under" the sketch, and then produce a folllow-up action. We're now at the point where we need to identify the element. We know where (in terms of the overlayed Java Graphics world) the centroid of the sketch was and want to query the SVG for the ID of the nearest element "under" this sketch.
I've read the parts of the FAQ that talk about doing an Overlay, and I read the (brand new!) Drag tutorial in the Wiki (which helps a lot), but it condenses the selection operation to a comment.
Any suggestions about strategy (are we thinking about this right?) or sources of tutorial code we should be looking at? The "getting started" text suggests we'll load the existing SVG into a JSVGCanvas (a DYNAMIC one!) and probably do our sketch-over in a regular Java Graphics overlay. It appears we'll need the SVG DOM to actually make a selection and recover the ID of the selection, but we're not clear how to get from a screen location to a unique SVG element. Do we need to walk the DOM ourselves and do a closest-point search? or is there a better way? Can we fabricate a mouseclick?
Apologies if the question seems fuzzy or ill-defined. That's probably a reflection of my newbie-ness.
- Brian Johnson, Dept of Architecture, University of Washington
Acting Director, Design Machine Group
http://dmg.caup.washington.edu--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
