xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Age Bosma <agebo...@gmail.com>
Subject Drag group of elements and line end
Date Tue, 03 Mar 2009 16:10:24 GMT
Hi,

I've got a group of elements, lets say a car, on a JSVGCanvas. A
strait line should go from that group to a specific point, to indicate
its destination. The end point of the line is always the center of the
map. This line can be just one strait line for the time being but in
the future I'd like to make it possible to click on any position of
the line and drag that point to a different location to create
intermediate destination point. The latter, however, is a different
topic. There can also be more then one car on the map.
What I'd like to create is the possibility to drag the car to a
different position and by that, the start of the line has to move as
well. I'm a bit stuck on how to do this though.

Using Java would be the logical thing to do. This is because of the
updating of the properties dialog of the car. I.e. if I double click
on the car, a properties dialog should appear allowing you to change
the car settings and also the position of the car. Using JavaScript
for the dragging would only complicate this communication as far as I
can tell but correct me if I'm wrong.
The dragging of the group of elements should not be too hard. The
approach explained on XML.com [1] looks usable, the only thing I'd
have to add would be determining if a car is clicked or not. If yes,
start moving it. Or would a different approach be more appropriate?
What would be a sane approach to moving the line starting point?
Including the line or path element in the car group element would
cause the complete line to move along with the car, thus moving the
destination point.
Because of the future alterations I will have to use the path element.
There's also no way of knowing the end point, or first intermediate
point, in advance. Completely redrawing the path would therefor be not
an option IMHO, or it would at least be the difficult way of doing it.
Is there some way to 'attach' the line starting point with the group?
How can I determine and move just the line starting point?

I hope you can give me some advise on how to proceed.

Yours,

Age


[1] http://www.xml.com/pub/a/2002/02/27/drag.html

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


Mime
View raw message