You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Roger Martin <wa...@gmail.com> on 2008/07/19 17:03:28 UTC

dnd of svg's the user wants to open with Squiggle, patch

Hi,

I modified my working copy of batik's
~/batik/trunk/sources/org\apache/batik/apps/svgbrowser/JSVGViewerFrame.java
so a user can drag a svg document from any OS folder on to the
'LocationBar' and when
the user drops, the svg is opened.

I find this much faster than typing url's by hand or even going with a
file chooser.

If this patch is of interest please advise what alterations you'd
prefer such as the choice of drop location.  I did it with the
'LocationBar' as the drop target but this could be what you think
is most intuitive.

Haven't tested on a linux box yet but it is written using uri's so it
should be work.

Re: dnd of svg's the user wants to open with Squiggle, patch

Posted by Helder Magalhães <he...@gmail.com>.
> so a user can drag a svg document from any OS folder on to the
> 'LocationBar' and when
> the user drops, the svg is opened.

This sounds great! :-) I've also recently bumped into this Squiggle
limitation and thought that drag&drop support would be most
convenient. I had thought about using the whole document canvas as a
drop location but I believe using the location bar only (your
suggestion) makes the behavior a bit more self-contained and this
might be better: for example, the document canvas as drop location is
used, in some applications, to embed external content so it might
users may be confused (?) on what dropping over an existing document
will do.

I've checked requirements and dependencies seem to beavailable since
Java 1.2, so it seems aligned with current pre-requisites (apparently
1.4 as 1.3 support was recently dropped [2]). It would surely be a
simple and useful enhancement for Squiggle! ;-)

Finally, although I'm not familiar with "dnd" package, I'd suggest
using "DnDConstants.ACTION_LINK" [3] (or
"DnDConstants.ACTION_REFERENCE") instead of "DnDConstants.ACTION_COPY"
- in fact, it's what we'll be doing (open the dragged&dropped
document, not pasting its contents).

Regards,

 Helder Magalhães

[1] http://java.sun.com/j2se/1.4.2/docs/api/java/awt/dnd/package-summary.html
[2] http://svn.apache.org/viewvc?view=rev&revision=666001
[3] http://java.sun.com/j2se/1.4.2/docs/api/java/awt/dnd/DnDConstants.html

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