>>>>> "FJ" == Frank Jakop <[EMAIL PROTECTED]> writes:

FJ> Thank you for answering,
>> It's not clear what you are looking for, I can think of three ways
>> to interpret the question:


FJ> I'll try to describe my problem: Ihave tu write an editor, which
FJ> should have the capability to place graphical elements inside its
FJ> window (e.g. a JPanel). The user should be given the possibility
FJ> to move the elements by dragging them. Each element(type) is
FJ> described in a separate SVG-file.  I thought that it was possible
FJ> to parse the files once at startup and keep the objects (such as
FJ> JSVGComponent) in memory, cloning them as often as needed (every
FJ> time the user inserts a specific graphics element) and display the
FJ> cloned objects on the canvas. 

    Ok this is essentially the third case (overlaying multiple SVG
documents in one SVG document).  I think the easiest way for you
to do this is still going to be the 'image' element.

    <image x=".." y=".." xlink:href="..."/>

    Just create a new image element when the user adds an object with
the xlink:href attr pointing at the SVGDocument.  Then to drag it
around you simply update the x&y attrs of the image.  In fact
essentially all of this could be done through java script.

    You would probably also want to look at things like the 'onclick',
'mousemove' etc events in the SVG DOM.  Which would make the
implementation even simpler as Batik would do all the hit detection
for you.

FJ> I tried the paintComponent(Graphics g) method on the
FJ> JSVGComponent, but it didn't work.  Do You have an idea, maybe I'm
FJ> completely wrong?

    It would be more efficent to work directly with GVT tree's (you
could share the GVT tree's between instances) but this would be a lot
more work.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to