Index: /applications/editors/josm/plugins/importvec/.classpath
===================================================================
--- /applications/editors/josm/plugins/importvec/.classpath	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/.classpath	(revision 23707)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /applications/editors/josm/plugins/importvec/.project
===================================================================
--- /applications/editors/josm/plugins/importvec/.project	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/.project	(revision 23707)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>importvec</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /applications/editors/josm/plugins/importvec/GPL-v2.0.txt
===================================================================
--- /applications/editors/josm/plugins/importvec/GPL-v2.0.txt	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/GPL-v2.0.txt	(revision 23707)
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Index: /applications/editors/josm/plugins/importvec/GPL-v3.0.txt
===================================================================
--- /applications/editors/josm/plugins/importvec/GPL-v3.0.txt	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/GPL-v3.0.txt	(revision 23707)
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: /applications/editors/josm/plugins/importvec/LICENSE
===================================================================
--- /applications/editors/josm/plugins/importvec/LICENSE	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/LICENSE	(revision 23707)
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Index: /applications/editors/josm/plugins/importvec/README
===================================================================
--- /applications/editors/josm/plugins/importvec/README	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/README	(revision 23707)
@@ -0,0 +1,10 @@
+README 
+======
+
+Readme for your plugin 
+
+    * Plugin author is Upliner <xvmv@mail.ru>
+
+    * The license for plugin is "GPL v2 or later".
+
+    * Plugin uses parts of SVG Salamander project https://svgsalamander.dev.java.net/
Index: /applications/editors/josm/plugins/importvec/build.xml
===================================================================
--- /applications/editors/josm/plugins/importvec/build.xml	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/build.xml	(revision 23707)
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+** This is a template build file for a JOSM  plugin.
+**
+** Maintaining versions
+** ====================
+** see README.template
+**
+** Usage
+** =====
+** To build it run
+**
+**    > ant  dist
+**
+** To install the generated plugin locally (in you default plugin directory) run
+**
+**    > ant  install
+**
+** The generated plugin jar is not automatically available in JOSMs plugin configuration
+** dialog. You have to check it in first.
+**
+** Use the ant target 'publish' to check in the plugin and make it available to other
+** JOSM users:
+**    set the properties commit.message and plugin.main.version
+** and run
+**    > ant  publish
+**
+**
+-->
+<project name="importvec" default="dist" basedir=".">
+
+    <!-- enter the SVN commit message -->
+    <property name="commit.message" value="Commit message" />
+    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
+    <property name="plugin.main.version" value="" />
+
+
+    <!--
+      ************************************************
+      ** should not be necessary to change the following properties
+     -->
+    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.src.dir"         value="src"/>
+    <!-- this is the directory where the plugin jar is copied to -->
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="ant.build.javac.target" value="1.5"/>
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
+
+    <!--
+    **********************************************************
+    ** init - initializes the build
+    **********************************************************
+    -->
+    <target name="init">
+        <mkdir dir="${plugin.build.dir}"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** compile - complies the source tree
+    **********************************************************
+    -->
+    <target name="compile" depends="init">
+        <echo message="compiling sources for  ${plugin.jar} ... "/>
+        <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:unchecked"/>
+        </javac>
+    </target>
+
+    <!--
+    **********************************************************
+    ** dist - creates the plugin jar
+    **********************************************************
+    -->
+    <target name="dist" depends="compile,revision">
+        <echo message="creating ${ant.project.name}.jar ... "/>
+        <copy todir="${plugin.build.dir}/resources">
+            <fileset dir="resources"/>
+        </copy>
+        <copy todir="${plugin.build.dir}/images">
+            <fileset dir="images"/>
+        </copy>
+        <copy todir="${plugin.build.dir}">
+            <fileset dir=".">
+                <include name="README" />
+                <include name="LICENSE" />
+            </fileset>
+        </copy>
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
+            <!--
+        ************************************************
+        ** configure these properties. Most of them will be copied to the plugins
+        ** manifest file. Property values will also show up in the list available
+        ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
+        **
+        ************************************************
+    -->
+            <manifest>
+                <attribute name="Author" value="Upliner"/>
+                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.importvec.ImportVecPlugin"/>
+                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
+                <attribute name="Plugin-Description" value="Import vector graphics (SVG)"/>
+                <attribute name="Plugin-Icon" value=""/>
+                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/ImportVec"/>
+                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
+                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
+            </manifest>
+        </jar>
+    </target>
+
+    <!--
+    **********************************************************
+    ** revision - extracts the current revision number for the
+    **    file build.number and stores it in the XML property
+    **    version.*
+    **********************************************************
+    -->
+    <target name="revision">
+
+        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="."/>
+        </exec>
+        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
+        <delete file="REVISION"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** clean - clean up the build environment
+    **********************************************************
+    -->
+    <target name="clean">
+        <delete dir="${plugin.build.dir}"/>
+        <delete file="${plugin.jar}"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** install - install the plugin in your local JOSM installation
+    **********************************************************
+    -->
+    <target name="install" depends="dist">
+        <property environment="env"/>
+        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
+            <and>
+                <os family="windows"/>
+            </and>
+        </condition>
+        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
+    </target>
+
+
+    <!--
+    ************************** Publishing the plugin *********************************** 
+    -->
+    <!--
+        ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
+        ** property ${coreversion.info.entry.revision}
+        **
+        -->
+    <target name="core-info">
+        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="../../core"/>
+        </exec>
+        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
+        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
+        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
+        <delete file="core.info.xml" />
+    </target>
+
+    <!--
+        ** commits the source tree for this plugin
+        -->
+    <target name="commit-current">
+        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="commit"/>
+            <arg value="-m '${commit.message}'"/>
+            <arg value="."/>
+        </exec>
+    </target>
+
+    <!--
+        ** updates (svn up) the source tree for this plugin
+        -->
+    <target name="update-current">
+        <echo>Updating plugin source ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="up"/>
+            <arg value="."/>
+        </exec>
+        <echo>Updating ${plugin.jar} ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="up"/>
+            <arg value="../dist/${plugin.jar}"/>
+        </exec>
+    </target>
+
+    <!--
+        ** commits the plugin.jar 
+        -->
+    <target name="commit-dist">
+        <echo>
+    ***** Properties of published ${plugin.jar} *****
+    Commit message    : '${commit.message}'                    
+    Plugin-Mainversion: ${plugin.main.version}
+    JOSM build version: ${coreversion.info.entry.revision}
+    Plugin-Version    : ${version.entry.commit.revision}
+    ***** / Properties of published ${plugin.jar} *****                    
+                        
+    Now commiting ${plugin.jar} ...
+    </echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="-m '${commit.message}'"/>
+            <arg value="commit"/>
+            <arg value="${plugin.jar}"/>
+        </exec>
+    </target>
+
+    <!-- ** make sure svn is present as a command line tool ** -->
+    <target name="ensure-svn-present">
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
+            <env key="LANG" value="C" />
+            <arg value="--version" />
+        </exec>
+        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
+            <!-- return code not set at all? Most likely svn isn't installed -->
+            <condition>
+                <not>
+                    <isset property="svn.exit.code" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
+            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
+            <condition>
+                <isfailure code="${svn.exit.code}" />
+            </condition>
+        </fail>
+    </target>
+
+    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
+    </target>
+</project>
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/A.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/A.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/A.java	(revision 23707)
@@ -0,0 +1,102 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.*;
+import java.net.URI;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class A extends Group {
+
+    URI href;
+    String title;
+
+    /** Creates a new instance of Stop */
+    public A() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String offset = attrs.getValue("offset");
+        this.offset = (float)XMLParseUtil.parseRatio(offset);
+
+        buildStop();
+    }
+    */
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("xlink:href")))
+        {
+            href = sty.getURIValue(getXMLBase());
+        }
+        
+        if (getPres(sty.setName("xlink:title")))
+        {
+            title = sty.getStringValue();
+        }
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        boolean changeState = super.updateTime(curTime);
+//        if (trackManager.getNumTracks() == 0) return false;
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("xlink:href")))
+        {
+            href = sty.getURIValue(getXMLBase());
+        }
+        
+        if (getPres(sty.setName("xlink:title")))
+        {
+            title = sty.getStringValue();
+        }
+        
+        return changeState;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Circle.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Circle.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Circle.java	(revision 23707)
@@ -0,0 +1,171 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Rectangle2D;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Circle extends ShapeElement 
+{
+
+    float cx = 0f;
+    float cy = 0f;
+    float r = 0f;
+
+
+    Ellipse2D.Float circle = new Ellipse2D.Float();
+
+    /** Creates a new instance of Rect */
+    public Circle() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String cx = attrs.getValue("cx");
+        String cy = attrs.getValue("cy");
+        String r = attrs.getValue("r");
+
+        this.cx = XMLParseUtil.parseFloat(cx);
+        this.cy = XMLParseUtil.parseFloat(cy);
+        this.r = XMLParseUtil.parseFloat(r);
+
+        build();
+        
+        //setBounds(this.cx - this.r, this.cy - this.r, this.r * 2.0, this.r * 2.0);
+    }
+*/
+    /*
+    public void loaderEndElement(SVGLoaderHelper helper)
+    {
+//        super.loaderEndElement(helper);
+
+//        build();
+    }
+     */
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("r"))) r = sty.getFloatValueWithUnits();
+        
+        circle.setFrame(cx - r, cy - r, r * 2f, r * 2f);
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, circle);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(circle);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(circle.getBounds2D()));
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("cx")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != cx)
+            {
+                cx = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("cy")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != cy)
+            {
+                cy = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("r")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != r)
+            {
+                r = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (shapeChange)
+        {
+            build();
+//            circle.setFrame(cx - r, cy - r, r * 2f, r * 2f);
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+    
+}
+
+
+
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Defs.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Defs.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Defs.java	(revision 23707)
@@ -0,0 +1,70 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.util.*;
+
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Defs extends TransformableElement
+{
+
+    /** Creates a new instance of Stop */
+    public Defs() {
+    }
+
+    /**
+     * Called after the start element but before the end element to indicate
+     * each child tag that has been processed
+     */
+    public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
+    {
+		super.loaderAddChild(helper, child);
+
+//        members.add(child);
+    }
+
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        boolean stateChange = false;
+        for (Iterator it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+            stateChange = stateChange || ele.updateTime(curTime);
+        }
+        
+        return super.updateTime(curTime) || stateChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Desc.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Desc.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Desc.java	(revision 23707)
@@ -0,0 +1,58 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 19, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+/**
+ * Holds title textual information within tree
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Desc extends SVGElement {
+
+    StringBuffer text = new StringBuffer();
+
+    /** Creates a new instance of Stop */
+    public Desc() {
+    }
+
+    /**
+     * Called during load process to add text scanned within a tag
+     */
+    public void loaderAddText(SVGLoaderHelper helper, String text)
+    {
+        this.text.append(text);
+    }
+
+    public String getText() { return text.toString(); }
+    
+    public boolean updateTime(double curTime)
+    {
+        return false;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Ellipse.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Ellipse.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Ellipse.java	(revision 23707)
@@ -0,0 +1,192 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+import java.awt.*;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Ellipse extends ShapeElement {
+
+    float cx = 0.0f;
+    float cy = 0.0f;
+    float rx = 0.0f;
+    float ry = 0.0f;
+
+    Ellipse2D.Float ellipse = new Ellipse2D.Float();
+
+    /** Creates a new instance of Rect */
+    public Ellipse() {
+    }
+/*
+    protected void init(String idIn, Style parentStyle, String cx, String cy, String rx, String ry) {
+        super.init(idIn, parentStyle);
+
+        this.cx = parseDouble(cx);
+        this.cy = parseDouble(cy);
+        this.rx = parseDouble(rx);
+        this.ry = parseDouble(ry);
+
+        setBounds(this.cx - this.rx, this.cy - this.ry, this.rx * 2.0, this.ry * 2.0);
+    }
+*/
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String cx = attrs.getValue("cx");
+        String cy = attrs.getValue("cy");
+        String rx = attrs.getValue("rx");
+        String ry = attrs.getValue("ry");
+
+        this.cx = XMLParseUtil.parseDouble(cx);
+        this.cy = XMLParseUtil.parseDouble(cy);
+        this.rx = XMLParseUtil.parseDouble(rx);
+        this.ry = XMLParseUtil.parseDouble(ry);
+
+        build();
+    }
+    */
+    
+    /*
+    public void loaderEndElement(SVGLoaderHelper helper)
+    {
+        super.loaderEndElement(helper);
+
+        build();
+    }
+     */
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("rx"))) rx = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("ry"))) ry = sty.getFloatValueWithUnits();
+        
+        ellipse.setFrame(cx - rx, cy - ry, rx * 2f, ry * 2f);
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, ellipse);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(ellipse);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(ellipse.getBounds2D()));
+    }
+    
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("cx")))
+        {
+            float newCx = sty.getFloatValueWithUnits();
+            if (newCx != cx)
+            {
+                cx = newCx;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("cy")))
+        {
+            float newCy = sty.getFloatValueWithUnits();
+            if (newCy != cy)
+            {
+                cy = newCy;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("rx")))
+        {
+            float newRx = sty.getFloatValueWithUnits();
+            if (newRx != rx)
+            {
+                rx = newRx;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("ry")))
+        {
+            float newRy = sty.getFloatValueWithUnits();
+            if (newRy != ry)
+            {
+                ry = newRy;
+                shapeChange = true;
+            }
+        }
+        
+        if (shapeChange)
+        {
+            build();
+//            ellipse.setFrame(cx - rx, cy - ry, rx * 2f, ry * 2f);
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Group.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Group.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Group.java	(revision 23707)
@@ -0,0 +1,301 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.Iterator;
+import java.util.List;
+
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Group extends ShapeElement
+{
+
+    //Cache bounding box for faster clip testing
+    Rectangle2D boundingBox;
+    Shape cachedShape;
+
+    //Cache clip bounds
+    final Rectangle clipBounds = new Rectangle();
+
+    /** Creates a new instance of Stop */
+    public Group() {
+    }
+
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+        //Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        //String transform = attrs.getValue("transform");
+    }
+     */
+
+    /**
+     * Called after the start element but before the end element to indicate
+     * each child tag that has been processed
+     */
+    public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
+    {
+        super.loaderAddChild(helper, child);
+
+//        members.add(child);
+    }
+
+    protected boolean outsideClip(Graphics2D g) throws SVGException
+    {
+        g.getClipBounds(clipBounds);
+        Rectangle2D rect = getBoundingBox();
+
+//if (rect == null)
+//{
+//    rect = getBoundingBox();
+//}
+
+//        if (rect.intersects(clipBounds))
+        if (rect.intersects(clipBounds))
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException
+    {
+        Point2D xPoint = new Point2D.Double(point.getX(), point.getY());
+        if (xform != null)
+        {
+            try
+            {
+                xform.inverseTransform(point, xPoint);
+            } 
+            catch (NoninvertibleTransformException ex)
+            {
+                throw new SVGException(ex);
+            }
+        }
+        
+        
+        for (Iterator it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement)ele;
+                
+                rendEle.pick(xPoint, boundingBox, retVec);
+            }
+        }
+    }
+
+    void pick(Rectangle2D pickArea, AffineTransform ltw, boolean boundingBox, List retVec) throws SVGException
+    {
+        if (xform != null)
+        {
+            ltw = new AffineTransform(ltw);
+            ltw.concatenate(xform);
+        }
+        
+        
+        for (Iterator it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement)ele;
+                
+                rendEle.pick(pickArea, ltw, boundingBox, retVec);
+            }
+        }
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        //Don't process if not visible
+        StyleAttribute styleAttrib = new StyleAttribute();
+        if (getStyle(styleAttrib.setName("visibility")))
+        {
+            if (!styleAttrib.getStringValue().equals("visible")) return;
+        }
+        
+        //Do not process offscreen groups
+        boolean ignoreClip = diagram.ignoringClipHeuristic();
+        if (!ignoreClip && outsideClip(g)) return;
+
+        beginLayer(g);
+
+        Iterator it = children.iterator();
+
+        try
+        {
+            g.getClipBounds(clipBounds);
+        }
+        catch (Exception e)
+        {
+            //For some reason, getClipBounds can throw a null pointer exception for 
+            // some types of Graphics2D
+            ignoreClip = true;
+        }
+
+        while (it.hasNext())
+        {
+            SVGElement ele = (SVGElement)it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement)ele;
+
+//                if (shapeEle == null) continue;
+
+                if (!(ele instanceof Group))
+                {
+                    //Skip if clipping area is outside our bounds
+                    if (!ignoreClip && !rendEle.getBoundingBox().intersects(clipBounds)) 
+                    {
+                        continue;
+                    }
+                }
+
+                rendEle.render(g);
+            }
+        }
+
+        finishLayer(g);
+    }
+
+
+    /**
+     * Retrieves the cached bounding box of this group
+     */
+    public Shape getShape()
+    {
+        if (cachedShape == null) calcShape();
+        return cachedShape;
+    }
+
+    public void calcShape()
+    {
+        Area retShape = new Area();
+
+        for (Iterator it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+
+            if (ele instanceof ShapeElement)
+            {
+                ShapeElement shpEle = (ShapeElement)ele;
+                Shape shape = shpEle.getShape();
+                if (shape != null)
+                {
+                    retShape.add(new Area(shape));
+                }
+            }
+        }
+
+        cachedShape = shapeToParent(retShape);
+    }
+
+    /**
+     * Retrieves the cached bounding box of this group
+     */
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        if (boundingBox == null) calcBoundingBox();
+//        calcBoundingBox();
+        return boundingBox;
+    }
+
+    /**
+     * Recalculates the bounding box by taking the union of the bounding boxes
+     * of all children.  Caches the result.
+     */
+    public void calcBoundingBox() throws SVGException
+    {
+//        Rectangle2D retRect = new Rectangle2D.Float();
+        Rectangle2D retRect = null;
+
+        for (Iterator it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement)ele;
+                Rectangle2D bounds = rendEle.getBoundingBox();
+                if (bounds != null)
+                {
+                    if (retRect == null) retRect = bounds;
+                    else retRect = retRect.createUnion(bounds);
+                }
+            }
+        }
+
+//        if (xform != null)
+//        {
+//            retRect = xform.createTransformedShape(retRect).getBounds2D();
+//        }
+
+        //If no contents, use degenerate rectangle
+        if (retRect == null) retRect = new Rectangle2D.Float();
+
+        boundingBox = boundsToParent(retRect);
+    }
+
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        boolean changeState = super.updateTime(curTime);
+        Iterator it = children.iterator();
+
+        //Distribute message to all members of this group
+        while (it.hasNext())
+        {
+            SVGElement ele = (SVGElement)it.next();
+            boolean updateVal = ele.updateTime(curTime);
+
+            changeState = changeState || updateVal;
+
+            //Update our shape if shape aware children change
+            if (ele instanceof ShapeElement) cachedShape = null;
+            if (ele instanceof RenderableElement) boundingBox = null;
+        }
+
+        return changeState;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Line.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Line.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Line.java	(revision 23707)
@@ -0,0 +1,172 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Line2D;
+import java.awt.geom.Rectangle2D;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Line extends ShapeElement {
+
+    float x1 = 0f;
+    float y1 = 0f;
+    float x2 = 0f;
+    float y2 = 0f;
+
+    Line2D.Float line;
+//    RectangularShape rect;
+
+    /** Creates a new instance of Rect */
+    public Line() {
+    }
+
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String x1 = attrs.getValue("x1");
+        String y1 = attrs.getValue("y1");
+        String x2 = attrs.getValue("x2");
+        String y2 = attrs.getValue("y2");
+
+        this.x1 = XMLParseUtil.parseFloat(x1);
+        this.y1 = XMLParseUtil.parseFloat(y1);
+        this.x2 = XMLParseUtil.parseFloat(x2);
+        this.y2 = XMLParseUtil.parseFloat(y2);
+
+        build();
+    }
+*/
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("x1"))) x1 = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("y1"))) y1 = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("x2"))) x2 = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("y2"))) y2 = sty.getFloatValueWithUnits();
+
+        line = new Line2D.Float(x1, y1, x2, y2);
+    }
+    
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, line);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(line);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(line.getBounds2D()));
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("x1")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != x1)
+            {
+                x1 = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y1")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != y1)
+            {
+                y1 = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("x2")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != x2)
+            {
+                x2 = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y2")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != y2)
+            {
+                y2 = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (shapeChange)
+        {
+            build();
+//            line = new Line2D.Float(x1, y1, x2, y2);
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Metadata.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Metadata.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Metadata.java	(revision 23707)
@@ -0,0 +1,46 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 19, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+/**
+ * Does not hold any information.  Included to allow metadata tag to be parsed.
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Metadata extends SVGElement 
+{
+    /** Creates a new instance of Stop */
+    public Metadata() {
+    }
+
+    public boolean updateTime(double curTime)
+    {
+        return false;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Path.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Path.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Path.java	(revision 23707)
@@ -0,0 +1,154 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.*;
+import java.awt.geom.*;
+
+import com.kitfox.svg.pathcmd.*;
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Path extends ShapeElement {
+
+//    PathCommand[] commands = null;
+
+    int fillRule = GeneralPath.WIND_NON_ZERO;
+    String d = "";
+//    ExtendedGeneralPath path;
+    GeneralPath path;
+
+    /** Creates a new instance of Rect */
+    public Path() {
+    }
+
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        StyleAttribute styleAttrib = getStyle("fill-rule");
+        String fillRule = (styleAttrib == null) ? "nonzero" : styleAttrib.getStringValue();
+        
+        String d = attrs.getValue("d");
+        path = buildPath(d, fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO);
+    }
+    */
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+    
+        String fillRuleStrn  = (getStyle(sty.setName("fill-rule"))) ? sty.getStringValue() : "nonzero";
+        fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
+        
+//        String d = "";
+        if (getPres(sty.setName("d"))) d = sty.getStringValue();
+
+//System.err.println(d);
+        
+        path = buildPath(d, fillRule);
+        
+//System.err.println(d);
+    }
+    
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, path);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(path);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(path.getBounds2D()));
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getStyle(sty.setName("fill-rule")))
+        {
+            int newVal = sty.getStringValue().equals("evenodd") 
+                ? GeneralPath.WIND_EVEN_ODD 
+                : GeneralPath.WIND_NON_ZERO;
+            if (newVal != fillRule)
+            {
+                fillRule = newVal;
+                changeState = true;
+            }
+        }
+        
+        if (getPres(sty.setName("d")))
+        {
+            String newVal = sty.getStringValue();
+            if (!newVal.equals(d))
+            {
+                d = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (shapeChange)
+        {
+            build();
+//            path = buildPath(d, fillRule);
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polygon.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polygon.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polygon.java	(revision 23707)
@@ -0,0 +1,178 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.XMLParseUtil;
+import java.awt.geom.*;
+import java.awt.*;
+
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Polygon extends ShapeElement {
+
+    int fillRule = GeneralPath.WIND_NON_ZERO;
+    String pointsStrn = "";
+//    float[] points = null;
+    GeneralPath path;
+
+    /** Creates a new instance of Rect */
+    public Polygon() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+
+        points = XMLParseUtil.parseFloatList(attrs.getValue("points"));
+
+        build();
+    }
+*/
+/*
+    public void build()
+    {
+        StyleAttribute styleAttrib = getStyle("fill-rule");
+        String fillRule = (styleAttrib == null) ? "nonzero" : styleAttrib.getStringValue();
+
+        path = new GeneralPath(
+            fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO,
+            points.length / 2);
+
+        path.moveTo(points[0], points[1]);
+        for (int i = 2; i < points.length; i += 2)
+        {
+            path.lineTo(points[i], points[i + 1]);
+        }
+        path.closePath();
+    }
+*/
+    
+//static int yyyyy = 0;
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("points"))) pointsStrn = sty.getStringValue();
+        
+        String fillRuleStrn = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
+        fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
+
+        buildPath();
+    }
+    
+    protected void buildPath()
+    {
+        float[] points = XMLParseUtil.parseFloatList(pointsStrn);
+        path = new GeneralPath(fillRule, points.length / 2);
+
+        path.moveTo(points[0], points[1]);
+        for (int i = 2; i < points.length; i += 2)
+        {
+            path.lineTo(points[i], points[i + 1]);
+        }
+        path.closePath();
+    }
+    
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, path);
+        finishLayer(g);
+    }
+
+
+    public Shape getShape()
+    {
+        return shapeToParent(path);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(path.getBounds2D()));
+    }
+
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getStyle(sty.setName("fill-rule")))
+        {
+            int newVal = sty.getStringValue().equals("evenodd") 
+                ? GeneralPath.WIND_EVEN_ODD 
+                : GeneralPath.WIND_NON_ZERO;
+            if (newVal != fillRule)
+            {
+                fillRule = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("points")))
+        {
+            String newVal = sty.getStringValue();
+            if (!newVal.equals(pointsStrn))
+            {
+                pointsStrn = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        
+        if (shapeChange)
+        {
+            build();
+//            buildPath();
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polyline.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polyline.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Polyline.java	(revision 23707)
@@ -0,0 +1,153 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import java.awt.geom.*;
+import java.awt.*;
+
+import com.kitfox.svg.xml.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Polyline extends ShapeElement {
+
+    int fillRule = GeneralPath.WIND_NON_ZERO;
+    String pointsStrn = "";
+//    float[] points = null;
+    GeneralPath path;
+
+    /** Creates a new instance of Rect */
+    public Polyline() {
+    }
+
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+
+        points = XMLParseUtil.parseFloatList(attrs.getValue("points"));
+
+        build();
+    }
+    */
+
+    public void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("points"))) pointsStrn = sty.getStringValue();
+        
+        String fillRuleStrn = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
+        fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
+
+        buildPath();
+    }
+    
+    protected void buildPath()
+    {
+        float[] points = XMLParseUtil.parseFloatList(pointsStrn);
+        path = new GeneralPath(fillRule, points.length / 2);
+
+        path.moveTo(points[0], points[1]);
+        for (int i = 2; i < points.length; i += 2)
+        {
+            path.lineTo(points[i], points[i + 1]);
+        }
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, path);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(path);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(path.getBounds2D()));
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getStyle(sty.setName("fill-rule")))
+        {
+            int newVal = sty.getStringValue().equals("evenodd") 
+                ? GeneralPath.WIND_EVEN_ODD 
+                : GeneralPath.WIND_NON_ZERO;
+            if (newVal != fillRule)
+            {
+                fillRule = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("points")))
+        {
+            String newVal = sty.getStringValue();
+            if (!newVal.equals(pointsStrn))
+            {
+                pointsStrn = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        
+        if (shapeChange)
+        {
+            build();
+//            buildPath();
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Rect.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Rect.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Rect.java	(revision 23707)
@@ -0,0 +1,268 @@
+/*
+ * Rect.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:25 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Rect extends ShapeElement {
+
+    float x = 0f;
+    float y = 0f;
+    float width = 0f;
+    float height = 0f;
+    float rx = 0f;
+    float ry = 0f;
+
+    RectangularShape rect;
+
+    /** Creates a new instance of Rect */
+    public Rect() {
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException    
+    {
+        out.writeFloat(x);
+        out.writeFloat(y);
+        out.writeFloat(width);
+        out.writeFloat(height);
+        out.writeFloat(rx);
+        out.writeFloat(ry);
+    }
+    
+    private void readObject(ObjectInputStream in) throws IOException
+    {
+        x = in.readFloat();
+        y = in.readFloat();
+        width = in.readFloat();
+        height = in.readFloat();
+        rx = in.readFloat();
+        ry = in.readFloat();
+        
+        if (rx == 0f && ry == 0f)
+        {
+            rect = new Rectangle2D.Float(x, y, width, height);
+        }
+        else
+        {
+            rect = new RoundRectangle2D.Float(x, y, width, height, rx * 2, ry * 2);
+        }
+    }
+    
+    /*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String x = attrs.getValue("x");
+        String y = attrs.getValue("y");
+        String width = attrs.getValue("width");
+        String height = attrs.getValue("height");
+        String rx = attrs.getValue("rx");
+        String ry = attrs.getValue("ry");
+
+        if (rx == null) rx = ry;
+        if (ry == null) ry = rx;
+
+        this.x = XMLParseUtil.parseFloat(x);
+        this.y = XMLParseUtil.parseFloat(y);
+        this.width = XMLParseUtil.parseFloat(width);
+        this.height = XMLParseUtil.parseFloat(height);
+        if (rx != null)
+        {
+            this.rx = XMLParseUtil.parseFloat(rx);
+            this.ry = XMLParseUtil.parseFloat(ry);
+        }
+
+        build();
+//        setBounds(this.x, this.y, this.width, this.height);
+    }
+*/
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+//        SVGElement parent = this.getParent();
+//        if (parent instanceof RenderableElement)
+//        {
+//            RenderableElement re = (RenderableElement)parent;
+//            Rectangle2D bounds = re.getBoundingBox();
+//            bounds = null;
+//        }
+        
+        
+        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
+        
+        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
+
+        boolean rxSet = false;
+        if (getPres(sty.setName("rx"))) { rx = sty.getFloatValueWithUnits(); rxSet = true; }
+        
+        boolean rySet = false;
+        if (getPres(sty.setName("ry"))) { ry = sty.getFloatValueWithUnits(); rySet = true; }
+        
+        if (!rxSet) rx = ry;
+        if (!rySet) ry = rx;
+
+        
+        if (rx == 0f && ry == 0f)
+        {
+            rect = new Rectangle2D.Float(x, y, width, height);
+        }
+        else
+        {
+            rect = new RoundRectangle2D.Float(x, y, width, height, rx * 2, ry * 2);
+        }
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+        renderShape(g, rect);
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        return shapeToParent(rect);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        return boundsToParent(includeStrokeInBounds(rect.getBounds2D()));
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("x")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != x)
+            {
+                x = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != y)
+            {
+                y = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != width)
+            {
+                width = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != height)
+            {
+                height = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("rx")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != rx)
+            {
+                rx = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("ry")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != ry)
+            {
+                ry = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (shapeChange)
+        {
+            build();
+//            if (rx == 0f && ry == 0f)
+//            {
+//                rect = new Rectangle2D.Float(x, y, width, height);
+//            }
+//            else
+//            {
+//                rect = new RoundRectangle2D.Float(x, y, width, height, rx * 2, ry * 2);
+//            }
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/RenderableElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/RenderableElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/RenderableElement.java	(revision 23707)
@@ -0,0 +1,167 @@
+/*
+ * BoundedElement.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 9:00 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Area;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.net.URI;
+import java.util.List;
+
+
+
+/**
+ * Maintains bounding box for this element
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+abstract public class RenderableElement extends TransformableElement 
+{
+
+    AffineTransform cachedXform = null;
+    Shape cachedClip = null;
+    
+    public static final int VECTOR_EFFECT_NONE = 0;
+    public static final int VECTOR_EFFECT_NON_SCALING_STROKE = 1;
+    int vectorEffect;
+
+    /** Creates a new instance of BoundedElement */
+    public RenderableElement() {
+    }
+
+    public RenderableElement(String id, SVGElement parent)
+    {
+        super(id, parent);
+    }
+
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("vector-effect")))
+        {
+            if ("non-scaling-stroke".equals(sty.getStringValue()))
+            {
+                vectorEffect = VECTOR_EFFECT_NON_SCALING_STROKE;
+            }
+            else
+            {
+                vectorEffect = VECTOR_EFFECT_NONE;
+            }
+        }
+        else
+        {
+            vectorEffect = VECTOR_EFFECT_NONE;
+        }
+    }
+    
+    abstract public void render(Graphics2D g) throws SVGException;
+    
+    abstract void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException;
+    
+    abstract void pick(Rectangle2D pickArea, AffineTransform ltw, boolean boundingBox, List retVec) throws SVGException;
+    
+    abstract public Rectangle2D getBoundingBox() throws SVGException;
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+        super.loaderStartElement(helper, attrs, parent);
+    }
+*/
+    /**
+     * Pushes transform stack, transforms to local coordinates and sets up
+     * clipping mask.
+     */
+    protected void beginLayer(Graphics2D g) throws SVGException
+    {
+        if (xform != null)
+        {
+            cachedXform = g.getTransform();
+            g.transform(xform);
+        }
+
+        StyleAttribute styleAttrib = new StyleAttribute();
+        
+        //Get clipping path
+//        StyleAttribute styleAttrib = getStyle("clip-path", false);
+        Shape clipPath = null;
+        /*int clipPathUnits = ClipPath.CP_USER_SPACE_ON_USE;
+        if (getStyle(styleAttrib.setName("clip-path")))
+        {
+            URI uri = styleAttrib.getURIValue(getXMLBase());
+            if (uri != null)
+            {
+                ClipPath ele = (ClipPath)diagram.getRoot().ge.getUniverse().getElement(uri);
+                clipPath = ele.getClipPathShape();
+                clipPathUnits = ele.getClipPathUnits();
+            }
+        }
+
+        //Return if we're out of clipping range
+        if (clipPath != null)
+        {
+            if (clipPathUnits == ClipPath.CP_OBJECT_BOUNDING_BOX && (this instanceof ShapeElement))
+            {
+                Rectangle2D rect = ((ShapeElement)this).getBoundingBox();
+                AffineTransform at = new AffineTransform();
+                at.scale(rect.getWidth(), rect.getHeight());
+                clipPath = at.createTransformedShape(clipPath);
+            }
+
+            cachedClip = g.getClip();
+            Area newClip = new Area(cachedClip);
+            newClip.intersect(new Area(clipPath));
+            g.setClip(newClip);
+        }*/
+    }
+
+    /**
+     * Restores transform and clipping values to the way they were before
+     * this layer was drawn.
+     */
+    protected void finishLayer(Graphics2D g)
+    {
+        if (cachedClip != null)
+        {
+            g.setClip(cachedClip);
+        }
+
+        if (cachedXform != null)
+        {
+            g.setTransform(cachedXform);
+        }
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDiagram.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDiagram.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDiagram.java	(revision 23707)
@@ -0,0 +1,227 @@
+/*
+ * SVGDiagram.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 5:04 PM
+ */
+
+package com.kitfox.svg;
+
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.Serializable;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+
+/**
+ * Top level structure in an SVG tree.
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class SVGDiagram implements Serializable
+{
+    public static final long serialVersionUID = 0;
+    
+    //Indexes elements within this SVG diagram
+    final HashMap<String,SVGElement> idMap = new HashMap<String,SVGElement>();
+
+    SVGRoot root;
+
+    /**
+     * This is used by the SVGRoot to determine the width of the 
+     */
+    private Rectangle deviceViewport = new Rectangle(100, 100);
+
+    /**
+     * If true, no attempt will be made to discard geometry based on it being
+     * out of bounds.  This trades potentially drawing many out of bounds
+     * shapes with having to recalculate bounding boxes every animation iteration.
+     */
+    protected boolean ignoreClipHeuristic = false;
+
+    /**
+     * URI that uniquely identifies this document.  Also used to resolve
+     * relative urls.  Default base for document.
+     */
+    final URI xmlBase;
+
+    /** Creates a new instance of SVGDiagram */
+    public SVGDiagram(URI xmlBase)
+    {
+        this.xmlBase = xmlBase;
+    }
+
+    /**
+     * Draws this diagram to the passed graphics context
+     */
+    public void render(Graphics2D g) throws SVGException
+    {
+        root.render(g);
+    }
+    
+    /**
+     * Searches thorough the scene graph for all RenderableElements that have
+     * shapes that contain the passed point.
+     * 
+     * For every shape which contains the pick point, a List containing the
+     * path to the node is added to the return list.  That is, the result of
+     * SVGElement.getPath() is added for each entry.
+     *
+     * @return the passed in list
+     */
+    public List pick(Point2D point, List retVec) throws SVGException
+    {
+        return pick(point, false, retVec);
+    }
+    
+    public List pick(Point2D point, boolean boundingBox, List retVec) throws SVGException
+    {
+        if (retVec == null)
+        {
+            retVec = new ArrayList();
+        }
+        
+        root.pick(point, boundingBox, retVec);
+        
+        return retVec;
+    }
+
+    public List pick(Rectangle2D pickArea, List retVec) throws SVGException
+    {
+        return pick(pickArea, false, retVec);
+    }
+    
+    public List pick(Rectangle2D pickArea, boolean boundingBox, List retVec) throws SVGException
+    {
+        if (retVec == null)
+        {
+            retVec = new ArrayList();
+        }
+        
+        root.pick(pickArea, new AffineTransform(), boundingBox, retVec);
+        
+        return retVec;
+    }
+
+    public URI getXMLBase()
+    {
+        return xmlBase;
+    }
+
+    public float getWidth()
+    {
+        if (root == null) return 0;
+        return root.getDeviceWidth();
+    }
+    
+    public float getHeight()
+    {
+        if (root == null) return 0;
+        return root.getDeviceHeight();
+    }
+    
+    /**
+     * Returns the viewing rectangle of this diagram in device coordinates.
+     */
+    public Rectangle2D getViewRect(Rectangle2D rect)
+    {
+        if (root != null) return root.getDeviceRect(rect);
+        return rect;
+    }
+
+    public Rectangle2D getViewRect()
+    {
+        return getViewRect(new Rectangle2D.Double());
+    }
+
+    public SVGElement getElement(String name)
+    {
+        return (SVGElement)idMap.get(name);
+    }
+
+    public void setElement(String name, SVGElement node)
+    {
+        idMap.put(name, node);
+    }
+
+    public void removeElement(String name)
+    {
+        idMap.remove(name);
+    }
+
+    public SVGRoot getRoot()
+    {
+        return root;
+    }
+
+    public void setRoot(SVGRoot root)
+    {
+        this.root = root;
+    }
+
+    public boolean ignoringClipHeuristic() { return ignoreClipHeuristic; }
+
+    public void setIgnoringClipHeuristic(boolean ignoreClipHeuristic) { this.ignoreClipHeuristic = ignoreClipHeuristic; }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     */
+    public void updateTime(double curTime) throws SVGException
+    {
+        if (root == null) return;
+        root.updateTime(curTime);
+    }
+
+    public Rectangle getDeviceViewport()
+    {
+        return deviceViewport;
+    }
+
+    /**
+     * Sets the dimensions of the device being rendered into.  This is used by
+     * SVGRoot when its x, y, width or height parameters are specified as
+     * percentages.
+     */
+    public void setDeviceViewport(Rectangle deviceViewport)
+    {
+        this.deviceViewport.setBounds(deviceViewport);
+        if (root != null)
+        {
+            try
+            {
+                root.build();
+            } catch (SVGException ex)
+            {
+                ex.printStackTrace();
+            }
+        }
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.form
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.form	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.form	(revision 23707)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <Events>
+    <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentResized"/>
+  </Events>
+  <AuxValues>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
+  </AuxValues>
+
+  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+</Form>
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGDisplayPanel.java	(revision 23707)
@@ -0,0 +1,195 @@
+/*
+ * SVGDisplayPanel.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 20, 2004, 12:29 PM
+ */
+
+package com.kitfox.svg;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class SVGDisplayPanel extends javax.swing.JPanel implements Scrollable
+{
+    public static final long serialVersionUID = 1;
+    
+    SVGDiagram diagram = null;
+    float scale = 1f;
+    Color bgColor = null;
+
+    /** Creates new form SVGDisplayPanel */
+    public SVGDisplayPanel()
+    {
+        initComponents();
+    }
+
+    public SVGDiagram getDiagram()
+    {
+        return diagram;
+    }
+    
+    public void setDiagram(SVGDiagram diagram)
+    {
+        this.diagram = diagram;
+        diagram.setDeviceViewport(getBounds());
+        
+        setDimension();
+    }
+
+    public void setScale(float scale)
+    {
+        this.scale = scale;
+        setDimension();
+    }
+
+    public void setBgColor(Color col)
+    {
+        bgColor = col;
+    }
+
+    private void setDimension()
+    {
+        if (diagram == null)
+        {
+            setPreferredSize(new Dimension(1, 1));
+            revalidate();
+            return;
+        }
+
+        final Rectangle2D.Float rect = new Rectangle2D.Float();
+        diagram.getViewRect(rect);
+
+        int w = (int)(rect.width * scale);
+        int h = (int)(rect.height * scale);
+
+        setPreferredSize(new Dimension(w, h));
+        revalidate();
+    }
+
+    /**
+     * Update this image to reflect the passed time
+     */
+    public void updateTime(double curTime) throws SVGException
+    {
+        if (diagram == null) return;
+        
+        diagram.updateTime(curTime);
+    }
+    
+    public void paintComponent(Graphics gg)
+    {
+        Graphics2D g = (Graphics2D)gg;
+
+        if (bgColor != null)
+        {
+            Dimension dim = getSize();
+            g.setColor(bgColor);
+            g.fillRect(0, 0, dim.width, dim.height);
+        }
+
+        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+        if (diagram != null) 
+        {
+            try
+            {
+                diagram.render(g);
+            }
+            catch (SVGException e)
+            {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
+    private void initComponents()
+    {
+
+        setLayout(new java.awt.BorderLayout());
+
+        addComponentListener(new java.awt.event.ComponentAdapter()
+        {
+            public void componentResized(java.awt.event.ComponentEvent evt)
+            {
+                formComponentResized(evt);
+            }
+        });
+
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void formComponentResized(java.awt.event.ComponentEvent evt)//GEN-FIRST:event_formComponentResized
+    {//GEN-HEADEREND:event_formComponentResized
+        if (diagram != null)
+        {
+            diagram.setDeviceViewport(getBounds());
+            setDimension();
+        }
+
+    }//GEN-LAST:event_formComponentResized
+
+    public Dimension getPreferredScrollableViewportSize()
+    {
+        return getPreferredSize();
+    }
+
+    public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
+    {
+        if (orientation == SwingConstants.HORIZONTAL)
+        {
+            return visibleRect.width;
+        }
+        else return visibleRect.height;
+    }
+
+    public boolean getScrollableTracksViewportHeight()
+    {
+        return false;
+    }
+
+    public boolean getScrollableTracksViewportWidth()
+    {
+        return false;
+    }
+
+    public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
+    {
+        return getScrollableBlockIncrement(visibleRect, orientation, direction) / 16;
+    }
+
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    // End of variables declaration//GEN-END:variables
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElement.java	(revision 23707)
@@ -0,0 +1,744 @@
+/*
+ * SVGElement.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:59 AM
+ * Modified on October 19, 2010 by Upliner
+ */
+
+package com.kitfox.svg;
+
+import java.util.*;
+import java.util.regex.*;
+import java.net.*;
+import java.awt.geom.*;
+
+import org.xml.sax.*;
+
+import com.kitfox.svg.pathcmd.Arc;
+import com.kitfox.svg.pathcmd.BuildHistory;
+import com.kitfox.svg.pathcmd.Cubic;
+import com.kitfox.svg.pathcmd.CubicSmooth;
+import com.kitfox.svg.pathcmd.Horizontal;
+import com.kitfox.svg.pathcmd.LineTo;
+import com.kitfox.svg.pathcmd.MoveTo;
+import com.kitfox.svg.pathcmd.PathCommand;
+import com.kitfox.svg.pathcmd.Quadratic;
+import com.kitfox.svg.pathcmd.QuadraticSmooth;
+import com.kitfox.svg.pathcmd.Terminal;
+import com.kitfox.svg.pathcmd.Vertical;
+import com.kitfox.svg.xml.*;
+
+import java.io.Serializable;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+abstract public class SVGElement implements Serializable
+{
+    public static final long serialVersionUID = 0;
+    
+    public static final String SVG_NS = "http://www.w3.org/2000/svg";
+    
+    protected SVGElement parent = null;
+    
+    protected final ArrayList<SVGElement> children = new ArrayList<SVGElement>();
+    
+    protected String id = null;
+    /**
+     * CSS class.  Used for applying style sheet information.
+     */
+    protected String cssClass = null;
+    
+    /**
+     * Styles defined for this elemnt via the <b>style</b> attribute.
+     */
+    protected final HashMap<String,StyleAttribute> inlineStyles = new HashMap<String,StyleAttribute>();
+    
+    /**
+     * Presentation attributes set for this element.  Ie, any attribute other
+     * than the <b>style</b> attribute.
+     */
+    protected final HashMap<String,StyleAttribute> presAttribs = new HashMap<String,StyleAttribute>();
+    
+    /**
+     * A list of presentation attributes to not include in the presentation
+     * attribute set.
+     */
+    protected static final Set<String> ignorePresAttrib;
+    static
+    {
+        HashSet<String> set = new HashSet<String>();
+//        set.add("id");
+//        set.add("class");
+//        set.add("style");
+//        set.add("xml:base");
+        
+        ignorePresAttrib = Collections.unmodifiableSet(set);
+    }
+    
+    /**
+     * This element may override the URI we resolve against with an
+     * xml:base attribute.  If so, a copy is placed here.  Otherwise, we defer
+     * to our parent for the reolution base
+     */
+    protected URI xmlBase = null;
+    
+    /**
+     * The diagram this element belongs to
+     */
+    protected SVGDiagram diagram;
+
+    boolean dirty = true;
+
+//    public static final Matcher adobeId = Pattern.compile("(.*)_1_").matcher("");
+//    static final String fpNumRe = "[-+]?((\\d+)|(\\d*\\.\\d+))([-+]?[eE]\\d+)?";
+    
+    /** Creates a new instance of SVGElement */
+    public SVGElement()
+    {
+        this(null, null, null);
+    }
+    
+    public SVGElement(String id, SVGElement parent)
+    {
+        this(id, null, parent);
+    }
+    
+    public SVGElement(String id, String cssClass, SVGElement parent)
+    {
+        this.id = id;
+        this.cssClass = cssClass;
+        this.parent = parent;
+    }
+    
+    public SVGElement getParent()
+    {
+        return parent;
+    }
+    
+    void setParent(SVGElement parent)
+    {
+        this.parent = parent;
+    }
+    
+    /**
+     * @return an ordered list of nodes from the root of the tree to this node
+     */
+    public List<SVGElement> getPath(List<SVGElement> retVec)
+    {
+        if (retVec == null) retVec = new ArrayList<SVGElement>();
+        
+        if (parent != null)
+        {
+            parent.getPath(retVec);
+        }
+        retVec.add(this);
+        
+        return retVec;
+    }
+    
+    /**
+     * @param retVec - A list to add all children to.  If null, a new list is
+     * created and children of this group are added.
+     *
+     * @return The list containing the children of this group
+     */
+    public List<SVGElement> getChildren(List<SVGElement> retVec)
+    {
+        if (retVec == null) retVec = new ArrayList<SVGElement>();
+        
+        retVec.addAll(children);
+        
+        return retVec;
+    }
+    
+    /**
+     * @param id - Id of svg element to return
+     * @return the child of the given id, or null if no such child exists.
+     */
+    public SVGElement getChild(String id)
+    {
+        for (Iterator<SVGElement> it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = (SVGElement)it.next();
+            String eleId = ele.getId();
+            if (eleId != null && eleId.equals(id)) return ele;
+        }
+        
+        return null;
+    }
+    
+    /**
+     * Searches children for given element.  If found, returns index of child.
+     * Otherwise returns -1.
+     */
+    public int indexOfChild(SVGElement child)
+    {
+        return children.indexOf(child);
+    }
+    
+    /**
+     * Swaps 2 elements in children.
+     * @i index of first
+     * @j index of second
+     *
+     * @return true if successful, false otherwise
+     */
+    public void swapChildren(int i, int j) throws SVGException
+    {
+        if ((children == null) || (i < 0) || (i >= children.size()) || (j < 0) || (j >= children.size()))
+        {
+            return;
+        }
+        
+        SVGElement temp = children.get(i);
+        children.set(i, children.get(j));
+        children.set(j, temp);
+        build();
+    }
+
+    /**
+     * Called by internal processes to rebuild the geometry of this node
+     * from it's presentation attributes, style attributes and animated tracks.
+     */
+    protected void build() throws SVGException
+    {
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("id")))
+        {
+            String newId = sty.getStringValue();
+            if (!newId.equals(id))
+            {
+                diagram.removeElement(id);
+                id = newId;
+                diagram.setElement(this.id, this);
+            }
+        }
+        if (getPres(sty.setName("class"))) cssClass = sty.getStringValue();
+        if (getPres(sty.setName("xml:base"))) xmlBase = sty.getURIValue();
+    }
+    
+    /**
+     * Copies the current style into the passed style attribute.  Checks for
+     * inline styles first, then internal and extranal style sheets, and
+     * finally checks for presentation attributes.  Recursively checks parents.
+     * @param attrib - Attribute to write style data to.  Must have it's name
+     * set to the name of the style being queried.
+     * @param recursive - If true and this object does not contain the
+     * named style attribute, checks attributes of parents abck to root until
+     * one found.
+     */
+    public boolean getStyle(StyleAttribute attrib, boolean recursive) throws SVGException
+    {
+        String styName = attrib.getName();
+        
+        //Check for local inline styles
+        StyleAttribute styAttr = (StyleAttribute)inlineStyles.get(styName);
+        
+        attrib.setStringValue(styAttr == null ? "" : styAttr.getStringValue());
+        
+        //Return if we've found a non animated style
+        if (styAttr != null) return true;
+        
+        
+        
+        //Implement style sheet lookup later
+        
+        //Check for presentation attribute
+        StyleAttribute presAttr = (StyleAttribute)presAttribs.get(styName);
+        
+        attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
+        
+        //Return if we've found a presentation attribute instead
+        if (presAttr != null) return true;
+        
+        
+        //If we're recursive, check parents
+        if (recursive)
+        {
+            SVGElement parentContext = getParentContext();
+            if (parentContext != null) return parentContext.getStyle(attrib, true);
+            if (parent != null) return parent.getStyle(attrib, true);
+        }
+        
+        //Unsuccessful reading style attribute
+        return false;
+    }
+    /**
+     * Copies the presentation attribute into the passed one.
+     * @return - True if attribute was read successfully
+     */
+    public boolean getPres(StyleAttribute attrib) throws SVGException
+    {
+        String presName = attrib.getName();
+        
+        //Make sure we have a coresponding presentation attribute
+        StyleAttribute presAttr = (StyleAttribute)presAttribs.get(presName);
+        
+        //Copy presentation value directly
+        attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
+        
+        //Return if we found presentation attribute
+        if (presAttr != null) return true;
+        
+        return false;
+    }
+
+    
+    /**
+     * Called during SAX load process to notify that this tag has begun the process
+     * of being loaded
+     * @param attrs - Attributes of this tag
+     * @param helper - An object passed to all SVG elements involved in this build
+     * process to aid in sharing information.
+     */
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent) throws SAXException
+    {
+        //Set identification info
+        this.parent = parent;
+        this.diagram = helper.diagram;
+        
+        this.id = attrs.getValue("id");
+        if (this.id != null && !this.id.equals(""))
+        {
+            diagram.setElement(this.id, this);
+        }
+        
+        String className = attrs.getValue("class");
+        this.cssClass = (className == null || className.equals("")) ? null : className;
+        //docRoot = helper.docRoot;
+        //universe = helper.universe;
+        
+        String base = attrs.getValue("xml:base");
+        if (base != null && !base.equals(""))
+        {
+            try
+            {
+                xmlBase = new URI(base);
+            }
+            catch (Exception e)
+            {
+                throw new SAXException(e);
+            }
+        }
+        
+        //Place all other attributes into the presentation attribute list
+        int numAttrs = attrs.getLength();
+        for (int i = 0; i < numAttrs; i++)
+        {
+            String name = attrs.getQName(i);
+            if (ignorePresAttrib.contains(name)) continue;
+            String value = attrs.getValue(i);
+            
+            presAttribs.put(name, new StyleAttribute(name, value));
+        }
+    }
+       
+    /**
+     * @return a set of Strings that corespond to CSS attributes on this element
+     */
+    public Set<String> getInlineAttributes()
+    {
+        return inlineStyles.keySet();
+    }
+    
+    /**
+     * @return a set of Strings that corespond to XML attributes on this element
+     */
+    public Set<String> getPresentationAttributes()
+    {
+        return presAttribs.keySet();
+    }
+    
+    /**
+     * Called after the start element but before the end element to indicate
+     * each child tag that has been processed
+     */
+    public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
+    {
+        children.add(child);
+        child.parent = this;
+        child.setDiagram(diagram);
+    }
+    
+    private void setDiagram(SVGDiagram diagram)
+    {
+        this.diagram = diagram;
+        diagram.setElement(id, this);
+        for (Iterator<SVGElement> it = children.iterator(); it.hasNext();)
+        {
+            SVGElement ele = it.next();
+            ele.setDiagram(diagram);
+        }
+    }
+    
+    public void removeChild(SVGElement child) throws SVGElementException
+    {
+        if (!children.contains(child))
+        {
+            throw new SVGElementException(this, "Element does not contain child " + child);
+        }
+        
+        children.remove(child);
+    }
+    
+    /**
+     * Called during load process to add text scanned within a tag
+     */
+    public void loaderAddText(SVGLoaderHelper helper, String text)
+    {
+    }
+    
+    /**
+     * Called to indicate that this tag and the tags it contains have been completely
+     * processed, and that it should finish any load processes.
+     */
+    public void loaderEndElement(SVGLoaderHelper helper) throws SVGParseException
+    {
+    }
+    
+    public URI getXMLBase()
+    {
+        return xmlBase != null ? xmlBase :
+            (parent != null ? parent.getXMLBase() : diagram.getXMLBase());
+    }
+
+    /**
+     * @return the id assigned to this node.  Null if no id explicitly set.
+     */
+    public String getId()
+    {
+        return id; 
+    }
+    
+    
+    LinkedList<SVGElement> contexts = new LinkedList<SVGElement>();
+    
+    /**
+     * Hack to allow nodes to temporarily change their parents.  The Use tag will
+     * need this so it can alter the attributes that a particular node uses.
+     */
+    protected void pushParentContext(SVGElement context)
+    {
+        contexts.addLast(context);
+    }
+
+    protected SVGElement popParentContext()
+    {
+        return (SVGElement)contexts.removeLast();
+    }
+    
+    protected SVGElement getParentContext()
+    {
+        return contexts.isEmpty() ? null : (SVGElement)contexts.getLast();
+    }
+    
+    /**
+     * @return the raw style value of this attribute.  Does not take the 
+     * presentation value or animation into consideration.  Used by animations 
+     * to determine the base to animate from.
+     */
+    public StyleAttribute getStyleAbsolute(String styName)
+    {
+        //Check for local inline styles
+        return (StyleAttribute)inlineStyles.get(styName);
+    }
+
+    /*
+     * Returns the named style attribute.  Checks for inline styles first, then
+     * internal and extranal style sheets, and finally checks for presentation
+     * attributes.
+     * @param styleName - Name of attribute to return
+     * @param recursive - If true and this object does not contain the
+     * named style attribute, checks attributes of parents abck to root until
+     * one found.
+     */
+    public boolean getStyle(StyleAttribute attrib) throws SVGException
+    {
+        return getStyle(attrib, true);
+    }
+
+    /**
+     * @return the raw presentation value of this attribute.  Ignores any 
+     * modifications applied by style attributes or animation.  Used by 
+     * animations to determine the starting point to animate from
+     */
+    public StyleAttribute getPresAbsolute(String styName)
+    {
+        //Check for local inline styles
+        return presAttribs.get(styName);
+    }
+    
+    static protected AffineTransform parseTransform(String val) throws SVGException
+    {
+        final Matcher matchExpression = Pattern.compile("\\w+\\([^)]*\\)").matcher("");
+        
+        AffineTransform retXform = new AffineTransform();
+        
+        matchExpression.reset(val);
+        while (matchExpression.find())
+        {
+            retXform.concatenate(parseSingleTransform(matchExpression.group()));
+        }
+        
+        return retXform;
+    }
+    
+    static public AffineTransform parseSingleTransform(String val) throws SVGException
+    {
+        final Matcher matchWord = Pattern.compile("[-.\\w]+").matcher("");
+        
+        AffineTransform retXform = new AffineTransform();
+        
+        matchWord.reset(val);
+        if (!matchWord.find())
+        {
+            //Return identity transformation if no data present (eg, empty string)
+            return retXform;
+        }
+        
+        String function = matchWord.group().toLowerCase();
+        
+        LinkedList<String> termList = new LinkedList<String>();
+        while (matchWord.find())
+        {
+            termList.add(matchWord.group());
+        }
+        
+        
+        double[] terms = new double[termList.size()];
+        Iterator<String> it = termList.iterator();
+        int count = 0;
+        while (it.hasNext())
+        {
+            terms[count++] = XMLParseUtil.parseDouble(it.next());
+        }
+        
+        //Calculate transformation
+        if (function.equals("matrix"))
+        {
+            retXform.setTransform(terms[0], terms[1], terms[2], terms[3], terms[4], terms[5]);
+        }
+        else if (function.equals("translate"))
+        {
+            retXform.setToTranslation(terms[0], terms[1]);
+        }
+        else if (function.equals("scale"))
+        {
+            if (terms.length > 1)
+                retXform.setToScale(terms[0], terms[1]);
+            else
+                retXform.setToScale(terms[0], terms[0]);
+        }
+        else if (function.equals("rotate"))
+        {
+            if (terms.length > 2)
+                retXform.setToRotation(Math.toRadians(terms[0]), terms[1], terms[2]);
+            else
+                retXform.setToRotation(Math.toRadians(terms[0]));
+        }
+        else if (function.equals("skewx"))
+        {
+            retXform.setToShear(Math.toRadians(terms[0]), 0.0);
+        }
+        else if (function.equals("skewy"))
+        {
+            retXform.setToShear(0.0, Math.toRadians(terms[0]));
+        }
+        else
+        {
+            throw new SVGException("Unknown transform type");
+        }
+        
+        return retXform;
+    }
+
+    static protected PathCommand[] parsePathList(String list)
+    {
+        final Matcher matchPathCmd = Pattern.compile("([MmLlHhVvAaQqTtCcSsZz])|([-+]?((\\d*\\.\\d+)|(\\d+))([eE][-+]?\\d+)?)").matcher(list);
+        
+        //Tokenize
+        LinkedList<String> tokens = new LinkedList<String>();
+        while (matchPathCmd.find())
+        {
+            tokens.addLast(matchPathCmd.group());
+        }
+        
+        
+        LinkedList<PathCommand> cmdList = new LinkedList<PathCommand>();
+        char curCmd = 'Z';
+        while (tokens.size() != 0)
+        {
+            String curToken = (String)tokens.removeFirst();
+            char initChar = curToken.charAt(0);
+            if ((initChar >= 'A' && initChar <='Z') || (initChar >= 'a' && initChar <='z'))
+            {
+                curCmd = initChar;
+            }
+            else
+            {
+                tokens.addFirst(curToken);
+            }
+            
+            PathCommand cmd = null;
+            
+            switch (curCmd)
+            {
+                case 'M':
+                    cmd = new MoveTo(false, nextFloat(tokens), nextFloat(tokens));
+                    curCmd = 'L';
+                    break;
+                case 'm':
+                    cmd = new MoveTo(true, nextFloat(tokens), nextFloat(tokens));
+                    curCmd = 'l';
+                    break;
+                case 'L':
+                    cmd = new LineTo(false, nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'l':
+                    cmd = new LineTo(true, nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'H':
+                    cmd = new Horizontal(false, nextFloat(tokens));
+                    break;
+                case 'h':
+                    cmd = new Horizontal(true, nextFloat(tokens));
+                    break;
+                case 'V':
+                    cmd = new Vertical(false, nextFloat(tokens));
+                    break;
+                case 'v':
+                    cmd = new Vertical(true, nextFloat(tokens));
+                    break;
+                case 'A':
+                    cmd = new Arc(false, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens),
+                            nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'a':
+                    cmd = new Arc(true, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens),
+                            nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'Q':
+                    cmd = new Quadratic(false, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'q':
+                    cmd = new Quadratic(true, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'T':
+                    cmd = new QuadraticSmooth(false, nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 't':
+                    cmd = new QuadraticSmooth(true, nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'C':
+                    cmd = new Cubic(false, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'c':
+                    cmd = new Cubic(true, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'S':
+                    cmd = new CubicSmooth(false, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 's':
+                    cmd = new CubicSmooth(true, nextFloat(tokens), nextFloat(tokens),
+                            nextFloat(tokens), nextFloat(tokens));
+                    break;
+                case 'Z':
+                case 'z':
+                    cmd = new Terminal();
+                    break;
+                default:
+                    throw new RuntimeException("Invalid path element");
+            }
+            
+            cmdList.add(cmd);
+        }
+        
+        PathCommand[] retArr = new PathCommand[cmdList.size()];
+        cmdList.toArray(retArr);
+        return retArr;
+    }
+    
+    static protected GeneralPath buildPath(String text, int windingRule)
+    {
+        PathCommand[] commands = parsePathList(text);
+        
+        int numKnots = 2;
+        for (int i = 0; i < commands.length; i++)
+        {
+            numKnots += commands[i].getNumKnotsAdded();
+        }
+        
+        
+        GeneralPath path = new GeneralPath(windingRule, numKnots);
+        
+        BuildHistory hist = new BuildHistory();
+        
+        for (int i = 0; i < commands.length; i++)
+        {
+            PathCommand cmd = commands[i];
+            cmd.appendPath(path, hist);
+        }
+        
+        return path;
+    }
+
+    static protected float nextFloat(LinkedList<String> l)
+    {
+        String s = l.removeFirst();
+        return Float.parseFloat(s);
+    }
+    
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    abstract public boolean updateTime(double curTime) throws SVGException;
+
+    public int getNumChildren()
+    {
+        return children.size();
+    }
+
+    public SVGElement getChild(int i)
+    {
+        return (SVGElement)children.get(i);
+    }
+    
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElementException.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElementException.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGElementException.java	(revision 23707)
@@ -0,0 +1,56 @@
+/*
+ * SVGException.java
+ *
+ * Created on May 12, 2005, 11:32 PM
+ *
+ * To change this template, choose Tools | Options and locate the template under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package com.kitfox.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGElementException extends SVGException
+{
+    public static final long serialVersionUID = 0;
+    
+    private final SVGElement element;
+    
+    /**
+     * Creates a new instance of <code>SVGException</code> without detail message.
+     */
+    public SVGElementException(SVGElement element)
+    {
+        this(element, null, null);
+    }
+    
+    
+    /**
+     * Constructs an instance of <code>SVGException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public SVGElementException(SVGElement element, String msg)
+    {
+        this(element, msg, null);
+    }
+    
+    public SVGElementException(SVGElement element, String msg, Throwable cause)
+    {
+        super(msg, cause);
+        this.element = element;
+    }
+    
+    public SVGElementException(SVGElement element, Throwable cause)
+    {
+        this(element, null, cause);
+    }
+
+    public SVGElement getElement()
+    {
+        return element;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGException.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGException.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGException.java	(revision 23707)
@@ -0,0 +1,47 @@
+/*
+ * SVGException.java
+ *
+ * Created on May 12, 2005, 11:32 PM
+ *
+ * To change this template, choose Tools | Options and locate the template under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package com.kitfox.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGException extends java.lang.Exception
+{
+    public static final long serialVersionUID = 0;
+    
+    /**
+     * Creates a new instance of <code>SVGException</code> without detail message.
+     */
+    public SVGException()
+    {
+    }
+    
+    
+    /**
+     * Constructs an instance of <code>SVGException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public SVGException(String msg)
+    {
+        super(msg);
+    }
+    
+    public SVGException(String msg, Throwable cause)
+    {
+        super(msg, cause);
+    }
+    
+    public SVGException(Throwable cause)
+    {
+        super(cause);
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoader.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoader.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoader.java	(revision 23707)
@@ -0,0 +1,262 @@
+/*
+ * SVGLoader.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 5:09 PM
+ * Modified on October 19, 2010 by Upliner
+ */
+
+package com.kitfox.svg;
+
+
+import java.util.*;
+import java.net.*;
+import org.xml.sax.*;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class SVGLoader extends DefaultHandler
+{
+    final HashMap<String,Class<? extends SVGElement>> nodeClasses = new HashMap<String,Class<? extends SVGElement>>();
+
+    final LinkedList<SVGElement> buildStack = new LinkedList<SVGElement>();
+
+    final HashSet<String> ignoreClasses = new HashSet<String>();
+
+    final SVGLoaderHelper helper;
+
+    /**
+     * The diagram that represents the base of this SVG document we're loading.
+     * Will be augmented to include node indexing info and other useful stuff.
+     */
+    final SVGDiagram diagram;
+
+//    SVGElement loadRoot;
+
+    //Used to keep track of document elements that are not part of the SVG namespace
+    int skipNonSVGTagDepth = 0;
+    int indent = 0;
+
+    final boolean verbose;
+    
+    /** Creates a new instance of SVGLoader */
+    public SVGLoader(URI xmlBase)
+    {
+        this(xmlBase, false);
+    }
+    
+    public SVGLoader(URI xmlBase, boolean verbose)
+    {
+        this.verbose = verbose;
+        
+        diagram = new SVGDiagram(xmlBase);
+
+        //Compile a list of important builder classes
+        nodeClasses.put("a", A.class);
+        nodeClasses.put("circle", Circle.class);
+        nodeClasses.put("defs", Defs.class);
+        nodeClasses.put("desc", Desc.class);
+        nodeClasses.put("ellipse", Ellipse.class);
+        nodeClasses.put("g", Group.class);
+        nodeClasses.put("line", Line.class);
+        nodeClasses.put("metadata", Metadata.class);
+        nodeClasses.put("path", Path.class);
+        nodeClasses.put("polygon", Polygon.class);
+        nodeClasses.put("polyline", Polyline.class);
+        nodeClasses.put("rect", Rect.class);
+        nodeClasses.put("shape", ShapeElement.class);
+        nodeClasses.put("stop", Stop.class);
+        nodeClasses.put("style", Style.class);
+        nodeClasses.put("svg", SVGRoot.class);
+        nodeClasses.put("symbol", Symbol.class);
+        nodeClasses.put("title", Title.class);
+        nodeClasses.put("use", Use.class);
+
+        ignoreClasses.add("animate");
+        ignoreClasses.add("animatecolor");
+        ignoreClasses.add("animatemotion");
+        ignoreClasses.add("animatetransform");
+        ignoreClasses.add("clippath");
+        ignoreClasses.add("glyph");
+        ignoreClasses.add("hkern");
+        ignoreClasses.add("filter");
+        ignoreClasses.add("image");
+        ignoreClasses.add("font");
+        ignoreClasses.add("font-face");
+        ignoreClasses.add("lineargradient");
+        ignoreClasses.add("midpointstop");
+        ignoreClasses.add("missing-glyph");
+        ignoreClasses.add("pattern");
+        ignoreClasses.add("radialgradient");
+        ignoreClasses.add("set");
+        ignoreClasses.add("text");
+        ignoreClasses.add("tspan");
+
+
+        helper = new SVGLoaderHelper(xmlBase,  diagram);
+    }
+
+    private String printIndent(int indent, String indentStrn)
+    {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < indent; i++)
+        {
+            sb.append(indentStrn);
+        }
+        return sb.toString();
+    }
+    
+    public void startDocument() throws SAXException
+    {
+//        System.err.println("Start doc");
+
+//        buildStack.clear();
+    }
+
+    public void endDocument() throws SAXException
+    {
+//        System.err.println("End doc");
+    }
+
+    public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
+    {
+        if (verbose)
+        {
+            System.err.println(printIndent(indent, " ") + "Starting parse of tag " + sName+ ": " + namespaceURI);
+        }
+        indent++;
+        
+        if (skipNonSVGTagDepth != 0 || (!namespaceURI.equals("") && !namespaceURI.equals(SVGElement.SVG_NS)))
+        {
+            skipNonSVGTagDepth++;
+            return;
+        }
+        
+        sName = sName.toLowerCase();
+
+//javax.swing.JOptionPane.showMessageDialog(null, sName);
+
+        Class<?> cls = nodeClasses.get(sName);
+        if (cls == null)
+        {
+            if (!ignoreClasses.contains(sName))
+            {
+                System.err.println("SVGLoader: Could not identify tag '" + sName + "'");
+            }
+            return;
+        }
+
+//Debug info tag depth
+//for (int i = 0; i < buildStack.size(); i++) System.err.print(" ");
+//System.err.println("+" + sName);
+
+        try {
+            SVGElement svgEle = (SVGElement)cls.newInstance();
+
+            SVGElement parent = null;
+            if (buildStack.size() != 0) parent = (SVGElement)buildStack.getLast();
+            svgEle.loaderStartElement(helper, attrs, parent);
+
+            buildStack.addLast(svgEle);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            throw new SAXException(e);
+        }
+
+    }
+
+    public void endElement(String namespaceURI, String sName, String qName)
+        throws SAXException
+    {
+        indent--;
+        if (verbose)
+        {
+            System.err.println(printIndent(indent, " ") + "Ending parse of tag " + sName+ ": " + namespaceURI);
+        }
+        
+        if (skipNonSVGTagDepth != 0)
+        {
+            skipNonSVGTagDepth--;
+            return;
+        }
+        
+        sName = sName.toLowerCase();
+
+        Object obj = nodeClasses.get(sName);
+        if (obj == null) return;
+
+//Debug info tag depth
+//for (int i = 0; i < buildStack.size(); i++) System.err.print(" ");
+//System.err.println("-" + sName);
+
+        try {
+            SVGElement svgEle = (SVGElement)buildStack.removeLast();
+
+            svgEle.loaderEndElement(helper);
+
+            SVGElement parent = null;
+            if (buildStack.size() != 0) parent = (SVGElement)buildStack.getLast();
+            //else loadRoot = (SVGElement)svgEle;
+
+            if (parent != null) parent.loaderAddChild(helper, svgEle);
+            else diagram.setRoot((SVGRoot)svgEle);
+
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            throw new SAXException(e);
+        }
+    }
+
+    public void characters(char buf[], int offset, int len)
+        throws SAXException
+    {
+        if (skipNonSVGTagDepth != 0)
+        {
+            return;
+        }
+
+        if (buildStack.size() != 0)
+        {
+            SVGElement parent = buildStack.getLast();
+            String s = new String(buf, offset, len);
+            parent.loaderAddText(helper, s);
+        }
+    }
+
+    public void processingInstruction(String target, String data)
+        throws SAXException
+    {
+        //Check for external style sheet
+    }
+    
+//    public SVGElement getLoadRoot() { return loadRoot; }
+    public SVGDiagram getLoadedDiagram() { return diagram; }
+    
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoaderHelper.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoaderHelper.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGLoaderHelper.java	(revision 23707)
@@ -0,0 +1,51 @@
+/*
+ * SVGLoaderHelper.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 5:37 PM
+ */
+
+package com.kitfox.svg;
+
+import java.net.*;
+import java.io.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class SVGLoaderHelper
+{
+    /** This is the diagram which the load process is currently loading */
+    public final SVGDiagram diagram;
+
+    public final URI xmlBase;
+    
+    /** Creates a new instance of SVGLoaderHelper */
+    public SVGLoaderHelper(URI xmlBase, SVGDiagram diagram)
+    {
+        this.xmlBase = xmlBase;
+        this.diagram = diagram;
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGParseException.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGParseException.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGParseException.java	(revision 23707)
@@ -0,0 +1,47 @@
+/*
+ * SVGException.java
+ *
+ * Created on May 12, 2005, 11:32 PM
+ *
+ * To change this template, choose Tools | Options and locate the template under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package com.kitfox.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGParseException extends java.lang.Exception
+{
+    public static final long serialVersionUID = 0;
+    
+    /**
+     * Creates a new instance of <code>SVGException</code> without detail message.
+     */
+    public SVGParseException()
+    {
+    }
+    
+    
+    /**
+     * Constructs an instance of <code>SVGException</code> with the specified detail message.
+     * @param msg the detail message.
+     */
+    public SVGParseException(String msg)
+    {
+        super(msg);
+    }
+    
+    public SVGParseException(String msg, Throwable cause)
+    {
+        super(msg, cause);
+    }
+    
+    public SVGParseException(Throwable cause)
+    {
+        super(cause);
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGRoot.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGRoot.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/SVGRoot.java	(revision 23707)
@@ -0,0 +1,395 @@
+/*
+ * SVGRoot.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 5:33 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.NumberWithUnits;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.geom.*;
+import java.awt.*;
+
+/**
+ * The root element of an SVG tree.
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class SVGRoot extends Group
+{
+    NumberWithUnits x;
+    NumberWithUnits y;
+    NumberWithUnits width;
+    NumberWithUnits height;
+
+    
+//    final Rectangle2D.Float viewBox = new Rectangle2D.Float();
+    Rectangle2D.Float viewBox = null;
+
+    public static final int PA_X_NONE = 0;
+    public static final int PA_X_MIN = 1;
+    public static final int PA_X_MID = 2;
+    public static final int PA_X_MAX = 3;
+
+    public static final int PA_Y_NONE = 0;
+    public static final int PA_Y_MIN = 1;
+    public static final int PA_Y_MID = 2;
+    public static final int PA_Y_MAX = 3;
+
+    public static final int PS_MEET = 0;
+    public static final int PS_SLICE = 1;
+
+    int parSpecifier = PS_MEET;
+    int parAlignX = PA_X_MID;
+    int parAlignY = PA_Y_MID;
+
+    final AffineTransform viewXform = new AffineTransform();
+    final Rectangle2D.Float clipRect = new Rectangle2D.Float();
+
+    /** Creates a new instance of SVGRoot */
+    public SVGRoot()
+    {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        x = XMLParseUtil.parseNumberWithUnits(attrs.getValue("x"));
+        y = XMLParseUtil.parseNumberWithUnits(attrs.getValue("y"));
+        width = XMLParseUtil.parseNumberWithUnits(attrs.getValue("width"));
+        height = XMLParseUtil.parseNumberWithUnits(attrs.getValue("height"));
+
+        String viewBox = attrs.getValue("viewBox");
+        float[] coords = XMLParseUtil.parseFloatList(viewBox);
+
+        if (coords == null)
+        {
+            //this.viewBox.setRect(0, 0, width.getValue(), height.getValue());
+            this.viewBox = null;
+        }
+        else
+        {
+            this.viewBox = new Rectangle2D.Float(coords[0], coords[1], coords[2], coords[3]);
+        }
+
+        String par = attrs.getValue("preserveAspectRatio");
+        if (par != null)
+        {
+            String[] parList = XMLParseUtil.parseStringList(par);
+
+            if (parList[0].equals("none")) { parAlignX = PA_X_NONE; parAlignY = PA_Y_NONE; }
+            else if (parList[0].equals("xMinYMin")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMidYMin")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMaxYMin")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMinYMid")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMidYMid")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMaxYMid")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMinYMax")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MAX; }
+            else if (parList[0].equals("xMidYMax")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MAX; }
+            else if (parList[0].equals("xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
+
+            if (parList[1].equals("meet")) parSpecifier = PS_MEET;
+            else if (parList[1].equals("slice")) parSpecifier = PS_SLICE;
+        }
+
+        build();
+    }
+*/
+    
+    public void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("x"))) x = sty.getNumberWithUnits();
+        
+        if (getPres(sty.setName("y"))) y = sty.getNumberWithUnits();
+        
+        if (getPres(sty.setName("width"))) width = sty.getNumberWithUnits();
+        
+        if (getPres(sty.setName("height"))) height = sty.getNumberWithUnits();
+        
+        if (getPres(sty.setName("viewBox"))) 
+        {
+            float[] coords = sty.getFloatList();
+            viewBox = new Rectangle2D.Float(coords[0], coords[1], coords[2], coords[3]);
+        }
+        
+        if (getPres(sty.setName("preserveAspectRatio")))
+        {
+            String preserve = sty.getStringValue();
+            
+            if (contains(preserve, "none")) { parAlignX = PA_X_NONE; parAlignY = PA_Y_NONE; }
+            else if (contains(preserve, "xMinYMin")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MIN; }
+            else if (contains(preserve, "xMidYMin")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MIN; }
+            else if (contains(preserve, "xMaxYMin")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MIN; }
+            else if (contains(preserve, "xMinYMid")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MID; }
+            else if (contains(preserve, "xMidYMid")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MID; }
+            else if (contains(preserve, "xMaxYMid")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MID; }
+            else if (contains(preserve, "xMinYMax")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MAX; }
+            else if (contains(preserve, "xMidYMax")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MAX; }
+            else if (contains(preserve, "xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
+
+            if (contains(preserve, "meet")) parSpecifier = PS_MEET;
+            else if (contains(preserve, "slice")) parSpecifier = PS_SLICE;
+            
+            /*
+            String[] parList = sty.getStringList();
+
+            if (parList[0].equals("none")) { parAlignX = PA_X_NONE; parAlignY = PA_Y_NONE; }
+            else if (parList[0].equals("xMinYMin")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMidYMin")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMaxYMin")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MIN; }
+            else if (parList[0].equals("xMinYMid")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMidYMid")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMaxYMid")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MID; }
+            else if (parList[0].equals("xMinYMax")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MAX; }
+            else if (parList[0].equals("xMidYMax")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MAX; }
+            else if (parList[0].equals("xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
+
+            if (parList[1].equals("meet")) parSpecifier = PS_MEET;
+            else if (parList[1].equals("slice")) parSpecifier = PS_SLICE;
+             */
+        }
+        
+        prepareViewport();
+    }
+    
+    private boolean contains(String text, String find) 
+    {
+        return (text.indexOf(find) != -1);
+    }
+    
+    protected void prepareViewport()
+    {
+        Rectangle deviceViewport = diagram.getDeviceViewport();
+        
+        Rectangle2D defaultBounds;
+        try
+        {
+            defaultBounds = getBoundingBox();
+        } catch (SVGException ex)
+        {
+            defaultBounds= new Rectangle2D.Float();
+        }
+        
+        //Determine destination rectangle
+        float xx, yy, ww, hh;
+        if (width != null)
+        {
+            xx = (x == null) ? 0 : StyleAttribute.convertUnitsToPixels(x.getUnits(), x.getValue());
+            if (width.getUnits() == NumberWithUnits.UT_PERCENT)
+            {
+                ww = width.getValue() * deviceViewport.width;
+            }
+            else
+            {
+                ww = StyleAttribute.convertUnitsToPixels(width.getUnits(), width.getValue());
+            }
+//            setAttribute("x", AnimationElement.AT_XML, "" + xx);
+//            setAttribute("width", AnimationElement.AT_XML, "" + ww);
+        }
+        else if (viewBox != null)
+        {
+            xx = (float)viewBox.x;
+            ww = (float)viewBox.width;
+            width = new NumberWithUnits(ww, NumberWithUnits.UT_PX);
+            x = new NumberWithUnits(xx, NumberWithUnits.UT_PX);
+        }
+        else
+        {
+            //Estimate size from scene bounding box
+            xx = (float)defaultBounds.getX();
+            ww = (float)defaultBounds.getWidth();
+            width = new NumberWithUnits(ww, NumberWithUnits.UT_PX);
+            x = new NumberWithUnits(xx, NumberWithUnits.UT_PX);
+        }
+        
+        if (height != null)
+        {
+            yy = (y == null) ? 0 : StyleAttribute.convertUnitsToPixels(y.getUnits(), y.getValue());
+            if (height.getUnits() == NumberWithUnits.UT_PERCENT)
+            {
+                hh = height.getValue() * deviceViewport.height;
+            }
+            else
+            {
+                hh = StyleAttribute.convertUnitsToPixels(height.getUnits(), height.getValue());
+            }
+        }
+        else if (viewBox != null)
+        {
+            yy = (float)viewBox.y;
+            hh = (float)viewBox.height;
+            height = new NumberWithUnits(hh, NumberWithUnits.UT_PX);
+            y = new NumberWithUnits(yy, NumberWithUnits.UT_PX);
+        }
+        else
+        {
+            //Estimate size from scene bounding box
+            yy = (float)defaultBounds.getY();
+            hh = (float)defaultBounds.getHeight();
+            height = new NumberWithUnits(hh, NumberWithUnits.UT_PX);
+            y = new NumberWithUnits(yy, NumberWithUnits.UT_PX);
+        }
+
+        clipRect.setRect(xx, yy, ww, hh);
+
+        if (viewBox == null)
+        {
+            viewXform.setToIdentity();
+        }
+        else
+        {
+            viewXform.setToTranslation(clipRect.x, clipRect.y);
+            viewXform.scale(clipRect.width, clipRect.height);
+            viewXform.scale(1 / viewBox.width, 1 / viewBox.height);
+            viewXform.translate(-viewBox.x, -viewBox.y);
+        }
+
+        
+        //For now, treat all preserveAspectRatio as 'none'
+//        viewXform.setToTranslation(viewBox.x, viewBox.y);
+//        viewXform.scale(clipRect.width / viewBox.width, clipRect.height / viewBox.height);
+//        viewXform.translate(-clipRect.x, -clipRect.y);
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        prepareViewport();
+        
+        AffineTransform cachedXform = g.getTransform();
+        g.transform(viewXform);
+        
+        super.render(g);
+        
+        g.setTransform(cachedXform);
+    }
+
+    public Shape getShape()
+    {
+        Shape shape = super.getShape();
+        return viewXform.createTransformedShape(shape);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        Rectangle2D bbox = super.getBoundingBox();
+        return viewXform.createTransformedShape(bbox).getBounds2D();
+    }
+    
+    public float getDeviceWidth()
+    {
+        return clipRect.width;
+    }
+    
+    public float getDeviceHeight()
+    {
+        return clipRect.height;
+    }
+    
+    public Rectangle2D getDeviceRect(Rectangle2D rect)
+    {
+        rect.setRect(clipRect);
+        return rect;
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        boolean changeState = super.updateTime(curTime);
+        
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("x")))
+        {
+            NumberWithUnits newVal = sty.getNumberWithUnits();
+            if (!newVal.equals(x))
+            {
+                x = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            NumberWithUnits newVal = sty.getNumberWithUnits();
+            if (!newVal.equals(y))
+            {
+                y = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            NumberWithUnits newVal = sty.getNumberWithUnits();
+            if (!newVal.equals(width))
+            {
+                width = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            NumberWithUnits newVal = sty.getNumberWithUnits();
+            if (!newVal.equals(height))
+            {
+                height = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("viewBox"))) 
+        {
+            float[] coords = sty.getFloatList();
+            Rectangle2D.Float newViewBox = new Rectangle2D.Float(coords[0], coords[1], coords[2], coords[3]);
+            if (!newViewBox.equals(viewBox))
+            {
+                viewBox = newViewBox;
+                shapeChange = true;
+            }
+        }
+
+        if (shapeChange)
+        {
+            build();
+        }
+
+        return changeState || shapeChange;
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/ShapeElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/ShapeElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/ShapeElement.java	(revision 23707)
@@ -0,0 +1,294 @@
+/*
+ * ShapeElement.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 5:21 PM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.AlphaComposite;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.net.URI;
+import java.util.List;
+
+
+
+/**
+ * Parent of shape objects
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+abstract public class ShapeElement extends RenderableElement 
+{
+
+    /**
+     * This is necessary to get text elements to render the stroke the correct
+     * width.  It is an alternative to producing new font glyph sets at different
+     * sizes.
+     */
+    protected float strokeWidthScalar = 1f;
+
+    /** Creates a new instance of ShapeElement */
+    public ShapeElement() {
+    }
+
+    abstract public void render(java.awt.Graphics2D g) throws SVGException;
+
+    /*
+    protected void setStrokeWidthScalar(float strokeWidthScalar)
+    {
+        this.strokeWidthScalar = strokeWidthScalar;
+    }
+     */
+
+    void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException
+    {
+        StyleAttribute styleAttrib = new StyleAttribute();
+//        if (getStyle(styleAttrib.setName("fill")) && getShape().contains(point))
+        if ((boundingBox ? getBoundingBox() : getShape()).contains(point))
+        {
+            retVec.add(getPath(null));
+        }
+    }
+
+    void pick(Rectangle2D pickArea, AffineTransform ltw, boolean boundingBox, List retVec) throws SVGException
+    {
+        StyleAttribute styleAttrib = new StyleAttribute();
+//        if (getStyle(styleAttrib.setName("fill")) && getShape().contains(point))
+        if (ltw.createTransformedShape((boundingBox ? getBoundingBox() : getShape())).intersects(pickArea))
+        {
+            retVec.add(getPath(null));
+        }
+    }
+
+    protected void renderShape(Graphics2D g, Shape shape) throws SVGException
+    {
+//g.setColor(Color.green);
+
+        StyleAttribute styleAttrib = new StyleAttribute();
+        
+        //Don't process if not visible
+        if (getStyle(styleAttrib.setName("visibility")))
+        {
+            if (!styleAttrib.getStringValue().equals("visible")) return;
+        }
+
+        if (getStyle(styleAttrib.setName("display")))
+        {
+            if (styleAttrib.getStringValue().equals("none")) return;
+        }
+
+        //None, solid color, gradient, pattern
+        Paint fillPaint = Color.black;  //Default to black.  Must be explicitly set to none for no fill.
+        if (getStyle(styleAttrib.setName("fill")))
+        {
+            if (styleAttrib.getStringValue().equals("none")) fillPaint = null;
+            else
+            {
+                fillPaint = styleAttrib.getColorValue();
+            }
+        }
+
+        //Default opacity
+        float opacity = 1f;
+        if (getStyle(styleAttrib.setName("opacity")))
+        {
+            opacity = styleAttrib.getRatioValue();
+        }
+        
+        float fillOpacity = opacity;
+        if (getStyle(styleAttrib.setName("fill-opacity")))
+        {
+            fillOpacity *= styleAttrib.getRatioValue();
+        }
+
+
+        Paint strokePaint = null;  //Default is to stroke with none
+        if (getStyle(styleAttrib.setName("stroke")))
+        {
+            if (styleAttrib.getStringValue().equals("none")) strokePaint = null;
+            else
+            {
+                strokePaint = styleAttrib.getColorValue();
+            }
+        }
+
+        float[] strokeDashArray = null;
+        if (getStyle(styleAttrib.setName("stroke-dasharray")))
+        {
+            strokeDashArray = styleAttrib.getFloatList();
+            if (strokeDashArray.length == 0) strokeDashArray = null;
+        }
+
+        float strokeDashOffset = 0f;
+        if (getStyle(styleAttrib.setName("stroke-dashoffset")))
+        {
+            strokeDashOffset = styleAttrib.getFloatValueWithUnits();
+        }
+
+        int strokeLinecap = BasicStroke.CAP_BUTT;
+        if (getStyle(styleAttrib.setName("stroke-linecap")))
+        {
+            String val = styleAttrib.getStringValue();
+            if (val.equals("round"))
+            {
+                strokeLinecap = BasicStroke.CAP_ROUND;
+            }
+            else if (val.equals("square"))
+            {
+                strokeLinecap = BasicStroke.CAP_SQUARE;
+            }
+        }
+
+        int strokeLinejoin = BasicStroke.JOIN_MITER;
+        if (getStyle(styleAttrib.setName("stroke-linejoin")))
+        {
+            String val = styleAttrib.getStringValue();
+            if (val.equals("round"))
+            {
+                strokeLinejoin = BasicStroke.JOIN_ROUND;
+            }
+            else if (val.equals("bevel"))
+            {
+                strokeLinejoin = BasicStroke.JOIN_BEVEL;
+            }
+        }
+
+        float strokeMiterLimit = 4f;
+        if (getStyle(styleAttrib.setName("stroke-miterlimit")))
+        {
+            strokeMiterLimit = Math.max(styleAttrib.getFloatValueWithUnits(), 1);
+        }
+
+        float strokeOpacity = opacity;
+        if (getStyle(styleAttrib.setName("stroke-opacity")))
+        {
+            strokeOpacity *= styleAttrib.getRatioValue();
+        }
+
+        float strokeWidth = 1f;
+        if (getStyle(styleAttrib.setName("stroke-width")))
+        {
+            strokeWidth = styleAttrib.getFloatValueWithUnits();
+        }
+//        if (strokeWidthScalar != 1f)
+//        {
+            strokeWidth *= strokeWidthScalar;
+//        }
+
+
+
+        //Draw the shape
+        if (fillPaint != null && fillOpacity != 0f)
+        {
+            if (fillOpacity <= 0)
+            {
+                //Do nothing
+            }
+            else if (fillOpacity < 1f)
+            {
+                Composite cachedComposite = g.getComposite();
+                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillOpacity));
+
+                g.setPaint(fillPaint);
+                g.fill(shape);
+            
+                g.setComposite(cachedComposite);
+            }
+            else
+            {
+                g.setPaint(fillPaint);
+                g.fill(shape);
+            }
+        }
+
+
+        if (strokePaint != null && strokeOpacity != 0f)
+        {
+            BasicStroke stroke;
+            if (strokeDashArray == null)
+            {
+                stroke = new BasicStroke(strokeWidth, strokeLinecap, strokeLinejoin, strokeMiterLimit);
+            }
+            else
+            {
+                stroke = new BasicStroke(strokeWidth, strokeLinecap, strokeLinejoin, strokeMiterLimit, strokeDashArray, strokeDashOffset);
+            }
+
+            Shape strokeShape = stroke.createStrokedShape(shape);
+
+            if (strokeOpacity <= 0)
+            {
+                //Do nothing
+            }
+            else if (strokeOpacity < 1f)
+            {
+                Composite cachedComposite = g.getComposite();
+                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, strokeOpacity));
+
+                g.setPaint(strokePaint);
+                g.fill(strokeShape);
+
+                g.setComposite(cachedComposite);
+            }
+            else
+            {
+                g.setPaint(strokePaint);
+                g.fill(strokeShape);
+            }
+
+        }
+
+    }
+    
+    abstract public Shape getShape();
+
+    protected Rectangle2D includeStrokeInBounds(Rectangle2D rect) throws SVGException
+    {
+        StyleAttribute styleAttrib = new StyleAttribute();
+        if (!getStyle(styleAttrib.setName("stroke"))) return rect;
+
+        double strokeWidth = 1;
+        if (getStyle(styleAttrib.setName("stroke-width"))) strokeWidth = styleAttrib.getDoubleValue();
+
+        rect.setRect(
+            rect.getX() - strokeWidth / 2,
+            rect.getY() - strokeWidth / 2,
+            rect.getWidth() + strokeWidth,
+            rect.getHeight() + strokeWidth);
+
+        return rect;
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Stop.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Stop.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Stop.java	(revision 23707)
@@ -0,0 +1,129 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.*;
+import java.util.*;
+
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Stop extends SVGElement {
+
+    float offset = 0f;
+    float opacity = 1f;
+    Color color = Color.black;
+
+    /** Creates a new instance of Stop */
+    public Stop() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String offset = attrs.getValue("offset");
+        this.offset = (float)XMLParseUtil.parseRatio(offset);
+
+        buildStop();
+    }
+    */
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("offset")))
+        {
+            offset = sty.getFloatValue();
+            String units = sty.getUnits();
+            if (units != null && units.equals("%")) offset /= 100f;
+            if (offset > 1) offset = 1;
+            if (offset < 0) offset = 0;
+        }
+        
+        if (getStyle(sty.setName("stop-color"))) color = sty.getColorValue();
+
+        if (getStyle(sty.setName("stop-opacity"))) opacity = sty.getRatioValue();
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("offset")))
+        {
+            float newVal = sty.getFloatValue();
+            if (newVal != offset)
+            {
+                offset = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("stop-color")))
+        {
+            Color newVal = sty.getColorValue();
+            if (newVal != color)
+            {
+                color = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        if (getPres(sty.setName("stop-opacity")))
+        {
+            float newVal = sty.getFloatValue();
+            if (newVal != opacity)
+            {
+                opacity = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        return shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Style.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Style.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Style.java	(revision 23707)
@@ -0,0 +1,83 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 19, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+
+/**
+ * Holds title textual information within tree
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Style extends SVGElement {
+
+    //Should be set to "text/css"
+    String type;
+    StringBuffer text = new StringBuffer();
+
+    /** Creates a new instance of Stop */
+    public Style() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        this.type = attrs.getValue("type");
+    }
+*/
+    /**
+     * Called during load process to add text scanned within a tag
+     */
+    public void loaderAddText(SVGLoaderHelper helper, String text)
+    {
+        this.text.append(text);
+    }
+
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("type"))) type = sty.getStringValue();
+    }
+    
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        //Style sheet doesn't change
+        return false;
+    }    
+    
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Symbol.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Symbol.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Symbol.java	(revision 23707)
@@ -0,0 +1,158 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.*;
+import java.awt.geom.*;
+import java.util.*;
+
+import com.kitfox.svg.xml.*;
+import org.xml.sax.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Symbol extends Group
+{
+    AffineTransform viewXform;
+    Rectangle2D viewBox;
+
+    /** Creates a new instance of Stop */
+    public Symbol() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String viewBoxStrn = attrs.getValue("viewBox");
+        if (viewBoxStrn != null)
+        {
+            float[] dim = XMLParseUtil.parseFloatList(viewBoxStrn);
+            viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
+        }
+    }
+*/
+    /*
+    public void loaderEndElement(SVGLoaderHelper helper)
+    {
+        if (viewBox == null)
+        {
+            viewBox = super.getBoundingBox();
+        }
+
+        //Transform pattern onto unit square
+        viewXform = new AffineTransform();
+        viewXform.scale(1.0 / viewBox.getWidth(), 1.0 / viewBox.getHeight());
+        viewXform.translate(-viewBox.getX(), -viewBox.getY());
+    }
+*/
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+//        sty = getPres("unicode");
+//        if (sty != null) unicode = sty.getStringValue();
+
+
+        if (getPres(sty.setName("viewBox")))
+        {
+            float[] dim = sty.getFloatList();
+            viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
+        }
+        
+        if (viewBox == null)
+        {
+//            viewBox = super.getBoundingBox();
+            viewBox = new Rectangle(0, 0, 1, 1);
+        }
+
+        //Transform pattern onto unit square
+        viewXform = new AffineTransform();
+        viewXform.scale(1.0 / viewBox.getWidth(), 1.0 / viewBox.getHeight());
+        viewXform.translate(-viewBox.getX(), -viewBox.getY());
+    }
+
+    protected boolean outsideClip(Graphics2D g) throws SVGException
+    {
+        g.getClipBounds(clipBounds);
+        Rectangle2D rect = super.getBoundingBox();
+        if (rect.intersects(clipBounds))
+        {
+            return false;
+        }
+
+        return true;
+
+    }
+
+    public void render(Graphics2D g) throws SVGException
+    {
+        AffineTransform oldXform = g.getTransform();
+        g.transform(viewXform);
+
+        super.render(g);
+
+        g.setTransform(oldXform);
+    }
+
+    public Shape getShape()
+    {
+        Shape shape = super.getShape();
+        return viewXform.createTransformedShape(shape);
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        Rectangle2D rect = super.getBoundingBox();
+        return viewXform.createTransformedShape(rect).getBounds2D();
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+        
+        //View box properties do not change
+        
+        return changeState;
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Title.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Title.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Title.java	(revision 23707)
@@ -0,0 +1,65 @@
+/*
+ * Stop.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 19, 2004, 1:56 AM
+ */
+
+package com.kitfox.svg;
+
+/**
+ * Holds title textual information within tree
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Title extends SVGElement {
+
+    StringBuffer text = new StringBuffer();
+
+    /** Creates a new instance of Stop */
+    public Title() {
+    }
+
+    /**
+     * Called during load process to add text scanned within a tag
+     */
+    public void loaderAddText(SVGLoaderHelper helper, String text)
+    {
+        this.text.append(text);
+    }
+
+    public String getText() { return text.toString(); }
+    
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        //Title does not change
+        return false;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/TransformableElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/TransformableElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/TransformableElement.java	(revision 23707)
@@ -0,0 +1,116 @@
+/*
+ * BoundedElement.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 9:00 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+
+
+/**
+ * Maintains bounding box for this element
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class TransformableElement extends SVGElement 
+{
+
+    AffineTransform xform = null;
+//    AffineTransform invXform = null;
+
+    /** Creates a new instance of BoundedElement */
+    public TransformableElement() {
+    }
+
+    public TransformableElement(String id, SVGElement parent)
+    {
+        super(id, parent);
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String transform = attrs.getValue("transform");
+        if (transform != null)
+        {
+            xform = parseTransform(transform);
+        }
+    }
+*/
+    
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("transform")))
+        {
+            xform = parseTransform(sty.getStringValue());
+        }
+    }
+    
+    protected Shape shapeToParent(Shape shape)
+    {
+        if (xform == null) return shape;
+        return xform.createTransformedShape(shape);
+    }
+
+    protected Rectangle2D boundsToParent(Rectangle2D rect)
+    {
+        if (xform == null) return rect;
+        return xform.createTransformedShape(rect).getBounds2D();
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("transform")))
+        {
+            AffineTransform newXform = parseTransform(sty.getStringValue());
+            if (!newXform.equals(xform))
+            {
+                xform = newXform;
+                return true;
+            }
+        }
+        
+        return false;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Use.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Use.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/Use.java	(revision 23707)
@@ -0,0 +1,255 @@
+/*
+ * LinearGradient.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 1:54 AM
+ */
+
+package com.kitfox.svg;
+
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.net.URI;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Use extends ShapeElement {
+
+    float x = 0f;
+    float y = 0f;
+    float width = 1f;
+    float height = 1f;
+
+    SVGElement href = null;
+
+    AffineTransform refXform;
+
+    /** Creates a new instance of LinearGradient */
+    public Use() {
+    }
+/*
+    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    {
+		//Load style string
+        super.loaderStartElement(helper, attrs, parent);
+
+        String x = attrs.getValue("x");
+        String y = attrs.getValue("y");
+        String width = attrs.getValue("width");
+        String height = attrs.getValue("height");
+        String href = attrs.getValue("xlink:href");
+
+        if (x != null) this.x = (float)XMLParseUtil.parseRatio(x);
+        if (y != null) this.y = (float)XMLParseUtil.parseRatio(y);
+        if (width != null) this.width = (float)XMLParseUtil.parseRatio(width);
+        if (height != null) this.height = (float)XMLParseUtil.parseRatio(height);
+
+
+        if (href != null)
+        {
+            try {
+                URI src = getXMLBase().resolve(href);
+                this.href = helper.universe.getElement(src);
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+
+        //Determine use offset/scale
+        refXform = new AffineTransform();
+        refXform.translate(this.x, this.y);
+        refXform.scale(this.width, this.height);
+    }
+*/
+    protected void build() throws SVGException
+    {
+        super.build();
+        
+        StyleAttribute sty = new StyleAttribute();
+        
+        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
+
+        /*if (getPres(sty.setName("xlink:href")))
+        {
+            URI src = sty.getURIValue(getXMLBase());
+            href = diagram.getUniverse().getElement(src);
+        }*/
+        
+        //Determine use offset/scale
+        refXform = new AffineTransform();
+        refXform.translate(this.x, this.y);
+    }
+    
+    public void render(Graphics2D g) throws SVGException
+    {
+        beginLayer(g);
+
+        //AffineTransform oldXform = g.getTransform();
+        AffineTransform oldXform = g.getTransform();
+        g.transform(refXform);
+
+        if (href == null || !(href instanceof RenderableElement)) return;
+
+        RenderableElement rendEle = (RenderableElement)href;
+        rendEle.pushParentContext(this);
+        rendEle.render(g);
+        rendEle.popParentContext();
+
+        g.setTransform(oldXform);
+
+        finishLayer(g);
+    }
+
+    public Shape getShape()
+    {
+        if (href instanceof ShapeElement)
+        {
+            Shape shape = ((ShapeElement)href).getShape();
+            shape = refXform.createTransformedShape(shape);
+            shape = shapeToParent(shape);
+            return shape;
+        }
+
+        return null;
+    }
+
+    public Rectangle2D getBoundingBox() throws SVGException
+    {
+        if (href instanceof ShapeElement)
+        {
+            ShapeElement shapeEle = (ShapeElement)href;
+            shapeEle.pushParentContext(this);
+            Rectangle2D bounds = shapeEle.getBoundingBox();
+            shapeEle.popParentContext();
+            
+            bounds = refXform.createTransformedShape(bounds).getBounds2D();
+            bounds = boundsToParent(bounds);
+
+            return bounds;
+        }
+
+        return null;
+    }
+
+    /**
+     * Updates all attributes in this diagram associated with a time event.
+     * Ie, all attributes with track information.
+     * @return - true if this node has changed state as a result of the time
+     * update
+     */
+    public boolean updateTime(double curTime) throws SVGException
+    {
+//        if (trackManager.getNumTracks() == 0) return false;
+        boolean changeState = super.updateTime(curTime);
+
+        //Get current values for parameters
+        StyleAttribute sty = new StyleAttribute();
+        boolean shapeChange = false;
+        
+        if (getPres(sty.setName("x")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != x)
+            {
+                x = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != y)
+            {
+                y = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != width)
+            {
+                width = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != height)
+            {
+                height = newVal;
+                shapeChange = true;
+            }
+        }
+        
+        /*if (getPres(sty.setName("xlink:href")))
+        {
+            URI src = sty.getURIValue(getXMLBase());
+            SVGElement newVal = diagram.getUniverse().getElement(src);
+            if (newVal != href)
+            {
+                href = newVal;
+                shapeChange = true;
+            }
+        }*/
+/*
+        if (getPres(sty.setName("xlink:href")))
+        {
+            URI src = sty.getURIValue(getXMLBase());
+            href = diagram.getUniverse().getElement(src);
+        }
+        
+        //Determine use offset/scale
+        refXform = new AffineTransform();
+        refXform.translate(this.x, this.y);
+        refXform.scale(this.width, this.height);
+*/        
+        if (shapeChange)
+        {
+            build();
+            //Determine use offset/scale
+//            refXform.setToTranslation(this.x, this.y);
+//            refXform.scale(this.width, this.height);
+//            return true;
+        }
+        
+        return changeState || shapeChange;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/package-info.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/package-info.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/package-info.java	(revision 23707)
@@ -0,0 +1,13 @@
+/**
+ * Provides the nodes of an SVG scene graph.  This graph can be queried, updated
+ * and picked against at runtime.  See the online docs for instructions on
+ * how to use SVGSalamander
+ *
+ * @author <a href="mailto:kitfox@kitfox.com">Mark McKay</a> (C) 2005
+ * 
+ * Package was simplified by Upliner by removing anything that is not needed
+ * for importing SVGs in JOSM
+ * <a href="xvmv@mail.ru">Upliner</a> (C) 2010
+ */
+
+package com.kitfox.svg;
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Arc.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Arc.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Arc.java	(revision 23707)
@@ -0,0 +1,245 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.*;
+import java.awt.geom.*;
+
+/**
+ * This is a little used SVG function, as most editors will save curves as 
+ * Beziers.  To reduce the need to rely on the Batik library, this functionallity
+ * is being bypassed for the time being.  In the future, it would be nice to
+ * extend the GeneralPath command to include the arcTo ability provided by Batik.
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Arc extends PathCommand 
+{
+
+    public float rx = 0f;
+    public float ry = 0f;
+    public float xAxisRot = 0f;
+    public boolean largeArc = false;
+    public boolean sweep = false;
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public Arc() {
+    }
+
+    public Arc(boolean isRelative, float rx, float ry, float xAxisRot, boolean largeArc, boolean sweep, float x, float y) {
+        super(isRelative);
+        this.rx = rx;
+        this.ry = ry;
+        this.xAxisRot = xAxisRot;
+        this.largeArc = largeArc;
+        this.sweep = sweep;
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        arcTo(path, rx, ry, xAxisRot, largeArc, sweep, x + offx, y + offy, hist.history[0].x, hist.history[0].y);
+//        path.lineTo(x + offx, y + offy);
+        hist.setPoint(x + offx, y + offy);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 6;
+    }
+
+    /**
+     * Adds an elliptical arc, defined by two radii, an angle from the
+     * x-axis, a flag to choose the large arc or not, a flag to
+     * indicate if we increase or decrease the angles and the final
+     * point of the arc.
+     *
+     * @param rx the x radius of the ellipse
+     * @param ry the y radius of the ellipse
+     *
+     * @param angle the angle from the x-axis of the current
+     * coordinate system to the x-axis of the ellipse in degrees.
+     *
+     * @param largeArcFlag the large arc flag. If true the arc
+     * spanning less than or equal to 180 degrees is chosen, otherwise
+     * the arc spanning greater than 180 degrees is chosen
+     *
+     * @param sweepFlag the sweep flag. If true the line joining
+     * center to arc sweeps through decreasing angles otherwise it
+     * sweeps through increasing angles
+     *
+     * @param x the absolute x coordinate of the final point of the arc.
+     * @param y the absolute y coordinate of the final point of the arc.
+     * @param x0 - The absolute x coordinate of the initial point of the arc.
+     * @param y0 - The absolute y coordinate of the initial point of the arc.
+     */
+    public void arcTo(GeneralPath path, float rx, float ry,
+                                   float angle,
+                                   boolean largeArcFlag,
+                                   boolean sweepFlag,
+                                   float x, float y, float x0, float y0) 
+    {
+
+        // Ensure radii are valid
+        if (rx == 0 || ry == 0) {
+            path.lineTo((float) x, (float) y);
+            return;
+        }
+
+        if (x0 == x && y0 == y) {
+            // If the endpoints (x, y) and (x0, y0) are identical, then this
+            // is equivalent to omitting the elliptical arc segment entirely.
+            return;
+        }
+
+        Arc2D arc = computeArc(x0, y0, rx, ry, angle, 
+                               largeArcFlag, sweepFlag, x, y);
+        if (arc == null) return;
+
+        AffineTransform t = AffineTransform.getRotateInstance
+            (Math.toRadians(angle), arc.getCenterX(), arc.getCenterY());
+        Shape s = t.createTransformedShape(arc);
+        path.append(s, true);
+    }
+
+
+    /** 
+     * This constructs an unrotated Arc2D from the SVG specification of an 
+     * Elliptical arc.  To get the final arc you need to apply a rotation
+     * transform such as:
+     * 
+     * AffineTransform.getRotateInstance
+     *     (angle, arc.getX()+arc.getWidth()/2, arc.getY()+arc.getHeight()/2);
+     */
+    public static Arc2D computeArc(double x0, double y0,
+                                   double rx, double ry,
+                                   double angle,
+                                   boolean largeArcFlag,
+                                   boolean sweepFlag,
+                                   double x, double y) {
+        //
+        // Elliptical arc implementation based on the SVG specification notes
+        //
+
+        // Compute the half distance between the current and the final point
+        double dx2 = (x0 - x) / 2.0;
+        double dy2 = (y0 - y) / 2.0;
+        // Convert angle from degrees to radians
+        angle = Math.toRadians(angle % 360.0);
+        double cosAngle = Math.cos(angle);
+        double sinAngle = Math.sin(angle);
+
+        //
+        // Step 1 : Compute (x1, y1)
+        //
+        double x1 = (cosAngle * dx2 + sinAngle * dy2);
+        double y1 = (-sinAngle * dx2 + cosAngle * dy2);
+        // Ensure radii are large enough
+        rx = Math.abs(rx);
+        ry = Math.abs(ry);
+        double Prx = rx * rx;
+        double Pry = ry * ry;
+        double Px1 = x1 * x1;
+        double Py1 = y1 * y1;
+        // check that radii are large enough
+        double radiiCheck = Px1/Prx + Py1/Pry;
+        if (radiiCheck > 1) {
+            rx = Math.sqrt(radiiCheck) * rx;
+            ry = Math.sqrt(radiiCheck) * ry;
+            Prx = rx * rx;
+            Pry = ry * ry;
+        }
+
+        //
+        // Step 2 : Compute (cx1, cy1)
+        //
+        double sign = (largeArcFlag == sweepFlag) ? -1 : 1;
+        double sq = ((Prx*Pry)-(Prx*Py1)-(Pry*Px1)) / ((Prx*Py1)+(Pry*Px1));
+        sq = (sq < 0) ? 0 : sq;
+        double coef = (sign * Math.sqrt(sq));
+        double cx1 = coef * ((rx * y1) / ry);
+        double cy1 = coef * -((ry * x1) / rx);
+
+        //
+        // Step 3 : Compute (cx, cy) from (cx1, cy1)
+        //
+        double sx2 = (x0 + x) / 2.0;
+        double sy2 = (y0 + y) / 2.0;
+        double cx = sx2 + (cosAngle * cx1 - sinAngle * cy1);
+        double cy = sy2 + (sinAngle * cx1 + cosAngle * cy1);
+
+        //
+        // Step 4 : Compute the angleStart (angle1) and the angleExtent (dangle)
+        //
+        double ux = (x1 - cx1) / rx;
+        double uy = (y1 - cy1) / ry;
+        double vx = (-x1 - cx1) / rx;
+        double vy = (-y1 - cy1) / ry;
+        double p, n;
+        // Compute the angle start
+        n = Math.sqrt((ux * ux) + (uy * uy));
+        p = ux; // (1 * ux) + (0 * uy)
+        sign = (uy < 0) ? -1d : 1d;
+        double angleStart = Math.toDegrees(sign * Math.acos(p / n));
+
+        // Compute the angle extent
+        n = Math.sqrt((ux * ux + uy * uy) * (vx * vx + vy * vy));
+        p = ux * vx + uy * vy;
+        sign = (ux * vy - uy * vx < 0) ? -1d : 1d;
+        double angleExtent = Math.toDegrees(sign * Math.acos(p / n));
+        if(!sweepFlag && angleExtent > 0) {
+            angleExtent -= 360f;
+        } else if (sweepFlag && angleExtent < 0) {
+            angleExtent += 360f;
+        }
+        angleExtent %= 360f;
+        angleStart %= 360f;
+
+        //
+        // We can now build the resulting Arc2D in double precision
+        //
+        Arc2D.Double arc = new Arc2D.Double();
+        arc.x = cx - rx;
+        arc.y = cy - ry;
+        arc.width = rx * 2.0;
+        arc.height = ry * 2.0;
+        arc.start = -angleStart;
+        arc.extent = -angleExtent;
+
+        return arc;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/BuildHistory.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/BuildHistory.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/BuildHistory.java	(revision 23707)
@@ -0,0 +1,62 @@
+/*
+ * BuildHistory.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 9:18 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+import java.awt.geom.Point2D;
+
+/**
+ * When building a path from command segments, most need to cache information
+ * (such as the point finished at) for future commands.  This structure allows
+ * that
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class BuildHistory {
+
+//    Point2D.Float[] history = new Point2D.Float[2];
+    Point2D.Float[] history = {new Point2D.Float(), new Point2D.Float()};
+    int length = 0;
+
+    /** Creates a new instance of BuildHistory */
+    public BuildHistory() {
+    }
+
+    public void setPoint(float x, float y)
+    {
+        history[0].setLocation(x, y);
+        length = 1;
+    }
+
+    public void setPointAndKnot(float x, float y, float kx, float ky)
+    {
+        history[0].setLocation(x, y);
+        history[1].setLocation(kx, ky);
+        length = 2;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Cubic.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Cubic.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Cubic.java	(revision 23707)
@@ -0,0 +1,74 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Cubic extends PathCommand {
+
+    public float k1x = 0f;
+    public float k1y = 0f;
+    public float k2x = 0f;
+    public float k2y = 0f;
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public Cubic() {
+    }
+
+    public Cubic(boolean isRelative, float k1x, float k1y, float k2x, float k2y, float x, float y) {
+        super(isRelative);
+        this.k1x = k1x;
+        this.k1y = k1y;
+        this.k2x = k2x;
+        this.k2y = k2y;
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        path.curveTo(k1x + offx, k1y + offy, k2x + offx, k2y + offy, x + offx, y + offy);
+        hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 6;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/CubicSmooth.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/CubicSmooth.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/CubicSmooth.java	(revision 23707)
@@ -0,0 +1,78 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class CubicSmooth extends PathCommand {
+
+    public float x = 0f;
+    public float y = 0f;
+    public float k2x = 0f;
+    public float k2y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public CubicSmooth() {
+    }
+
+    public CubicSmooth(boolean isRelative, float k2x, float k2y, float x, float y) {
+        super(isRelative);
+        this.k2x = k2x;
+        this.k2y = k2y;
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x;
+        float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y;
+        float oldX = hist.history[0].x;
+        float oldY = hist.history[0].y;
+        //Calc knot as reflection of old knot
+        float k1x = oldX * 2f - oldKx;
+        float k1y = oldY * 2f - oldKy;
+
+        path.curveTo(k1x, k1y, k2x + offx, k2y + offy, x + offx, y + offy);
+        hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+    }
+    
+    public int getNumKnotsAdded()
+    {
+        return 6;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Horizontal.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Horizontal.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Horizontal.java	(revision 23707)
@@ -0,0 +1,65 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Horizontal extends PathCommand {
+
+    public float x = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public Horizontal() {
+    }
+
+    public Horizontal(boolean isRelative, float x) {
+        super(isRelative);
+        this.x = x;
+    }
+
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = hist.history[0].y;
+
+        path.lineTo(x + offx, offy);
+        hist.setPoint(x + offx, offy);
+    }
+    
+    public int getNumKnotsAdded()
+    {
+        return 2;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/LineTo.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/LineTo.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/LineTo.java	(revision 23707)
@@ -0,0 +1,67 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class LineTo extends PathCommand {
+
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public LineTo() {
+    }
+
+    public LineTo(boolean isRelative, float x, float y) {
+        super(isRelative);
+        this.x = x;
+        this.y = y;
+    }
+
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        path.lineTo(x + offx, y + offy);
+        hist.setPoint(x + offx, y + offy);
+    }
+    
+    public int getNumKnotsAdded()
+    {
+        return 2;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/MoveTo.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/MoveTo.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/MoveTo.java	(revision 23707)
@@ -0,0 +1,66 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class MoveTo extends PathCommand {
+
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public MoveTo() {
+    }
+
+    public MoveTo(boolean isRelative, float x, float y) {
+        super(isRelative);
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        path.moveTo(x + offx, y + offy);
+        hist.setPoint(x + offx, y + offy);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 2;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathCommand.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathCommand.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathCommand.java	(revision 23707)
@@ -0,0 +1,56 @@
+/*
+ * PathCommand.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:39 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * This is the element of a path and contains instructions for rendering a
+ * portion of the path
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+abstract public class PathCommand {
+
+    public boolean isRelative = false;
+
+    /** Creates a new instance of PathCommand */
+    public PathCommand() {
+    }
+
+    public PathCommand(boolean isRelative) {
+        this.isRelative = isRelative;
+    }
+
+//    abstract public void appendPath(ExtendedGeneralPath path, BuildHistory hist);
+    abstract public void appendPath(GeneralPath path, BuildHistory hist);
+
+    abstract public int getNumKnotsAdded();
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathUtil.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathUtil.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/PathUtil.java	(revision 23707)
@@ -0,0 +1,72 @@
+/*
+ * PathUtil.java
+ *
+ * Created on May 10, 2005, 5:56 AM
+ *
+ * To change this template, choose Tools | Options and locate the template under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package com.kitfox.svg.pathcmd;
+
+import java.awt.geom.*;
+
+/**
+ *
+ * @author kitfox
+ */
+public class PathUtil
+{
+    
+    /** Creates a new instance of PathUtil */
+    public PathUtil()
+    {
+    }
+    
+    /**
+     * Converts a GeneralPath into an SVG representation
+     */
+    public static String buildPathString(GeneralPath path)
+    {
+        float[] coords = new float[6];
+        
+        StringBuffer sb = new StringBuffer();
+        
+        for (PathIterator pathIt = path.getPathIterator(new AffineTransform()); !pathIt.isDone(); pathIt.next())
+        {
+            int segId = pathIt.currentSegment(coords);
+            
+            switch (segId)
+            {
+                case PathIterator.SEG_CLOSE:
+                {
+                    sb.append(" Z");
+                    break;
+                }
+                case PathIterator.SEG_CUBICTO:
+                {
+                    sb.append(" C " + coords[0] + " " + coords[1] + " " + coords[2] + " " + coords[3] + " " + coords[4] + " " + coords[5]);
+                    break;
+                }
+                case PathIterator.SEG_LINETO:
+                {
+                    sb.append(" L " + coords[0] + " " + coords[1]);
+                    break;
+                }
+                case PathIterator.SEG_MOVETO:
+                {
+                    sb.append(" M " + coords[0] + " " + coords[1]);
+                    break;
+                }
+                case PathIterator.SEG_QUADTO:
+                {
+                    sb.append(" Q " + coords[0] + " " + coords[1] + " " + coords[2] + " " + coords[3]);
+                    break;
+                }
+            }
+        }
+        
+        return sb.toString();
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Quadratic.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Quadratic.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Quadratic.java	(revision 23707)
@@ -0,0 +1,70 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Quadratic extends PathCommand {
+
+    public float kx = 0f;
+    public float ky = 0f;
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public Quadratic() {
+    }
+
+    public Quadratic(boolean isRelative, float kx, float ky, float x, float y) {
+        super(isRelative);
+        this.kx = kx;
+        this.ky = ky;
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        path.quadTo(kx + offx, ky + offy, x + offx, y + offy);
+        hist.setPointAndKnot(x + offx, y + offy, kx + offx, ky + offy);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 4;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java	(revision 23707)
@@ -0,0 +1,74 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class QuadraticSmooth extends PathCommand {
+
+    public float x = 0f;
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public QuadraticSmooth() {
+    }
+
+    public QuadraticSmooth(boolean isRelative, float x, float y) {
+        super(isRelative);
+        this.x = x;
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = isRelative ? hist.history[0].x : 0f;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x;
+        float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y;
+        float oldX = hist.history[0].x;
+        float oldY = hist.history[0].y;
+        //Calc knot as reflection of old knot
+        float kx = oldX * 2f - oldKx;
+        float ky = oldY * 2f - oldKy;
+
+        path.quadTo(kx, ky, x + offx, y + offy);
+        hist.setPointAndKnot(x + offx, y + offy, kx, ky);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 4;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Terminal.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Terminal.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Terminal.java	(revision 23707)
@@ -0,0 +1,56 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * Finishes a path
+ *
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Terminal extends PathCommand {
+
+    /** Creates a new instance of MoveTo */
+    public Terminal() {
+    }
+
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        path.closePath();
+    }
+    
+    public int getNumKnotsAdded()
+    {
+        return 0;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Vertical.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Vertical.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/pathcmd/Vertical.java	(revision 23707)
@@ -0,0 +1,64 @@
+/*
+ * MoveTo.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 8:40 PM
+ */
+
+package com.kitfox.svg.pathcmd;
+
+//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.geom.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class Vertical extends PathCommand {
+
+    public float y = 0f;
+
+    /** Creates a new instance of MoveTo */
+    public Vertical() {
+    }
+
+    public Vertical(boolean isRelative, float y) {
+        super(isRelative);
+        this.y = y;
+    }
+
+//    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
+    public void appendPath(GeneralPath path, BuildHistory hist)
+    {
+        float offx = hist.history[0].x;
+        float offy = isRelative ? hist.history[0].y : 0f;
+
+        path.lineTo(offx, y + offy);
+        hist.setPoint(offx, y + offy);
+    }
+
+    public int getNumKnotsAdded()
+    {
+        return 2;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64InputStream.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64InputStream.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64InputStream.java	(revision 23707)
@@ -0,0 +1,82 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.kitfox.svg.xml;
+
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ *
+ * @author kitfox
+ */
+public class Base64InputStream extends FilterInputStream
+{
+    int buf;  //Cached bytes to read
+    int bufSize;  //Number of bytes waiting to be read from buffer
+    boolean drain = false;  //After set, read no more chunks
+    
+    public Base64InputStream(InputStream in)
+    {
+        super(in);
+    }
+
+    public int read() throws IOException
+    {
+        if (drain && bufSize == 0)
+        {
+            return -1;
+        }
+        
+        if (bufSize == 0)
+        {
+            //Read next chunk into 4 byte buffer
+            int chunk = in.read();
+            if (chunk == -1)
+            {
+                drain = true;
+                return -1;
+            }
+            
+            //get remaining 3 bytes
+            for (int i = 0; i < 3; ++i)
+            {
+                int value = in.read();
+                if (value == -1)
+                {
+                    throw new IOException("Early termination of base64 stream");
+                }
+                chunk = (chunk << 8) | (value & 0xff);
+            }
+
+            //Check for special termination characters
+            if ((chunk & 0xffff) == (((byte)'=' << 8) | (byte)'='))
+            {
+                bufSize = 1;
+                drain = true;
+            }
+            else if ((chunk & 0xff) == (byte)'=')
+            {
+                bufSize = 2;
+                drain = true;
+            }
+            else
+            {
+                bufSize = 3;
+            }
+            
+            //Fill buffer with decoded characters
+            for (int i = 0; i < bufSize + 1; ++i)
+            {
+                buf = (buf << 6) | Base64Util.decodeByte((chunk >> 24) & 0xff);
+                chunk <<= 8;
+            }
+        }
+        
+        //Return nth remaing bte & decrement counter
+        return (buf >> (--bufSize * 8)) & 0xff;
+    } 
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64OutputStream.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64OutputStream.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64OutputStream.java	(revision 23707)
@@ -0,0 +1,90 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.kitfox.svg.xml;
+
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ *
+ * @author kitfox
+ */
+public class Base64OutputStream extends FilterOutputStream
+{
+    int buf;
+    int numBytes;
+    int numChunks;
+    
+    public Base64OutputStream(OutputStream out)
+    {
+        super(out);
+    }
+    
+    public void flush() throws IOException
+    {
+        out.flush();
+    }
+    
+    public void close() throws IOException
+    {
+        switch (numBytes)
+        {
+            case 1:
+                buf <<= 4;
+                out.write(getBase64Byte(1));
+                out.write(getBase64Byte(0));
+                out.write('=');
+                out.write('=');
+                break;
+            case 2:
+                buf <<= 2;
+                out.write(getBase64Byte(2));
+                out.write(getBase64Byte(1));
+                out.write(getBase64Byte(0));
+                out.write('=');
+                break;
+            case 3:
+                out.write(getBase64Byte(3));
+                out.write(getBase64Byte(2));
+                out.write(getBase64Byte(1));
+                out.write(getBase64Byte(0));
+                break;
+            default:
+                assert false;
+        }
+        
+        out.close();
+    }
+    
+    public void write(int b) throws IOException
+    {
+        buf = (buf << 8) | (0xff & b);
+        numBytes++;
+        
+        if (numBytes == 3)
+        {
+            out.write(getBase64Byte(3));
+            out.write(getBase64Byte(2));
+            out.write(getBase64Byte(1));
+            out.write(getBase64Byte(0));
+            
+            numBytes = 0;
+            numChunks++;
+            if (numChunks == 16)
+            {
+//                out.write('\r');
+//                out.write('\n');
+                numChunks = 0;
+            }
+        }
+    }
+    
+    public byte getBase64Byte(int index)
+    {
+        return Base64Util.encodeByte((buf >> (index * 6)) & 0x3f);
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64Util.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64Util.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/Base64Util.java	(revision 23707)
@@ -0,0 +1,32 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.kitfox.svg.xml;
+
+/**
+ *
+ * @author kitfox
+ */
+public class Base64Util 
+{
+    static final byte[] valueToBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes();
+    static final byte[] base64ToValue = new byte[128];
+    static {
+        for (int i = 0; i < valueToBase64.length; ++i)
+        {
+            base64ToValue[valueToBase64[i]] = (byte)i;
+        }
+    }
+    
+    static public byte encodeByte(int value)
+    {
+        return valueToBase64[value];
+    }
+    
+    static public byte decodeByte(int base64Char)
+    {
+        return base64ToValue[base64Char];
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ColorTable.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ColorTable.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ColorTable.java	(revision 23707)
@@ -0,0 +1,283 @@
+/*
+ * ColorTable.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 26, 2004, 4:34 AM
+ */
+
+package com.kitfox.svg.xml;
+
+import java.awt.*;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class ColorTable 
+{
+
+    static final Map colorTable;
+    static {
+        HashMap table = new HashMap();
+
+	//We really should be interpreting the currentColor keyword as 
+        // a reference to the referring node's color, but this quick hack 
+        // will stop the program from crashing.
+        table.put("currentcolor", new Color(0x0));
+
+        table.put("aliceblue", new Color(0xf0f8ff));
+        table.put("antiquewhite", new Color(0xfaebd7));
+        table.put("aqua", new Color(0x00ffff));
+        table.put("aquamarine", new Color(0x7fffd4));
+        table.put("azure", new Color(0xf0ffff));
+        table.put("beige", new Color(0xf5f5dc));
+        table.put("bisque", new Color(0xffe4c4));
+        table.put("black", new Color(0x000000));
+        table.put("blanchedalmond", new Color(0xffebcd));
+        table.put("blue", new Color(0x0000ff));
+        table.put("blueviolet", new Color(0x8a2be2));
+        table.put("brown", new Color(0xa52a2a));
+        table.put("burlywood", new Color(0xdeb887));
+        table.put("cadetblue", new Color(0x5f9ea0));
+        table.put("chartreuse", new Color(0x7fff00));
+        table.put("chocolate", new Color(0xd2691e));
+        table.put("coral", new Color(0xff7f50));
+        table.put("cornflowerblue", new Color(0x6495ed));
+        table.put("cornsilk", new Color(0xfff8dc));
+        table.put("crimson", new Color(0xdc143c));
+        table.put("cyan", new Color(0x00ffff));
+        table.put("darkblue", new Color(0x00008b));
+        table.put("darkcyan", new Color(0x008b8b));
+        table.put("darkgoldenrod", new Color(0xb8860b));
+        table.put("darkgray", new Color(0xa9a9a9));
+        table.put("darkgreen", new Color(0x006400));
+        table.put("darkkhaki", new Color(0xbdb76b));
+        table.put("darkmagenta", new Color(0x8b008b));
+        table.put("darkolivegreen", new Color(0x556b2f));
+        table.put("darkorange", new Color(0xff8c00));
+        table.put("darkorchid", new Color(0x9932cc));
+        table.put("darkred", new Color(0x8b0000));
+        table.put("darksalmon", new Color(0xe9967a));
+        table.put("darkseagreen", new Color(0x8fbc8f));
+        table.put("darkslateblue", new Color(0x483d8b));
+        table.put("darkslategray", new Color(0x2f4f4f));
+        table.put("darkturquoise", new Color(0x00ced1));
+        table.put("darkviolet", new Color(0x9400d3));
+        table.put("deeppink", new Color(0xff1493));
+        table.put("deepskyblue", new Color(0x00bfff));
+        table.put("dimgray", new Color(0x696969));
+        table.put("dodgerblue", new Color(0x1e90ff));
+        table.put("feldspar", new Color(0xd19275));
+        table.put("firebrick", new Color(0xb22222));
+        table.put("floralwhite", new Color(0xfffaf0));
+        table.put("forestgreen", new Color(0x228b22));
+        table.put("fuchsia", new Color(0xff00ff));
+        table.put("gainsboro", new Color(0xdcdcdc));
+        table.put("ghostwhite", new Color(0xf8f8ff));
+        table.put("gold", new Color(0xffd700));
+        table.put("goldenrod", new Color(0xdaa520));
+        table.put("gray", new Color(0x808080));
+        table.put("green", new Color(0x008000));
+        table.put("greenyellow", new Color(0xadff2f));
+        table.put("honeydew", new Color(0xf0fff0));
+        table.put("hotpink", new Color(0xff69b4));
+        table.put("indianred", new Color(0xcd5c5c));
+        table.put("indigo", new Color(0x4b0082));
+        table.put("ivory", new Color(0xfffff0));
+        table.put("khaki", new Color(0xf0e68c));
+        table.put("lavender", new Color(0xe6e6fa));
+        table.put("lavenderblush", new Color(0xfff0f5));
+        table.put("lawngreen", new Color(0x7cfc00));
+        table.put("lemonchiffon", new Color(0xfffacd));
+        table.put("lightblue", new Color(0xadd8e6));
+        table.put("lightcoral", new Color(0xf08080));
+        table.put("lightcyan", new Color(0xe0ffff));
+        table.put("lightgoldenrodyellow", new Color(0xfafad2));
+        table.put("lightgrey", new Color(0xd3d3d3));
+        table.put("lightgreen", new Color(0x90ee90));
+        table.put("lightpink", new Color(0xffb6c1));
+        table.put("lightsalmon", new Color(0xffa07a));
+        table.put("lightseagreen", new Color(0x20b2aa));
+        table.put("lightskyblue", new Color(0x87cefa));
+        table.put("lightslateblue", new Color(0x8470ff));
+        table.put("lightslategray", new Color(0x778899));
+        table.put("lightsteelblue", new Color(0xb0c4de));
+        table.put("lightyellow", new Color(0xffffe0));
+        table.put("lime", new Color(0x00ff00));
+        table.put("limegreen", new Color(0x32cd32));
+        table.put("linen", new Color(0xfaf0e6));
+        table.put("magenta", new Color(0xff00ff));
+        table.put("maroon", new Color(0x800000));
+        table.put("mediumaquamarine", new Color(0x66cdaa));
+        table.put("mediumblue", new Color(0x0000cd));
+        table.put("mediumorchid", new Color(0xba55d3));
+        table.put("mediumpurple", new Color(0x9370d8));
+        table.put("mediumseagreen", new Color(0x3cb371));
+        table.put("mediumslateblue", new Color(0x7b68ee));
+        table.put("mediumspringgreen", new Color(0x00fa9a));
+        table.put("mediumturquoise", new Color(0x48d1cc));
+        table.put("mediumvioletred", new Color(0xc71585));
+        table.put("midnightblue", new Color(0x191970));
+        table.put("mintcream", new Color(0xf5fffa));
+        table.put("mistyrose", new Color(0xffe4e1));
+        table.put("moccasin", new Color(0xffe4b5));
+        table.put("navajowhite", new Color(0xffdead));
+        table.put("navy", new Color(0x000080));
+        table.put("oldlace", new Color(0xfdf5e6));
+        table.put("olive", new Color(0x808000));
+        table.put("olivedrab", new Color(0x6b8e23));
+        table.put("orange", new Color(0xffa500));
+        table.put("orangered", new Color(0xff4500));
+        table.put("orchid", new Color(0xda70d6));
+        table.put("palegoldenrod", new Color(0xeee8aa));
+        table.put("palegreen", new Color(0x98fb98));
+        table.put("paleturquoise", new Color(0xafeeee));
+        table.put("palevioletred", new Color(0xd87093));
+        table.put("papayawhip", new Color(0xffefd5));
+        table.put("peachpuff", new Color(0xffdab9));
+        table.put("peru", new Color(0xcd853f));
+        table.put("pink", new Color(0xffc0cb));
+        table.put("plum", new Color(0xdda0dd));
+        table.put("powderblue", new Color(0xb0e0e6));
+        table.put("purple", new Color(0x800080));
+        table.put("red", new Color(0xff0000));
+        table.put("rosybrown", new Color(0xbc8f8f));
+        table.put("royalblue", new Color(0x4169e1));
+        table.put("saddlebrown", new Color(0x8b4513));
+        table.put("salmon", new Color(0xfa8072));
+        table.put("sandybrown", new Color(0xf4a460));
+        table.put("seagreen", new Color(0x2e8b57));
+        table.put("seashell", new Color(0xfff5ee));
+        table.put("sienna", new Color(0xa0522d));
+        table.put("silver", new Color(0xc0c0c0));
+        table.put("skyblue", new Color(0x87ceeb));
+        table.put("slateblue", new Color(0x6a5acd));
+        table.put("slategray", new Color(0x708090));
+        table.put("snow", new Color(0xfffafa));
+        table.put("springgreen", new Color(0x00ff7f));
+        table.put("steelblue", new Color(0x4682b4));
+        table.put("tan", new Color(0xd2b48c));
+        table.put("teal", new Color(0x008080));
+        table.put("thistle", new Color(0xd8bfd8));
+        table.put("tomato", new Color(0xff6347));
+        table.put("turquoise", new Color(0x40e0d0));
+        table.put("violet", new Color(0xee82ee));
+        table.put("violetred", new Color(0xd02090));
+        table.put("wheat", new Color(0xf5deb3));
+        table.put("white", new Color(0xffffff));
+        table.put("whitesmoke", new Color(0xf5f5f5));
+        table.put("yellow", new Color(0xffff00));
+        table.put("yellowgreen", new Color(0x9acd32));
+        
+        colorTable = Collections.unmodifiableMap(table);
+    }
+
+    static ColorTable singleton = new ColorTable();
+
+    /** Creates a new instance of ColorTable */
+    protected ColorTable() {
+//        buildColorList();
+    }
+
+    static public ColorTable instance() { return singleton; }
+
+    public Color lookupColor(String name) {
+        Object obj = colorTable.get(name.toLowerCase());
+        if (obj == null) return null;
+
+        return (Color)obj;
+    }
+
+    public static Color parseColor(String val)
+    {
+        Color retVal = null;
+
+        if (val.charAt(0) == '#')
+        {
+            String hexStrn = val.substring(1);
+            
+            if (hexStrn.length() == 3)
+            {
+                hexStrn = "" + hexStrn.charAt(0) + hexStrn.charAt(0) + hexStrn.charAt(1) + hexStrn.charAt(1) + hexStrn.charAt(2) + hexStrn.charAt(2);
+            }
+            int hexVal = parseHex(hexStrn);
+
+            retVal = new Color(hexVal);
+        }
+        else
+        {
+            final String number = "\\s*(((\\d+)(\\.\\d*)?)|(\\.\\d+))(%)?\\s*";
+            final Matcher rgbMatch = Pattern.compile("rgb\\(" + number + "," + number + "," + number + "\\)", Pattern.CASE_INSENSITIVE).matcher("");
+
+            rgbMatch.reset(val);
+            if (rgbMatch.matches())
+            {
+                float rr = Float.parseFloat(rgbMatch.group(1));
+                float gg = Float.parseFloat(rgbMatch.group(7));
+                float bb = Float.parseFloat(rgbMatch.group(13));
+                rr /= "%".equals(rgbMatch.group(6)) ? 100 : 255;
+                gg /= "%".equals(rgbMatch.group(12)) ? 100 : 255;
+                bb /= "%".equals(rgbMatch.group(18)) ? 100 : 255;
+                retVal = new Color(rr, gg, bb);
+            }
+            else
+            {
+                Color lookupCol = ColorTable.instance().lookupColor(val);
+                if (lookupCol != null) retVal = lookupCol;
+            }
+        }
+
+        return retVal;
+    }
+
+    public static int parseHex(String val)
+    {
+        int retVal = 0;
+        
+        for (int i = 0; i < val.length(); i++)
+        {
+            retVal <<= 4;
+            
+            char ch = val.charAt(i);
+            if (ch >= '0' && ch <= '9')
+            {
+                retVal |= ch - '0';
+            }
+            else if (ch >= 'a' && ch <= 'z')
+            {
+                retVal |= ch - 'a' + 10;
+            }
+            else if (ch >= 'A' && ch <= 'Z')
+            {
+                retVal |= ch - 'A' + 10;
+            }
+            else throw new RuntimeException();
+        }
+        
+        return retVal;
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/NumberWithUnits.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/NumberWithUnits.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/NumberWithUnits.java	(revision 23707)
@@ -0,0 +1,148 @@
+/*
+ * NumberWithUnits.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 2:43 PM
+ */
+
+package com.kitfox.svg.xml;
+
+import java.io.Serializable;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class NumberWithUnits implements Serializable
+{
+    public static final long serialVersionUID = 0;
+    
+    public static final int UT_UNITLESS = 0;
+    public static final int UT_PX = 1;  //Pixels
+    public static final int UT_CM = 2;  //Centimeters
+    public static final int UT_MM = 3;  //Millimeters
+    public static final int UT_IN = 4;  //Inches
+    public static final int UT_EM = 5;  //Default font height
+    public static final int UT_EX = 6;  //Height of character 'x' in default font
+    public static final int UT_PT = 7;  //Points - 1/72 of an inch
+    public static final int UT_PC = 8;  //Picas - 1/6 of an inch
+    public static final int UT_PERCENT = 9;  //Percent - relative width
+
+    float value = 0f;
+    int unitType = UT_UNITLESS;
+
+    /** Creates a new instance of NumberWithUnits */
+    public NumberWithUnits()
+    {
+    }
+
+    public NumberWithUnits(String value)
+    {
+        set(value);
+    }
+
+    public NumberWithUnits(float value, int unitType)
+    {
+        this.value = value;
+        this.unitType = unitType;
+    }
+
+    public float getValue() { return value; }
+    public int getUnits() { return unitType; }
+
+    public void set(String value)
+    {
+        this.value = XMLParseUtil.findFloat(value);
+        unitType = UT_UNITLESS;
+
+        if (value.indexOf("px") != -1) { unitType = UT_PX; return; }
+        if (value.indexOf("cm") != -1) { unitType = UT_CM; return; }
+        if (value.indexOf("mm") != -1) { unitType = UT_MM; return; }
+        if (value.indexOf("in") != -1) { unitType = UT_IN; return; }
+        if (value.indexOf("em") != -1) { unitType = UT_EM; return; }
+        if (value.indexOf("ex") != -1) { unitType = UT_EX; return; }
+        if (value.indexOf("pt") != -1) { unitType = UT_PT; return; }
+        if (value.indexOf("pc") != -1) { unitType = UT_PC; return; }
+        if (value.indexOf("%") != -1) { unitType = UT_PERCENT; return; }
+    }
+
+    public static String unitsAsString(int unitIdx)
+    {
+        switch (unitIdx)
+        {
+            default:
+                return "";
+            case UT_PX:
+                return "px";
+            case UT_CM:
+                return "cm";
+            case UT_MM:
+                return "mm";
+            case UT_IN:
+                return "in";
+            case UT_EM:
+                return "em";
+            case UT_EX:
+                return "ex";
+            case UT_PT:
+                return "pt";
+            case UT_PC:
+                return "pc";
+            case UT_PERCENT:
+                return "%";
+        }
+    }
+
+    public String toString()
+    {
+        return "" + value + unitsAsString(unitType);
+    }
+
+    public boolean equals(Object obj)
+    {
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final NumberWithUnits other = (NumberWithUnits) obj;
+        if (Float.floatToIntBits(this.value) != Float.floatToIntBits(other.value)) {
+            return false;
+        }
+        if (this.unitType != other.unitType) {
+            return false;
+        }
+        return true;
+    }
+
+    public int hashCode()
+    {
+        int hash = 5;
+        hash = 37 * hash + Float.floatToIntBits(this.value);
+        hash = 37 * hash + this.unitType;
+        return hash;
+    }
+
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ReadableXMLElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ReadableXMLElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/ReadableXMLElement.java	(revision 23707)
@@ -0,0 +1,48 @@
+/*
+ * LoadableObject.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 1, 2003, 1:46 AM
+ */
+
+package com.kitfox.svg.xml;
+
+import org.w3c.dom.*;
+import java.net.*;
+import java.util.*;
+import java.lang.reflect.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public interface ReadableXMLElement {
+
+    /**
+     * Initializes this element from the passed DOM tree.
+     * @param root - DOM tree to build from
+     * @param docRoot - URL of the document this DOM tree was created from
+     */
+    public void read(Element root, URL docRoot);
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/StyleAttribute.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/StyleAttribute.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/StyleAttribute.java	(revision 23707)
@@ -0,0 +1,290 @@
+/*
+ * StyleAttribute.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on January 27, 2004, 2:53 PM
+ */
+
+package com.kitfox.svg.xml;
+
+import java.awt.*;
+import java.net.*;
+import java.io.*;
+import java.util.regex.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class StyleAttribute implements Serializable
+{
+    public static final long serialVersionUID = 0;
+
+    static final Matcher matchUrl = Pattern.compile("\\s*url\\((.*)\\)\\s*").matcher("");
+    static final Matcher matchFpNumUnits = Pattern.compile("\\s*([-+]?((\\d*\\.\\d+)|(\\d+))([-+]?[eE]\\d+)?)\\s*(px|cm|mm|in|pc|pt|em|ex)\\s*").matcher("");
+    
+    String name;
+    String stringValue;
+
+    boolean colorCompatable = false;
+    boolean urlCompatable = false;
+
+    /** Creates a new instance of StyleAttribute */
+    public StyleAttribute()
+    {
+        this(null, null);
+    }
+    
+    public StyleAttribute(String name) 
+    {
+        this.name = name;
+        stringValue = null;
+    }
+
+    public StyleAttribute(String name, String stringValue) 
+    {
+        this.name = name;
+        this.stringValue = stringValue;
+    }
+
+    public String getName() { return name; }
+    public StyleAttribute setName(String name) { this.name = name; return this; }
+    
+    public String getStringValue() { return stringValue; }
+
+    public String[] getStringList() 
+    { 
+        return XMLParseUtil.parseStringList(stringValue);
+    }
+
+    public void setStringValue(String value)
+    {
+        stringValue = value;
+    }
+
+    public boolean getBooleanValue() {
+        return stringValue.toLowerCase().equals("true");
+    }
+
+    public int getIntValue() {
+        return XMLParseUtil.findInt(stringValue);
+    }
+
+    public int[] getIntList() {
+        return XMLParseUtil.parseIntList(stringValue);
+    }
+
+    public double getDoubleValue() {
+        return XMLParseUtil.findDouble(stringValue);
+    }
+
+    public double[] getDoubleList() {
+        return XMLParseUtil.parseDoubleList(stringValue);
+    }
+
+    public float getFloatValue() {
+        return XMLParseUtil.findFloat(stringValue);
+    }
+
+    public float[] getFloatList() {
+        return XMLParseUtil.parseFloatList(stringValue);
+    }
+
+    public float getRatioValue() {
+        return (float)XMLParseUtil.parseRatio(stringValue);
+//        try { return Float.parseFloat(stringValue); }
+//        catch (Exception e) {}
+//        return 0f;
+    }
+
+    public String getUnits() {
+        matchFpNumUnits.reset(stringValue);
+        if (!matchFpNumUnits.matches()) return null;
+        return matchFpNumUnits.group(6);
+    }
+
+    public NumberWithUnits getNumberWithUnits() {
+        return XMLParseUtil.parseNumberWithUnits(stringValue);
+    }
+
+    public float getFloatValueWithUnits()
+    {
+        NumberWithUnits number = getNumberWithUnits();
+        return convertUnitsToPixels(number.getUnits(), number.getValue());
+    }
+    
+    static public float convertUnitsToPixels(int unitType, float value)
+    {
+        if (unitType == NumberWithUnits.UT_UNITLESS || unitType == NumberWithUnits.UT_PERCENT)
+        {
+            return value;
+        }
+        
+        float pixPerInch;
+        try 
+        {
+            pixPerInch = (float)Toolkit.getDefaultToolkit().getScreenResolution();
+        }
+        catch (HeadlessException ex)
+        {
+            //default to 72 dpi
+            pixPerInch = 72;
+        }
+        final float inchesPerCm = .3936f;
+
+        switch (unitType)
+        {
+            case NumberWithUnits.UT_IN:
+                return value * pixPerInch;
+            case NumberWithUnits.UT_CM:
+                return value * inchesPerCm * pixPerInch;
+            case NumberWithUnits.UT_MM:
+                return value * .1f * inchesPerCm * pixPerInch;
+            case NumberWithUnits.UT_PT:
+                return value * (1f / 72f) * pixPerInch;
+            case NumberWithUnits.UT_PC:
+                return value *  (1f / 6f) * pixPerInch;
+        }
+
+        return value;
+    }
+
+    public Color getColorValue()
+    {
+        return ColorTable.parseColor(stringValue);
+    }
+
+    public String parseURLFn()
+    {
+        matchUrl.reset(stringValue);
+        if (!matchUrl.matches()) return null;
+        return matchUrl.group(1);
+    }
+
+    public URL getURLValue(URL docRoot)
+    {
+        String fragment = parseURLFn();
+        if (fragment == null) return null;
+        try {
+            return new URL(docRoot, fragment);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public URL getURLValue(URI docRoot)
+    {
+        String fragment = parseURLFn();
+        if (fragment == null) return null;
+        try {
+            URI ref = docRoot.resolve(fragment);
+            return ref.toURL();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    public URI getURIValue()
+    {
+        return getURIValue(null);
+    }
+    
+    /**
+     * Parse this sytle attribute as a URL and return it in URI form resolved
+     * against the passed base.
+     *
+     * @param base - URI to resolve against.  If null, will return value without
+     * attempting to resolve it.
+     */
+    public URI getURIValue(URI base)
+    {
+        try {
+            String fragment = parseURLFn();
+            if (fragment == null) fragment = stringValue.replaceAll("\\s+", "");
+            if (fragment == null) return null;
+            
+            //======================
+            //This gets around a bug in the 1.5.0 JDK
+            if (Pattern.matches("[a-zA-Z]:!\\\\.*", fragment))
+            {
+                File file = new File(fragment);
+                return file.toURI();
+            }
+            //======================
+
+            //[scheme:]scheme-specific-part[#fragment]
+            
+            URI uriFrag = new URI(fragment);
+            if (uriFrag.isAbsolute())
+            {
+                //Has scheme
+                return uriFrag;
+            }
+        
+            if (base == null) return uriFrag;
+        
+            URI relBase = new URI(null, base.getSchemeSpecificPart(), null);
+            URI relUri;
+            if (relBase.isOpaque())
+            {
+                relUri = new URI(null, base.getSchemeSpecificPart(), uriFrag.getFragment());
+            }
+            else
+            {
+                relUri = relBase.resolve(uriFrag);
+            }
+            return new URI(base.getScheme() + ":" + relUri);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            return null;
+        }
+    }
+    
+    public static void main(String[] args)
+    {
+        try
+        {
+            URI uri = new URI("jar:http://www.kitfox.com/jackal/jackal.jar!/res/doc/about.svg");
+            uri = uri.resolve("#myFragment");
+            
+            System.err.println(uri.toString());
+            
+            uri = new URI("http://www.kitfox.com/jackal/jackal.html");
+            uri = uri.resolve("#myFragment");
+            
+            System.err.println(uri.toString());
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/WritableXMLElement.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/WritableXMLElement.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/WritableXMLElement.java	(revision 23707)
@@ -0,0 +1,48 @@
+/*
+ * LoadableObject.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on September 1, 2003, 1:46 AM
+ */
+
+package com.kitfox.svg.xml;
+
+import org.w3c.dom.*;
+import java.net.*;
+import java.util.*;
+import java.lang.reflect.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public interface WritableXMLElement {
+
+    /**
+     * Initializes this element from the passed DOM tree.
+     * @param root - DOM tree to build from
+     * @param docRoot - URL of the document this DOM tree was created from
+     */
+//    public void write(Element root, URL docRoot);
+
+}
Index: /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/XMLParseUtil.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/XMLParseUtil.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/com/kitfox/svg/xml/XMLParseUtil.java	(revision 23707)
@@ -0,0 +1,815 @@
+/*
+ * XMLParseUtil.java
+ *
+ *
+ *  The Salamander Project - 2D and 3D graphics libraries in Java
+ *  Copyright (C) 2004 Mark McKay
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ *  projects can be found at http://www.kitfox.com
+ *
+ * Created on February 18, 2004, 1:49 PM
+ */
+
+package com.kitfox.svg.xml;
+
+import org.w3c.dom.*;
+import java.awt.*;
+import java.net.*;
+import java.util.*;
+import java.util.regex.*;
+import java.lang.reflect.*;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class XMLParseUtil
+{
+    static final Matcher fpMatch = Pattern.compile("([-+]?((\\d*\\.\\d+)|(\\d+))([eE][+-]?\\d+)?)(\\%|in|cm|mm|pt|pc|px|em|ex)?").matcher("");
+    static final Matcher intMatch = Pattern.compile("[-+]?\\d+").matcher("");
+
+    /** Creates a new instance of XMLParseUtil */
+    private XMLParseUtil()
+    {
+    }
+
+    /**
+     * Scans the tag's children and returns the first text element found
+     */
+    public static String getTagText(Element ele)
+    {
+        NodeList nl = ele.getChildNodes();
+        int size = nl.getLength();
+
+        Node node = null;
+        int i = 0;
+        for (; i < size; i++)
+        {
+            node = nl.item(i);
+            if (node instanceof Text) break;
+        }
+        if (i == size || node == null) return null;
+
+        return ((Text)node).getData();
+    }
+
+    /**
+     * Returns the first node that is a direct child of root with the coresponding
+     * name.  Does not search children of children.
+     */
+    public static Element getFirstChild(Element root, String name)
+    {
+        NodeList nl = root.getChildNodes();
+        int size = nl.getLength();
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (ele.getTagName().equals(name)) return ele;
+        }
+
+        return null;
+    }
+
+    public static String[] parseStringList(String list)
+    {
+//        final Pattern patWs = Pattern.compile("\\s+");
+        final Matcher matchWs = Pattern.compile("[^\\s]+").matcher("");
+        matchWs.reset(list);
+
+        LinkedList matchList = new LinkedList();
+        while (matchWs.find())
+        {
+            matchList.add(matchWs.group());
+        }
+
+        String[] retArr = new String[matchList.size()];
+        return (String[])matchList.toArray(retArr);
+    }
+
+    public static boolean isDouble(String val)
+    {
+        fpMatch.reset(val);
+        return fpMatch.matches();
+    }
+    
+    public static double parseDouble(String val)
+    {
+        /*
+        if (val == null) return 0.0;
+
+        double retVal = 0.0;
+        try
+        { retVal = Double.parseDouble(val); }
+        catch (Exception e)
+        {}
+        return retVal;
+         */
+        return findDouble(val);
+    }
+
+    /**
+     * Searches the given string for the first floating point number it contains,
+     * parses and returns it.
+     */
+    public synchronized static double findDouble(String val)
+    {
+        if (val == null) return 0;
+
+        fpMatch.reset(val);
+        try
+        {
+            if (!fpMatch.find()) return 0;
+        }
+        catch (StringIndexOutOfBoundsException e)
+        {
+            System.err.println("XMLParseUtil: regex parse problem: '" + val + "'");
+            e.printStackTrace();
+        }
+
+        val = fpMatch.group(1);
+        //System.err.println("Parsing " + val);
+
+        double retVal = 0;
+        try
+        { 
+            retVal = Double.parseDouble(val); 
+            
+            float pixPerInch;
+            try {
+                pixPerInch = (float)Toolkit.getDefaultToolkit().getScreenResolution();
+            }
+            catch (NoClassDefFoundError err)
+            {
+                //Default value for headless X servers
+                pixPerInch = 72;
+            }
+            final float inchesPerCm = .3936f;
+            final String units = fpMatch.group(6);
+            
+            if ("%".equals(units)) retVal /= 100;
+            else if ("in".equals(units))
+            {
+                retVal *= pixPerInch;
+            }
+            else if ("cm".equals(units))
+            {
+                retVal *= inchesPerCm * pixPerInch;
+            }
+            else if ("mm".equals(units))
+            {
+                retVal *= inchesPerCm * pixPerInch * .1f;
+            }
+            else if ("pt".equals(units))
+            {
+                retVal *= (1f / 72f) * pixPerInch;
+            }
+            else if ("pc".equals(units))
+            {
+                retVal *= (1f / 6f) * pixPerInch;
+            }
+        }
+        catch (Exception e)
+        {}
+        return retVal;
+    }
+
+    /**
+     * Scans an input string for double values.  For each value found, places
+     * in a list.  This method regards any characters not part of a floating
+     * point value to be seperators.  Thus this will parse whitespace seperated,
+     * comma seperated, and many other separation schemes correctly.
+     */
+    public synchronized static double[] parseDoubleList(String list)
+    {
+        if (list == null) return null;
+
+        fpMatch.reset(list);
+
+        LinkedList doubList = new LinkedList();
+        while (fpMatch.find())
+        {
+            String val = fpMatch.group(1);
+            doubList.add(Double.valueOf(val));
+        }
+
+        double[] retArr = new double[doubList.size()];
+        Iterator it = doubList.iterator();
+        int idx = 0;
+        while (it.hasNext())
+        {
+            retArr[idx++] = ((Double)it.next()).doubleValue();
+        }
+
+        return retArr;
+    }
+
+    public static float parseFloat(String val)
+    {
+        /*
+        if (val == null) return 0f;
+
+        float retVal = 0f;
+        try
+        { retVal = Float.parseFloat(val); }
+        catch (Exception e)
+        {}
+        return retVal;
+         */
+        return findFloat(val);
+    }
+
+    /**
+     * Searches the given string for the first floating point number it contains,
+     * parses and returns it.
+     */
+    public synchronized static float findFloat(String val)
+    {
+        if (val == null) return 0f;
+
+        fpMatch.reset(val);
+        if (!fpMatch.find()) return 0f;
+
+        val = fpMatch.group(1);
+        //System.err.println("Parsing " + val);
+
+        float retVal = 0f;
+        try
+        {
+            retVal = Float.parseFloat(val);
+            String units = fpMatch.group(6);
+            if ("%".equals(units)) retVal /= 100;
+        }
+        catch (Exception e)
+        {}
+        return retVal;
+    }
+
+    public synchronized static float[] parseFloatList(String list)
+    {
+        if (list == null) return null;
+
+        fpMatch.reset(list);
+
+        LinkedList floatList = new LinkedList();
+        while (fpMatch.find())
+        {
+            String val = fpMatch.group(1);
+            floatList.add(Float.valueOf(val));
+        }
+
+        float[] retArr = new float[floatList.size()];
+        Iterator it = floatList.iterator();
+        int idx = 0;
+        while (it.hasNext())
+        {
+            retArr[idx++] = ((Float)it.next()).floatValue();
+        }
+
+        return retArr;
+    }
+
+    public static int parseInt(String val)
+    {
+        if (val == null) return 0;
+
+        int retVal = 0;
+        try
+        { retVal = Integer.parseInt(val); }
+        catch (Exception e)
+        {}
+        return retVal;
+    }
+
+    /**
+     * Searches the given string for the first integer point number it contains,
+     * parses and returns it.
+     */
+    public static int findInt(String val)
+    {
+        if (val == null) return 0;
+
+        intMatch.reset(val);
+        if (!intMatch.find()) return 0;
+
+        val = intMatch.group();
+        //System.err.println("Parsing " + val);
+
+        int retVal = 0;
+        try
+        { retVal = Integer.parseInt(val); }
+        catch (Exception e)
+        {}
+        return retVal;
+    }
+
+    public static int[] parseIntList(String list)
+    {
+        if (list == null) return null;
+
+        intMatch.reset(list);
+
+        LinkedList intList = new LinkedList();
+        while (intMatch.find())
+        {
+            String val = intMatch.group();
+            intList.add(Integer.valueOf(val));
+        }
+
+        int[] retArr = new int[intList.size()];
+        Iterator it = intList.iterator();
+        int idx = 0;
+        while (it.hasNext())
+        {
+            retArr[idx++] = ((Integer)it.next()).intValue();
+        }
+
+        return retArr;
+    }
+/*
+    public static int parseHex(String val)
+    {
+        int retVal = 0;
+        
+        for (int i = 0; i < val.length(); i++)
+        {
+            retVal <<= 4;
+            
+            char ch = val.charAt(i);
+            if (ch >= '0' && ch <= '9')
+            {
+                retVal |= ch - '0';
+            }
+            else if (ch >= 'a' && ch <= 'z')
+            {
+                retVal |= ch - 'a' + 10;
+            }
+            else if (ch >= 'A' && ch <= 'Z')
+            {
+                retVal |= ch - 'A' + 10;
+            }
+            else throw new RuntimeException();
+        }
+        
+        return retVal;
+    }
+*/
+    /**
+     * The input string represents a ratio.  Can either be specified as a
+     * double number on the range of [0.0 1.0] or as a percentage [0% 100%]
+     */
+    public static double parseRatio(String val)
+    {
+        if (val == null || val.equals("")) return 0.0;
+
+        if (val.charAt(val.length() - 1) == '%')
+        {
+            parseDouble(val.substring(0, val.length() - 1));
+        }
+        return parseDouble(val);
+    }
+
+    public static NumberWithUnits parseNumberWithUnits(String val)
+    {
+        if (val == null) return null;
+
+        return new NumberWithUnits(val);
+    }
+/*
+    public static Color parseColor(String val)
+    {
+        Color retVal = null;
+
+        if (val.charAt(0) == '#')
+        {
+            String hexStrn = val.substring(1);
+            
+            if (hexStrn.length() == 3)
+            {
+                hexStrn = "" + hexStrn.charAt(0) + hexStrn.charAt(0) + hexStrn.charAt(1) + hexStrn.charAt(1) + hexStrn.charAt(2) + hexStrn.charAt(2);
+            }
+            int hexVal = parseHex(hexStrn);
+
+            retVal = new Color(hexVal);
+        }
+        else
+        {
+            final Matcher rgbMatch = Pattern.compile("rgb\\((\\d+),(\\d+),(\\d+)\\)", Pattern.CASE_INSENSITIVE).matcher("");
+
+            rgbMatch.reset(val);
+            if (rgbMatch.matches())
+            {
+                int r = Integer.parseInt(rgbMatch.group(1));
+                int g = Integer.parseInt(rgbMatch.group(2));
+                int b = Integer.parseInt(rgbMatch.group(3));
+                retVal = new Color(r, g, b);
+            }
+            else
+            {
+                Color lookupCol = ColorTable.instance().lookupColor(val);
+                if (lookupCol != null) retVal = lookupCol;
+            }
+        }
+
+        return retVal;
+    }
+*/
+    /**
+     * Parses the given attribute of this tag and returns it as a String.
+     */
+    public static String getAttribString(Element ele, String name)
+    {
+        return ele.getAttribute(name);
+    }
+
+    /**
+     * Parses the given attribute of this tag and returns it as an int.
+     */
+    public static int getAttribInt(Element ele, String name)
+    {
+        String sval = ele.getAttribute(name);
+        int val = 0;
+        try { val = Integer.parseInt(sval); } catch (Exception e) {}
+
+        return val;
+    }
+
+    /**
+     * Parses the given attribute of this tag as a hexadecimal encoded string and
+     * returns it as an int
+     */
+    public static int getAttribIntHex(Element ele, String name)
+    {
+        String sval = ele.getAttribute(name);
+        int val = 0;
+        try { val = Integer.parseInt(sval, 16); } catch (Exception e) {}
+
+        return val;
+    }
+
+    /**
+     * Parses the given attribute of this tag and returns it as a float
+     */
+    public static float getAttribFloat(Element ele, String name)
+    {
+        String sval = ele.getAttribute(name);
+        float val = 0.0f;
+        try { val = Float.parseFloat(sval); } catch (Exception e) {}
+
+        return val;
+    }
+
+    /**
+     * Parses the given attribute of this tag and returns it as a double.
+     */
+    public static double getAttribDouble(Element ele, String name)
+    {
+        String sval = ele.getAttribute(name);
+        double val = 0.0;
+        try { val = Double.parseDouble(sval); } catch (Exception e) {}
+
+        return val;
+    }
+
+    /**
+     * Parses the given attribute of this tag and returns it as a boolean.
+     * Essentially compares the lower case textual value to the string "true"
+     */
+    public static boolean getAttribBoolean(Element ele, String name)
+    {
+        String sval = ele.getAttribute(name);
+
+        return sval.toLowerCase().equals("true");
+    }
+
+    public static URL getAttribURL(Element ele, String name, URL docRoot)
+    {
+        String sval = ele.getAttribute(name);
+
+        URL url;
+        try
+        {
+            return new URL(docRoot, sval);
+        }
+        catch (Exception e)
+        {
+            return null;
+        }
+    }
+
+    /**
+     * Returns the first ReadableXMLElement with the given name
+     */
+    public static ReadableXMLElement getElement(Class classType, Element root, String name, URL docRoot)
+    {
+        if (root == null) return null;
+
+        //Do not process if not a LoadableObject
+        if (!ReadableXMLElement.class.isAssignableFrom(classType))
+        {
+            return null;
+        }
+
+        NodeList nl = root.getChildNodes();
+        int size = nl.getLength();
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            ReadableXMLElement newObj = null;
+            try { newObj = (ReadableXMLElement)classType.newInstance(); }
+            catch (Exception e) { e.printStackTrace(); continue; }
+            newObj.read(ele, docRoot);
+
+            if (newObj == null) continue;
+
+            return newObj;
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns a HashMap of nodes that are children of root.  All nodes will
+     * be of class classType and have a tag name of 'name'.  'key' is
+     * an attribute of tag 'name' who's string value will be used as the key
+     * in the HashMap
+     */
+    public static HashMap getElementHashMap(Class classType, Element root, String name, String key, URL docRoot)
+    {
+        if (root == null) return null;
+
+        //Do not process if not a LoadableObject
+        if (!ReadableXMLElement.class.isAssignableFrom(classType))
+        {
+            return null;
+        }
+
+        HashMap retMap = new HashMap();
+
+/*
+        Class[] params = {Element.class, URL.class};
+        Method loadMethod = null;
+        try { loadMethod = classType.getMethod("load", params); }
+        catch (Exception e) { e.printStackTrace(); return null; }
+
+ */
+        NodeList nl = root.getChildNodes();
+        int size = nl.getLength();
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            ReadableXMLElement newObj = null;
+            try { newObj = (ReadableXMLElement)classType.newInstance(); }
+            catch (Exception e) { e.printStackTrace(); continue; }
+            newObj.read(ele, docRoot);
+/*
+            Object[] args = {ele, source};
+            Object obj = null;
+            try { obj = loadMethod.invoke(null, args); }
+            catch (Exception e) { e.printStackTrace(); }
+
+ */
+            if (newObj == null) continue;
+
+            String keyVal = getAttribString(ele, key);
+            retMap.put(keyVal, newObj);
+        }
+
+        return retMap;
+    }
+
+    public static HashSet getElementHashSet(Class classType, Element root, String name, URL docRoot)
+    {
+        if (root == null) return null;
+
+        //Do not process if not a LoadableObject
+        if (!ReadableXMLElement.class.isAssignableFrom(classType))
+        {
+            return null;
+        }
+
+        HashSet retSet = new HashSet();
+
+        /*
+        Class[] params = {Element.class, URL.class};
+        Method loadMethod = null;
+        try { loadMethod = classType.getMethod("load", params); }
+        catch (Exception e) { e.printStackTrace(); return null; }
+        */
+
+        NodeList nl = root.getChildNodes();
+        int size = nl.getLength();
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            ReadableXMLElement newObj = null;
+            try { newObj = (ReadableXMLElement)classType.newInstance(); }
+            catch (Exception e) { e.printStackTrace(); continue; }
+            newObj.read(ele, docRoot);
+            /*
+            Object[] args = {ele, source};
+            Object obj = null;
+            try { obj = loadMethod.invoke(null, args); }
+            catch (Exception e) { e.printStackTrace(); }
+             */
+
+            if (newObj == null) continue;
+
+            retSet.add(newObj);
+        }
+
+        return retSet;
+    }
+
+
+    public static LinkedList getElementLinkedList(Class classType, Element root, String name, URL docRoot)
+    {
+        if (root == null) return null;
+
+        //Do not process if not a LoadableObject
+        if (!ReadableXMLElement.class.isAssignableFrom(classType))
+        {
+            return null;
+        }
+
+        NodeList nl = root.getChildNodes();
+        LinkedList elementCache = new LinkedList();
+        int size = nl.getLength();
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            ReadableXMLElement newObj = null;
+            try { newObj = (ReadableXMLElement)classType.newInstance(); }
+            catch (Exception e) { e.printStackTrace(); continue; }
+            newObj.read(ele, docRoot);
+
+            elementCache.addLast(newObj);
+        }
+
+        return elementCache;
+    }
+
+    public static Object[] getElementArray(Class classType, Element root, String name, URL docRoot)
+    {
+        if (root == null) return null;
+
+        //Do not process if not a LoadableObject
+        if (!ReadableXMLElement.class.isAssignableFrom(classType))
+        {
+            return null;
+        }
+
+        LinkedList elementCache = getElementLinkedList(classType, root, name, docRoot);
+
+        Object[] retArr = (Object[])Array.newInstance(classType, elementCache.size());
+        return elementCache.toArray(retArr);
+    }
+
+    /**
+     * Takes a number of tags of name 'name' that are children of 'root', and
+     * looks for attributes of 'attrib' on them.  Converts attributes to an
+     * int and returns in an array.
+     */
+    public static int[] getElementArrayInt(Element root, String name, String attrib)
+    {
+        if (root == null) return null;
+
+        NodeList nl = root.getChildNodes();
+        LinkedList elementCache = new LinkedList();
+        int size = nl.getLength();
+
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            String valS = ele.getAttribute(attrib);
+            int eleVal = 0;
+            try { eleVal = Integer.parseInt(valS); }
+            catch (Exception e) {}
+
+            elementCache.addLast(new Integer(eleVal));
+        }
+
+        int[] retArr = new int[elementCache.size()];
+        Iterator it = elementCache.iterator();
+        int idx = 0;
+        while (it.hasNext())
+        {
+            retArr[idx++] = ((Integer)it.next()).intValue();
+        }
+
+        return retArr;
+    }
+
+    /**
+     * Takes a number of tags of name 'name' that are children of 'root', and
+     * looks for attributes of 'attrib' on them.  Converts attributes to an
+     * int and returns in an array.
+     */
+    public static String[] getElementArrayString(Element root, String name, String attrib)
+    {
+        if (root == null) return null;
+
+        NodeList nl = root.getChildNodes();
+        LinkedList elementCache = new LinkedList();
+        int size = nl.getLength();
+
+        for (int i = 0; i < size; i++)
+        {
+            Node node = nl.item(i);
+            if (!(node instanceof Element)) continue;
+            Element ele = (Element)node;
+            if (!ele.getTagName().equals(name)) continue;
+
+            String valS = ele.getAttribute(attrib);
+
+            elementCache.addLast(valS);
+        }
+
+        String[] retArr = new String[elementCache.size()];
+        Iterator it = elementCache.iterator();
+        int idx = 0;
+        while (it.hasNext())
+        {
+            retArr[idx++] = (String)it.next();
+        }
+
+        return retArr;
+    }
+
+    /**
+     * Takes a CSS style string and retursn a hash of them.
+     * @param styleString - A CSS formatted string of styles.  Eg,
+     *     "font-size:12;fill:#d32c27;fill-rule:evenodd;stroke-width:1pt;"
+     */
+    public static HashMap<String,StyleAttribute> parseStyle(String styleString) {
+        return parseStyle(styleString, new HashMap<String,StyleAttribute>());
+    }
+
+    /**
+     * Takes a CSS style string and retursn a hash of them.
+     * @param styleString - A CSS formatted string of styles.  Eg,
+     *     "font-size:12;fill:#d32c27;fill-rule:evenodd;stroke-width:1pt;"
+     * @param map - A map to which these styles will be added
+     */
+    public static HashMap<String,StyleAttribute> parseStyle(String styleString, HashMap<String,StyleAttribute> map) {
+        final Pattern patSemi = Pattern.compile(";");
+        final Pattern patColonSpace = Pattern.compile(":");
+
+        //Strips left and right whitespace
+        final Matcher matcherContent = Pattern.compile("\\s*([^\\s](.*[^\\s])?)\\s*").matcher("");
+
+        String[] styles = patSemi.split(styleString);
+
+        for (int i = 0; i < styles.length; i++) {
+            String[] vals = patColonSpace.split(styles[i]);
+
+            matcherContent.reset(vals[0]);
+            matcherContent.matches();
+            vals[0] = matcherContent.group(1);
+
+            matcherContent.reset(vals[1]);
+            matcherContent.matches();
+            vals[1] = matcherContent.group(1);
+
+            map.put(vals[0], new StyleAttribute(vals[0], vals[1]));
+        }
+
+        return map;
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportDialog.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportDialog.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportDialog.java	(revision 23707)
@@ -0,0 +1,91 @@
+package org.openstreetmap.josm.plugins.importvec;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.tools.GBC;
+
+public class ImportDialog extends ExtendedDialog {
+    private JFormattedTextField tsdiv = new JFormattedTextField(NumberFormat.getInstance());
+    private JFormattedTextField tsnum = new JFormattedTextField(NumberFormat.getInstance());
+    private JFormattedTextField tsteps = new JFormattedTextField(NumberFormat.getIntegerInstance());
+
+    public ImportDialog() {
+        super(Main.parent, tr("Import vector graphics"),
+                new String[] { tr("OK"), tr("Cancel") },
+                true);
+        contentInsets = new Insets(15, 15, 5, 15);
+        setButtonIcons(new String[] { "ok.png", "cancel.png" });
+        
+
+        final JPanel panel = new JPanel(new GridBagLayout());
+        panel.add(new JLabel(tr("Scale:")), GBC.eol().fill(GBC.HORIZONTAL));
+        final JPanel pscale = new JPanel(new GridBagLayout());
+        pscale.add(tsdiv,GBC.std().fill(GBC.HORIZONTAL));
+        pscale.add(new JLabel(tr("unit(s) = ")),GBC.std().insets(10, 0, 0, 0));
+        pscale.add(tsnum,GBC.std().fill(GBC.HORIZONTAL));
+        pscale.add(new JLabel(tr("m")),GBC.std().insets(10, 0, 0, 0));
+        panel.add(pscale,GBC.eop().fill(GBC.HORIZONTAL));
+        
+        final JLabel label = new JLabel("Curve steps:");
+        panel.add(label, GBC.std());
+        label.setLabelFor(tsteps);
+        panel.add(tsteps, GBC.eol().fill(GBC.HORIZONTAL));
+        
+        tsnum.setValue(Settings.getScaleNumerator());
+        tsdiv.setValue(Settings.getScaleDivisor());
+        tsteps.setValue(Settings.getCurveSteps());
+
+        setContent(panel);
+        setupDialog();
+        setVisible(true);
+    }
+    
+    public double getScaleNumerator() {
+        try {
+            return NumberFormat.getInstance().parse(tsnum.getText()).doubleValue();
+        } catch (ParseException e) {
+            return 1;
+        }
+    }
+    
+    public double getScaleDivisor() {
+        try {
+            double result = NumberFormat.getInstance().parse(tsdiv.getText()).doubleValue();
+            if (result <= 0.0001)
+                return 1;
+            return result;
+        } catch (ParseException e) {
+            return 1;
+        }
+    }
+
+    public int getCurveSteps() {
+        try {
+            int result = NumberFormat.getIntegerInstance().parse(tsdiv.getText()).intValue();
+            if (result < 1)
+                return 1;
+            return result;
+        } catch (ParseException e) {
+            return 4;
+        }
+    }
+
+    
+    public void saveSettings() {
+        Settings.setScaleNumerator(getScaleNumerator());
+        Settings.setScaleDivisor(getScaleDivisor());
+        Settings.setCurveSteps(getCurveSteps());
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVecPlugin.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVecPlugin.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVecPlugin.java	(revision 23707)
@@ -0,0 +1,14 @@
+package org.openstreetmap.josm.plugins.importvec;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.plugins.PluginInformation;
+
+public class ImportVecPlugin extends Plugin {
+
+    public ImportVecPlugin(PluginInformation info) {
+        super(info);
+        Main.main.menu.fileMenu.insert(new ImportVectorAction(), 3);
+    }
+
+}
Index: /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVectorAction.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVectorAction.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/ImportVectorAction.java	(revision 23707)
@@ -0,0 +1,270 @@
+package org.openstreetmap.josm.plugins.importvec;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.DiskAccessAction;
+import org.openstreetmap.josm.actions.ExtensionFileFilter;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.command.AddCommand;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.SequenceCommand;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.projection.Mercator;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.io.OsmTransferException;
+import org.openstreetmap.josm.tools.Shortcut;
+import org.xml.sax.SAXException;
+
+import com.kitfox.svg.SVGDiagram;
+import com.kitfox.svg.SVGElement;
+import com.kitfox.svg.SVGLoader;
+import com.kitfox.svg.SVGRoot;
+import com.kitfox.svg.ShapeElement;
+
+public class ImportVectorAction extends JosmAction {
+
+    public ImportVectorAction() {
+        super(tr("Import..."), "open", tr("Import vector graphics."),
+                Shortcut.registerShortcut("system:import", tr("File: {0}", tr("Import...")), KeyEvent.VK_I, Shortcut.GROUP_MENU),true);
+    }
+    public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title) {
+        String curDir = Main.pref.get("lastDirectory");
+        if (curDir.equals("")) {
+            curDir = ".";
+        }
+        JFileChooser fc = new JFileChooser(new File(curDir));
+        if (title != null) {
+            fc.setDialogTitle(title);
+        }
+
+        fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+        fc.setMultiSelectionEnabled(multiple);
+        fc.setAcceptAllFileFilterUsed(false);
+        //System.out.println("opening fc for extension " + extension);
+        fc.addChoosableFileFilter(new FileFilter() {
+            @Override
+            public boolean accept(File f) {
+                if (f.isDirectory())
+                    return false;
+                else {
+                    String name = f.getName().toLowerCase();
+                    return name.endsWith(".svg");
+                }
+            }
+            @Override
+            public String getDescription() {
+                return tr("SVG images (*.svg)");
+            }
+
+        });
+
+        int answer = open ? fc.showOpenDialog(Main.parent) : fc.showSaveDialog(Main.parent);
+        if (answer != JFileChooser.APPROVE_OPTION)
+            return null;
+
+        if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir)) {
+            Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+        }
+
+        if (!open) {
+            File file = fc.getSelectedFile();
+            if (file != null && file.exists()) {
+                ExtendedDialog dialog = new ExtendedDialog(
+                        Main.parent,
+                        tr("Overwrite"),
+                        new String[] {tr("Overwrite"), tr("Cancel")}
+                );
+                dialog.setContent(tr("File exists. Overwrite?"));
+                dialog.setButtonIcons(new String[] {"save_as.png", "cancel.png"});
+                if (dialog.getValue() != 1)
+                    return null;
+            }
+        }
+
+        return fc;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+        JFileChooser fc = createAndOpenFileChooser(true, true, "Import vector graphics");
+        if (fc == null)
+            return;
+
+        ImportDialog dlg = new ImportDialog();
+        if (dlg.getValue() != 1)
+            return;
+
+        File[] files = fc.getSelectedFiles();
+        
+        Main.worker.submit(new ImportTask(Arrays.asList(files)));
+    }
+    
+    static public class ImportTask extends PleaseWaitRunnable {
+        LinkedList<Node> nodes = new LinkedList<Node>();
+        LinkedList<Way> ways = new LinkedList<Way>();
+
+        private List<File> files;
+        private boolean cancelled;
+
+        public ImportTask(List<File> files) {
+            super(tr("Importing..."), false);
+            this.files = new ArrayList<File>(files);
+        }
+        @Override
+        protected void cancel() {
+            this.cancelled = true;
+        }
+
+        @Override
+        protected void finish() {
+        }
+
+        private static final double eqlen = 40075004; // length of equator in metres
+        Mercator projection = new Mercator();
+        EastNorth center;
+        double scale;
+        
+        Way currentway;
+        double lastX;
+        double lastY;
+        
+        private void appendNode(double x, double y) throws IOException {
+            if (currentway == null)
+                throw new IOException("Shape is started incorectly");
+            Node nd = new Node(projection.eastNorth2latlon(center.add(x*scale, y*scale)));
+            if (nd.getCoor().isOutSideWorld())
+                throw new IOException("Shape goes outside the world");
+            currentway.addNode(nd);
+            nodes.add(nd);
+            lastX = x;
+            lastY = y;
+        }
+        private void appendNode(Point2D point) throws IOException {
+            appendNode(point.getX(),point.getY());
+        }
+
+        private static double sqr(double x) {
+            return x*x;
+        }
+        private static double cube(double x) {
+            return x*x*x;
+        }
+        private static Point2D interpolate_quad(
+                double ax,double ay,
+                double bx,double by,
+                double cx,double cy,
+                double t) {
+            return new Point2D.Double(
+                    sqr(1-t)*ax+2*(1-t)*t*bx+t*t*cx,
+                    sqr(1-t)*ay+2*(1-t)*t*by+t*t*cy);
+        }
+        private static Point2D interpolate_cubic(
+                double ax,double ay,
+                double bx,double by,
+                double cx,double cy,
+                double dx,double dy,
+                double t) {
+            return new Point2D.Double(
+                    cube(1-t)*ax+3*sqr(1-t)*t*bx+3*(1-5)*t*t*cx+t*t*t*dx,
+                    cube(1-t)*ay+3*sqr(1-t)*t*by+3*(1-5)*t*t*cy+t*t*t*dy);
+        }
+
+        @Override
+        protected void realRun() throws SAXException, IOException, OsmTransferException {
+            LatLon center = Main.proj.eastNorth2latlon(Main.map.mapView.getCenter());
+            scale = 2 * Math.PI / (Math.cos(Math.toRadians(center.lat())) * eqlen)
+                    * Settings.getScaleNumerator() / Settings.getScaleDivisor();
+            this.center = projection.latlon2eastNorth(center);
+            try {
+                for (File f : files) {
+                    SVGLoader loader = new SVGLoader(new URI("about:blank"));
+                    SAXParserFactory.newInstance().newSAXParser().parse(f, loader);
+                
+                    SVGDiagram diagram = loader.getLoadedDiagram();
+                    SVGRoot root = diagram.getRoot();
+                    for (SVGElement el : root.getChildren(null)) {
+                        if (el instanceof ShapeElement) {
+                            ShapeElement shape = (ShapeElement)el;
+                            PathIterator it = shape.getShape().getPathIterator(null);
+                            
+                            while (!it.isDone()) {
+                                double[] coords = new double[6];
+                                switch (it.currentSegment(coords)) {
+                                case PathIterator.SEG_MOVETO:
+                                    currentway = new Way();
+                                    ways.add(currentway);
+                                    appendNode(coords[0],coords[1]);
+                                    break;
+                                case PathIterator.SEG_LINETO:
+                                    appendNode(coords[0],coords[1]);
+                                    break;
+                                case PathIterator.SEG_CLOSE:
+                                    currentway.addNode(currentway.firstNode());
+                                    break;
+                                case PathIterator.SEG_QUADTO:
+                                    double lastx = lastX;
+                                    double lasty = lastY;
+                                    for (int i = 1;i<Settings.getCurveSteps();i++) {
+                                        appendNode(interpolate_quad(lastx,lasty,coords[0],coords[1],coords[2],coords[3],(double)i/Settings.getCurveSteps()));
+                                    }
+                                    appendNode(coords[2],coords[3]);
+                                    break;
+                                case PathIterator.SEG_CUBICTO:
+                                    lastx = lastX;
+                                    lasty = lastY;
+                                    for (int i = 1;i<Settings.getCurveSteps();i++) {
+                                        appendNode(interpolate_cubic(lastx,lasty,coords[0],coords[1],coords[2],coords[3],coords[4],coords[5],(double)i/Settings.getCurveSteps()));
+                                    }
+                                    appendNode(coords[4],coords[5]);
+                                    break;
+                                }
+                            }
+                            
+                        } 
+                        
+                    }
+                    if (cancelled) return;
+                }
+            } catch(ParserConfigurationException e) {
+                throw new IOException(e.getMessage(), e);
+            } catch(Exception e) {
+                throw new IOException(e);
+            }
+            LinkedList<Command> cmds = new LinkedList<Command>();
+            for (Node n : nodes) {
+                cmds.add(new AddCommand(n));
+            }
+            for (Way w : ways) {
+                cmds.add(new AddCommand(w));
+            }
+            Main.main.undoRedo.add(new SequenceCommand("Import primitives",cmds));
+        }
+    }
+    @Override
+    protected void updateEnabledState() {
+        setEnabled(getCurrentDataSet() != null);
+    }
+}
Index: /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/Settings.java
===================================================================
--- /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/Settings.java	(revision 23707)
+++ /applications/editors/josm/plugins/importvec/src/org/openstreetmap/josm/plugins/importvec/Settings.java	(revision 23707)
@@ -0,0 +1,30 @@
+package org.openstreetmap.josm.plugins.importvec;
+
+import org.openstreetmap.josm.Main;
+
+public class Settings {
+
+    public static void setScaleNumerator(double value) {
+        Main.pref.putDouble("importvec.scalenum", value);
+    }
+    public static void setScaleDivisor(double value) {
+        if (value == 0)
+            throw new IllegalArgumentException("Scale divisor cannot be 0");
+        Main.pref.putDouble("importvec.scalediv", value);
+    }
+    public static void setCurveSteps(long value) {
+        if (value < 1)
+            throw new IllegalArgumentException("Curve steps cannot less than 1");
+        Main.pref.putLong("importvec.curvesteps", value);
+    }
+    
+    public static double getScaleNumerator() {
+        return Main.pref.getDouble("importvec.scalenum", 1);
+    }
+    public static double getScaleDivisor() {
+        return Main.pref.getDouble("importvec.scalediv", 1);
+    }
+    public static double getCurveSteps() {
+        return Main.pref.getDouble("importvec.curvesteps", 4);
+    }
+}
