Revision: 5483
http://vassalengine.svn.sourceforge.net/vassalengine/?rev=5483&view=rev
Author: uckelman
Date: 2009-04-10 16:03:59 +0000 (Fri, 10 Apr 2009)
Log Message:
-----------
Merged from 3.1.
Modified Paths:
--------------
VASSAL-src/branches/uckelman-3.1/CHANGES.txt
VASSAL-src/branches/uckelman-3.1/Makefile
VASSAL-src/branches/uckelman-3.1/NOTES
VASSAL-src/branches/uckelman-3.1/dist/windows/nsis/installer.nsi
VASSAL-src/branches/uckelman-3.1/doc/ReferenceManual/NonStacking.htm
VASSAL-src/branches/uckelman-3.1/src/VASSAL/Info.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/KeyBufferer.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/StackExpander.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/counters/Immobilized.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/i18n/VASSAL.properties
VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/AbstractLaunchAction.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Editor.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Launcher.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManager.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManagerWindow.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/DialogUtils.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/ErrorDialog.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/MemoryUtils.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/ProblemDialog.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/WarningDialog.java
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/imports/adc2/SymbolSet.java
Added Paths:
-----------
VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/
VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt
VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/FutureUtils.java
Removed Paths:
-------------
VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt
Property Changed:
----------------
VASSAL-src/branches/uckelman-3.1/
Property changes on: VASSAL-src/branches/uckelman-3.1
___________________________________________________________________
Modified: svn:mergeinfo
- /VASSAL-src/branches/3.1:5383-5387
/VASSAL-src/branches/bsmith:4567-4756
/VASSAL-src/branches/bsmith/merge-3:5153
/VASSAL-src/branches/mkiefte:4821-4822
/VASSAL-src/branches/rk-jabber:5293
/VASSAL-src/branches/swampwallaby-3.1:5134,5150-5151,5155,5165,5199,5257,5279,5294-5295,5303,5307-5308,5311,5319-5320,5329,5332,5352
/VASSAL-src/branches/swampwallaby-work:4776,4806-4807,4819,4823-4825,5067,5093
/VASSAL-src/branches/swampwallaby-work2:4840
/VASSAL-src/branches/swampwallaby-work3:5086
/VASSAL-src/branches/swampwallaby-work5:4713
/VASSAL-src/branches/swampwallaby-work6:4727,4729-4730,4737,4742-4743,4747,4752,4776
/VASSAL-src/branches/uckelman-work:4657-4708,4769-4775,4779,4790,4799,4933,5326
/VASSAL-src/trunk:4885,4887,4929-4930,4934,4936,4949,4954-4955,4966,5033,5048-5049,5117,5144
+ /VASSAL-src/branches/3.1:5383-5482
/VASSAL-src/branches/bsmith:4567-4756
/VASSAL-src/branches/bsmith/merge-3:5153
/VASSAL-src/branches/mkiefte:4821-4822
/VASSAL-src/branches/mkiefte-3.1:5424
/VASSAL-src/branches/rk-jabber:5293
/VASSAL-src/branches/swampwallaby-3.1:5134,5150-5151,5155,5165,5199,5257,5279,5294-5295,5303,5307-5308,5311,5319-5320,5329,5332,5352,5370,5425,5465,5468
/VASSAL-src/branches/swampwallaby-work:4776,4806-4807,4819,4823-4825,5067,5093
/VASSAL-src/branches/swampwallaby-work2:4840
/VASSAL-src/branches/swampwallaby-work3:5086
/VASSAL-src/branches/swampwallaby-work5:4713
/VASSAL-src/branches/swampwallaby-work6:4727,4729-4730,4737,4742-4743,4747,4752,4776
/VASSAL-src/branches/uckelman-work:4657-4708,4769-4775,4779,4790,4799,4933,5326
/VASSAL-src/trunk:4885,4887,4929-4930,4934,4936,4949,4954-4955,4966,5033,5048-5049,5117,5144
Modified: VASSAL-src/branches/uckelman-3.1/CHANGES.txt
===================================================================
--- VASSAL-src/branches/uckelman-3.1/CHANGES.txt 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/CHANGES.txt 2009-04-10 16:03:59 UTC (rev 5483)
@@ -1,3 +1,17 @@
+3.1.3 - 1 April 2009
+
+* Bug 2721276: Illegal Heap sizes crashing startup
+* Bug 2706019: Too few parameters for socket failure dialog
+* Bug 2703991. Mask dimensions in ADC2 symset files are stupid
+* Bug 2698781: Cannot switch to English if PC Locale is non-English
+* Bug 2680395: Error in Maximum Heap calculation and check
+* Bug 2665174: NPE due to no default UI font
+* Bug 2580669: Module-specific exception classes cannot be logged
+* Bug 2372121: Race condition causes truncated errorLogs in bug reports
+* Bug: 8-bit PNGs with 1-bit alpha have bad transparency
+* Bug: HTML help folders with more than one file cannot be opened
+* Bug: close() on a pipe closed from the other end will throw IOException
+
3.1.2 - 18 March 2009
* Bug 2690874: No Moved button if no text specified
Modified: VASSAL-src/branches/uckelman-3.1/Makefile
===================================================================
--- VASSAL-src/branches/uckelman-3.1/Makefile 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/Makefile 2009-04-10 16:03:59 UTC (rev 5483)
@@ -46,7 +46,7 @@
DOCDIR:=doc
DISTDIR:=dist
-VNUM:=3.1.3
+VNUM:=3.1.4
SVNVERSION:=$(shell svnversion | perl -pe 's/(\d+:)?(\d+[MS]?)/$$2/; s/(\d+)M/$$1+1/e')
VERSION:=$(VNUM)-svn$(SVNVERSION)
#VERSION:=$(VNUM)
@@ -128,7 +128,7 @@
$(LAUNCH4J) $(CURDIR)/$(TMPDIR)/VASSAL.l4j.xml
version:
- sed -ri 's/VERSION = ".*"/VERSION = "$(VERSION)"/' $(SRCDIR)/VASSAL/Info.java
+ sed -ri 's/ VERSION = ".*"/ VERSION = "$(VERSION)"/' $(SRCDIR)/VASSAL/Info.java
#dist/windows/VASSAL.ico:
# convert -bordercolor Transparent -border 1x1 src/icons/22x22/VASSAL.png $(TMPDIR)/VASSAL-24.png
Modified: VASSAL-src/branches/uckelman-3.1/NOTES
===================================================================
--- VASSAL-src/branches/uckelman-3.1/NOTES 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/NOTES 2009-04-10 16:03:59 UTC (rev 5483)
@@ -1,5 +1,5 @@
-The VASSAL Team is happy to announce the release of VASSAL 3.1.3, which
-fixes a serious problem in 3.1.1.
+The VASSAL Team is happy to announce the release of VASSAL 3.1.4, which
+fixes several problems found in earlier versions.
*********************
Download
@@ -7,35 +7,56 @@
For Linux:
- http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.3-linux.zip
+ http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.4-linux.tar.bz2
For Mac OS X:
- http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.3-macosx.dmg
+ http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.4-macosx.dmg
For Windows:
- http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.3-windows.exe
+ http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.4-windows.exe
For other operating systems:
- http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.3-other.zip
+ http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.4-other.zip
Source code:
- http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.3-src.zip
+ http://downloads.sourceforge.net/vassalengine/VASSAL-3.1.4-src.zip
*********************
Changes since 3.1.0:
*********************
+The following bugs are fixed in 3.1.4:
+
+* Bug 2731738: Memory test fails on Windows 98, Windows ME
+* Bug 2718948: v3.0+ DoesNotStack trait bug
+ - Replace Crtl-Shift-Click Selection filter with Alt-Click selection filter
+ - Allow Alt-lassoo to select Alt-click selection filter units
+ - Allow Ctrl-lassoo to deselect Does Not Stack units.
+ - Double-click on Does Not Stack units causes selection status to toggle
+* Bug: Bind to loopback ports only to avoid collisions and firewall problems
+* Bug: Module Manager fails to start if port in prefs is already in use
+* Bug: Race condition when setting Module Manager port and key
+* Bug: GUI calls by Module Manager server executed off the EDT
+* Bug: Memory test inaccurate on Linux
+
The following bugs are fixed in 3.1.3:
+* Bug 2721276: Illegal Heap sizes crashing startup
+* Bug 2706019: Too few parameters for socket failure dialog
+* Bug 2703991. Mask dimensions in ADC2 symset files are stupid
* Bug 2698781: Cannot switch to English if PC Locale is non-English
+* Bug 2680395: Error in Maximum Heap calculation and check
* Bug 2665174: NPE due to no default UI font
+* Bug 2580669: Module-specific exception classes cannot be logged
+* Bug 2372121: Race condition causes truncated errorLogs in bug reports
* Bug: 8-bit PNGs with 1-bit alpha have bad transparency
* Bug: HTML help folders with more than one file cannot be opened
+* Bug: close() on a pipe closed from the other end will throw IOException
The following bugs are fixed in 3.1.2:
@@ -66,7 +87,7 @@
of Java older than 1.5.0_08 upgrade to *at least* 1.5.0_08.
For Linux and Mac users, this should require no action on your part. Windows
-users installing VASSAL 3.1.3 with the Windows installer will be prompted to
+users installing VASSAL 3.1.4 with the Windows installer will be prompted to
update Java if what they have is older than 1.5.0_08.
For feature changes from 3.0 to 3.1, see the release notes for 3.1.0.
Modified: VASSAL-src/branches/uckelman-3.1/dist/windows/nsis/installer.nsi
===================================================================
--- VASSAL-src/branches/uckelman-3.1/dist/windows/nsis/installer.nsi 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/dist/windows/nsis/installer.nsi 2009-04-10 16:03:59 UTC (rev 5483)
@@ -33,7 +33,7 @@
!define IROOT "${VROOT}\${VNAME}"
!define AROOT "Software\Classes"
!define JAVA_MINIMUM "1.5.0_08"
-!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=27983"
+!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=29226"
Name "VASSAL"
OutFile "${TMPDIR}/VASSAL-${VERSION}-windows.exe"
Modified: VASSAL-src/branches/uckelman-3.1/doc/ReferenceManual/NonStacking.htm
===================================================================
--- VASSAL-src/branches/uckelman-3.1/doc/ReferenceManual/NonStacking.htm 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/doc/ReferenceManual/NonStacking.htm 2009-04-10 16:03:59 UTC (rev 5483)
@@ -30,8 +30,9 @@
will not form stacks with other pieces. If the "Ignore grid" box
is selected, then this piece will not snap to the nearest grid
location. The "select piece" option controls how the piece is
-selected: either normally, never (can never be selected) or when the shift key is down (shift-click to
-select the piece, then enter keyboard command. The "move piece" option controls how the piece is moved: either normally, never (cannot be moved once placed) or only if selected (select piece, then click and drag to move).<br>
+selected: either normally, never (can never be selected), only when the shift key is down (shift-click to
+select the piece), or only when the Alt and shift keys are down (alt-click to select the piece).
+The "move piece" option controls how the piece is moved: either normally, never (cannot be moved once placed) or only if selected (select piece, then click and drag to move).<br>
<br>
<b>EXAMPLE:</b> Use non-stacking pieces to represent
playing
Deleted: VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt
===================================================================
--- VASSAL-src/branches/3.1/lib/licenses/jna-3.0.9/LICENSE.txt 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt 2009-04-10 16:03:59 UTC (rev 5483)
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 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.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-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 and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, 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 library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete 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 distribute a copy of this License along with the
-Library.
-
- 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 Library or any portion
-of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-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 Library, 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 Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you 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.
-
- If distribution of 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 satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be 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.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library 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.
-
- 9. 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 Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-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 with
-this License.
-
- 11. 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 Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library 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 Library.
-
-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.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library 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.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser 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 Library
-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 Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-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
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "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
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. 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 LIBRARY 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
-LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
Copied: VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt (from rev 5482, VASSAL-src/branches/3.1/lib/licenses/jna-3.0.9/LICENSE.txt)
===================================================================
--- VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt (rev 0)
+++ VASSAL-src/branches/uckelman-3.1/lib/licenses/jna-3.0.9/LICENSE.txt 2009-04-10 16:03:59 UTC (rev 5483)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 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.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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 Library or any portion
+of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+
+ 11. 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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/Info.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/Info.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/Info.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -33,7 +33,11 @@
* Class for storing release-related information
*/
public final class Info {
- private static final String VERSION = "3.1.1"; //$NON-NLS-1$
+ private static final String VERSION = "3.1.3"; //$NON-NLS-1$
+
+ // Do not allow editing of modules with this revision or later
+ private static final String EDITOR_EXPIRY_VERSION = "3.2"; //$NON-NLS-1$
+
private static File homeDir;
private static final boolean isWindows;
@@ -131,6 +135,10 @@
public static boolean isWindows() {
return isWindows;
}
+
+ public static boolean isTooNewToEdit(String version) {
+ return compareVersions(version, EDITOR_EXPIRY_VERSION) >= 0;
+ }
/**
* Compares VASSAL version strings. This method is guaranteed to
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/KeyBufferer.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/KeyBufferer.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/KeyBufferer.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -40,6 +40,7 @@
import VASSAL.counters.DeckVisitor;
import VASSAL.counters.EventFilter;
import VASSAL.counters.GamePiece;
+import VASSAL.counters.Immobilized;
import VASSAL.counters.KeyBuffer;
import VASSAL.counters.PieceFinder;
import VASSAL.counters.PieceVisitorDispatcher;
@@ -158,7 +159,7 @@
selection.setLocation(map.mapCoordinates(selection.getLocation()));
selection.width /= map.getZoom();
selection.height /= map.getZoom();
- PieceVisitorDispatcher d = createDragSelector(!evt.isControlDown());
+ PieceVisitorDispatcher d = createDragSelector(!evt.isControlDown(), evt.isAltDown());
// RFE 1659481 Don't clear the entire selection buffer if either shift
// or control is down - we select/deselect lassoed counters instead
if (!evt.isShiftDown() && !evt.isControlDown()) {
@@ -176,15 +177,17 @@
*
* @return
*/
- protected PieceVisitorDispatcher createDragSelector(boolean selecting) {
- return new PieceVisitorDispatcher(new KBDeckVisitor(selecting));
+ protected PieceVisitorDispatcher createDragSelector(boolean selecting, boolean altDown) {
+ return new PieceVisitorDispatcher(new KBDeckVisitor(selecting, altDown));
}
public class KBDeckVisitor implements DeckVisitor {
boolean selecting = false;
+ boolean altDown = false;
- public KBDeckVisitor(boolean b) {
+ public KBDeckVisitor(boolean b, boolean c) {
selecting = b;
+ altDown = c;
}
public Object visitDeck(Deck d) {
@@ -221,11 +224,16 @@
return null;
}
+ // Handle non-stacked units, including Does Not Stack units
+ // Does Not Stack units deselect normally once selected
public Object visitDefault(GamePiece p) {
- if (p.getProperty(Properties.SELECT_EVENT_FILTER) == null && selection.contains(p.getPosition())
- && !Boolean.TRUE.equals(p.getProperty(Properties.INVISIBLE_TO_ME))) {
+ if (selection.contains(p.getPosition()) && !Boolean.TRUE.equals(p.getProperty(Properties.INVISIBLE_TO_ME))) {
if (selecting) {
- KeyBuffer.getBuffer().add(p);
+ final EventFilter filter = (EventFilter) p.getProperty(Properties.SELECT_EVENT_FILTER);
+ final boolean altSelect = (altDown && filter instanceof Immobilized.UseAlt);
+ if (filter == null || altSelect) {
+ KeyBuffer.getBuffer().add(p);
+ }
}
else {
KeyBuffer.getBuffer().remove(p);
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/StackExpander.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/StackExpander.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/build/module/map/StackExpander.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -20,8 +20,10 @@
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+
import VASSAL.build.Buildable;
import VASSAL.build.module.Map;
import VASSAL.counters.GamePiece;
@@ -51,8 +53,8 @@
if (!e.isConsumed()) {
if (e.getClickCount() == 2) {
GamePiece p = map.findPiece(e.getPoint(), PieceFinder.STACK_ONLY);
- KeyBuffer.getBuffer().clear();
if (p != null) {
+ KeyBuffer.getBuffer().clear();
((Stack) p).setExpanded(!((Stack) p).isExpanded());
KeyBuffer.getBuffer().add(((Stack) p).topPiece());
}
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/counters/Immobilized.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/counters/Immobilized.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/counters/Immobilized.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -32,11 +32,20 @@
import VASSAL.command.Command;
import VASSAL.tools.SequenceEncoder;
+/**
+ * Decorator that filters events to prevent a GamePiece from
+ * being selected and/or moved.
+ *
+ * Note: The Alt selection filter was originally implemented
+ * as a ctl-shift filter, but this conflicts with the standard counter
+ * selection interface and has not worked since v3.0.
+ *
+ */
public class Immobilized extends Decorator implements EditablePiece {
public static final String ID = "immob;";
protected boolean shiftToSelect = false;
- protected boolean ctlShiftToSelect = false;
+ protected boolean altToSelect = false;
protected boolean ignoreGrid = false;
protected boolean neverSelect = false;
protected boolean neverMove = false;
@@ -48,19 +57,19 @@
protected static final char MOVE_NORMAL = 'N';
protected static final char NEVER_MOVE = 'V';
protected static final char IGNORE_GRID = 'g';
- protected static final char SHIFT_SELECT = 'i';
- protected static final char CTL_SHIFT_SELECT = 'c';
+ protected static final char SHIFT_SELECT = 'i';
+ protected static final char ALT_SELECT = 'c'; //NB. Using 'c' to maintain compatibility with old ctl-shift version
protected static final char NEVER_SELECT = 'n';
- protected class UseShift implements EventFilter {
+ public class UseShift implements EventFilter {
public boolean rejectEvent(InputEvent evt) {
return !evt.isShiftDown() && !Boolean.TRUE.equals(getProperty(Properties.SELECTED));
}
};
- protected class UseCtlShift implements EventFilter {
+ public class UseAlt implements EventFilter {
public boolean rejectEvent(InputEvent evt) {
- return !(evt.isShiftDown() && evt.isControlDown()) &&!Boolean.TRUE.equals(getProperty(Properties.SELECTED));
+ return !evt.isAltDown() && !Boolean.TRUE.equals(getProperty(Properties.SELECTED));
}
};
@@ -88,7 +97,7 @@
public void mySetType(String type) {
shiftToSelect = false;
- ctlShiftToSelect = false;
+ altToSelect = false;
neverSelect = false;
ignoreGrid = false;
neverMove = false;
@@ -101,8 +110,8 @@
shiftToSelect = true;
moveIfSelected = true;
}
- if (selectionOptions.indexOf(CTL_SHIFT_SELECT) >= 0) {
- ctlShiftToSelect = true;
+ if (selectionOptions.indexOf(ALT_SELECT) >= 0) {
+ altToSelect = true;
moveIfSelected = true;
}
if (selectionOptions.indexOf(NEVER_SELECT) >= 0) {
@@ -133,8 +142,8 @@
else if (shiftToSelect) {
selectFilter = new UseShift();
}
- else if (ctlShiftToSelect) {
- selectFilter = new UseCtlShift();
+ else if (altToSelect) {
+ selectFilter = new UseAlt();
}
else {
selectFilter = null;
@@ -231,8 +240,8 @@
else if (shiftToSelect) {
buffer.append(SHIFT_SELECT);
}
- else if (ctlShiftToSelect) {
- buffer.append(CTL_SHIFT_SELECT);
+ else if (altToSelect) {
+ buffer.append(ALT_SELECT);
}
if (ignoreGrid) {
buffer.append(IGNORE_GRID);
@@ -279,12 +288,12 @@
selectionOption = new JComboBox();
selectionOption.addItem("normally");
selectionOption.addItem("when shift-key down");
- selectionOption.addItem("when ctl-shift-key down");
+ selectionOption.addItem("when alt-key down");
selectionOption.addItem("never");
if (p.neverSelect) {
selectionOption.setSelectedIndex(3);
}
- else if (p.ctlShiftToSelect) {
+ else if (p.altToSelect) {
selectionOption.setSelectedIndex(2);
}
else if (p.shiftToSelect) {
@@ -332,7 +341,7 @@
s += SHIFT_SELECT;
break;
case 2:
- s += CTL_SHIFT_SELECT;
+ s += ALT_SELECT;
break;
case 3:
s += NEVER_SELECT;
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/i18n/VASSAL.properties
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/i18n/VASSAL.properties 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/i18n/VASSAL.properties 2009-04-10 16:03:59 UTC (rev 5483)
@@ -117,6 +117,10 @@
Error.infinite_loop_heading=Infinite Loop
Error.infinite_loop_message=Vassal %1$s component '%2$s' has entered an infinite loop.
+Error.module_too_new_title=Module Too New
+Error.module_too_new_heading=Module Too New to Edit
+Error.module_too_new_message=The module you are trying to edit (%1$s) was created with VASSAL %2$s. This version of VASSAL (%3$s) cannot edit modules which are that new.
+
# Bad Module Data Error Messages
Error.data_error_message=Bad Data in Module: %1$s %2$s
Error.not_found=%1$s not found
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/AbstractLaunchAction.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/AbstractLaunchAction.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/AbstractLaunchAction.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
+import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
@@ -57,6 +58,7 @@
import VASSAL.preferences.Prefs;
import VASSAL.preferences.ReadOnlyPrefs;
import VASSAL.tools.ErrorDialog;
+import VASSAL.tools.FutureUtils;
import VASSAL.tools.MemoryUtils;
import VASSAL.tools.StringUtils;
import VASSAL.tools.ThrowableUtils;
@@ -305,44 +307,44 @@
initialHeap = FAILSAFE_INITIAL_HEAP;
maximumHeap = FAILSAFE_MAXIMUM_HEAP;
- WarningDialog.show(
+ FutureUtils.wait(WarningDialog.show(
"Warning.maximum_heap_too_large",
FAILSAFE_MAXIMUM_HEAP
- );
+ ));
}
// maximum heap must be at least the failsafe size
else if (maximumHeap < FAILSAFE_MAXIMUM_HEAP) {
initialHeap = FAILSAFE_INITIAL_HEAP;
maximumHeap = FAILSAFE_MAXIMUM_HEAP;
- WarningDialog.show(
+ FutureUtils.wait(WarningDialog.show(
"Warning.maximum_heap_too_small",
FAILSAFE_MAXIMUM_HEAP
- );
+ ));
}
// initial heap must be at least the failsafe size
else if (initialHeap < FAILSAFE_INITIAL_HEAP) {
initialHeap = FAILSAFE_INITIAL_HEAP;
maximumHeap = FAILSAFE_MAXIMUM_HEAP;
- WarningDialog.show(
+ FutureUtils.wait(WarningDialog.show(
"Warning.initial_heap_too_small",
FAILSAFE_INITIAL_HEAP
- );
+ ));
}
// initial heap must be less than or equal to maximum heap
else if (initialHeap > maximumHeap) {
initialHeap = FAILSAFE_INITIAL_HEAP;
maximumHeap = FAILSAFE_MAXIMUM_HEAP;
- WarningDialog.show(
+ FutureUtils.wait(WarningDialog.show(
"Warning.initial_heap_too_large",
FAILSAFE_INITIAL_HEAP
- );
+ ));
}
// create a socket for communicating which the child process
- serverSocket = new ServerSocket(0);
+ serverSocket = new ServerSocket(0, 0, InetAddress.getByName(null));
cmdS = new LaunchCommandServer(serverSocket);
new Thread(cmdS).start();
@@ -397,10 +399,10 @@
throw new IOException("failed to start child process");
}
else {
- WarningDialog.show(
+ FutureUtils.wait(WarningDialog.show(
"Warning.maximum_heap_too_large",
FAILSAFE_MAXIMUM_HEAP
- );
+ ));
}
}
@@ -470,7 +472,9 @@
oout = new ObjectOutputStream(p.getOutputStream());
oout.writeInt(serverSocket.getLocalPort());
oout.writeObject(lr);
- oout.close();
+ // Note: We don't try to close() the socket here because the
+ // pipe might already have been closed from the other end,
+ // and that would cause close() to throw spuriously.
}
finally {
IOUtils.closeQuietly(oout);
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Editor.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Editor.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Editor.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -278,6 +278,16 @@
// prompt the user to pick a module
if (promptForFile() == null) return;
+ final AbstractMetaData data = MetaDataFactory.buildMetaData(lr.module);
+ if (Info.isTooNewToEdit(data.getVassalVersion())) {
+ ErrorDialog.show(
+ "Error.module_too_new",
+ lr.module.getPath(),
+ data.getVassalVersion(),
+ Info.getVersion()
+ );
+ return;
+ }
super.actionPerformed(e);
}
}
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Launcher.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Launcher.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/Launcher.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -26,6 +26,7 @@
import java.io.ObjectInputStream;
import java.io.PrintStream;
import java.io.Serializable;
+import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
@@ -115,7 +116,8 @@
if (!standalone) {
try {
// set up our command listener
- final ServerSocket serverSocket = new ServerSocket(0);
+ final ServerSocket serverSocket =
+ new ServerSocket(0, 0, InetAddress.getByName(null));
cmdS = createCommandServer(serverSocket);
new Thread(cmdS).start();
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManager.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManager.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManager.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -27,10 +27,15 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintStream;
+import java.io.RandomAccessFile;
+import java.lang.reflect.InvocationTargetException;
import java.net.BindException;
import java.net.ConnectException;
+import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
+import java.nio.channels.FileLock;
+import java.nio.channels.OverlappingFileLockException;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
@@ -66,17 +71,11 @@
*/
public class ModuleManager {
- private static final String MODULE_MANAGER_PORT = "moduleManagerPort";
- private static final String MODULE_MANAGER_KEY = "moduleManagerKey";
-
private static final String NEXT_VERSION_CHECK = "nextVersionCheck";
public static final String MAXIMUM_HEAP = "maximumHeap"; //$NON-NLS-1$
public static final String INITIAL_HEAP = "initialHeap"; //$NON-NLS-1$
- private static int port;
- private static long key;
-
public static void main(String[] args) {
// parse command-line arguments
LaunchRequest lr = null;
@@ -84,6 +83,7 @@
lr = LaunchRequest.parseArgs(args);
}
catch (LaunchRequestException e) {
+// FIXME: should be a dialog...
System.err.println("VASSAL: " + e.getMessage());
System.exit(1);
}
@@ -102,97 +102,122 @@
return;
}
- // set up security key so other users can't talk with our socket
- final LongConfigurer keyConfig =
- new LongConfigurer(MODULE_MANAGER_KEY, null, -1L);
- Prefs.getGlobalPrefs().addOption(null, keyConfig);
-
- key = keyConfig.getLongValue(-1L);
- if (key == -1) {
- key = (long) (Math.random() * Long.MAX_VALUE);
- keyConfig.setValue(key);
+ //
+ // How we start exactly one request server:
+ //
+ // To ensure that exactly one process acts as the request server, we
+ // acquire a lock on the ~/VASSAL/key file, and then attempt to acquire
+ // a lock on the ~/VASSAL/lock file. If we cannot lock ~/VASSAL/lock,
+ // then there is already a server running; in that case, we read the
+ // port number and security key from ~/VASSAL/key. If we can lock
+ // ~/VASSAL/lock, then we start the server, write the port number and
+ // key to ~/VASSAL/key, and continue to hold the lock on ~/VASSAL/lock.
+ // Finally, we unlock ~/VASSAL/key and proceed to act as a client,
+ // sending requests over localhost:port using the security key.
+ //
+ // The advantages of this method are:
+ //
+ // (1) No race conditions between processes started at the same time.
+ // (2) No port collisions, because we don't use a predetermined port.
+ //
+
+ final File keyfile = new File(Info.getConfDir(), "key");
+ final File lockfile = new File(Info.getConfDir(), "lock");
+
+ int port = 0;
+ long key = 0;
+
+ RandomAccessFile kraf = null;
+ FileLock klock = null;
+ try {
+ // acquire an exclusive lock on the key file
+ kraf = new RandomAccessFile(keyfile, "rw");
+
try {
- Prefs.getGlobalPrefs().write();
+ klock = kraf.getChannel().lock();
}
- catch (IOException e) {
- WriteErrorDialog.error(e, Prefs.getGlobalPrefs().getFile().getPath());
+ catch (OverlappingFileLockException e) {
+ throw (IOException) new IOException().initCause(e);
}
- }
+
+ // determine whether we are the server or a client
- lr.key = key;
+ // Note: We purposely keep lout open in the case where we are the
+ // server, because closing lout will release the lock.
+ FileLock lock = null;
+ final FileOutputStream lout = new FileOutputStream(lockfile);
+ try {
+ lock = lout.getChannel().tryLock();
+ }
+ catch (OverlappingFileLockException e) {
+ throw (IOException) new IOException().initCause(e);
+ }
- // set up prefs for port to listen on
- final IntConfigurer portConfig =
- new IntConfigurer(MODULE_MANAGER_PORT, null, -1);
- Prefs.getGlobalPrefs().addOption(null, portConfig);
-
- // set port from command-line if specified; else try the prefs
- if (lr.port >= 0) {
- port = lr.port;
+ if (lock != null) {
+ // we have the lock, so we will be the request server
- // we have a port, write it to the prefs
- portConfig.setValue(port);
- try {
- Prefs.getGlobalPrefs().write();
+ // bind to an available port on the loopback device
+ final ServerSocket serverSocket =
+ new ServerSocket(0, 0, InetAddress.getByName(null));
+
+ // write the port number where we listen to the key file
+ port = serverSocket.getLocalPort();
+ kraf.writeInt(port);
+
+ // create new security key and write it to the key file
+ key = (long) (Math.random() * Long.MAX_VALUE);
+ kraf.writeLong(key);
+
+ // create a new Module Manager
+ new ModuleManager(serverSocket, key, lout, lock);
}
- catch (IOException e) {
- WriteErrorDialog.error(e, Prefs.getGlobalPrefs().getFile().getPath());
+ else {
+ // we do not have the lock, so we will be a request client
+ lout.close();
+
+ // read the port number we will connect to from the key file
+ port = kraf.readInt();
+
+ // read the security key from the key file
+ key = kraf.readLong();
}
- }
- else {
- port = portConfig.getIntValue(-1);
- }
- // try to create ModuleManager
- try {
- new ModuleManager();
+ kraf.close();
}
- catch (BindException e) {
- // if this fails, a ModuleManager is already listening
- }
catch (IOException e) {
- // should not happen
- ErrorDialog.bug(e);
+// FIXME: should be a dialog...
+ System.err.println("VASSAL: IO error");
+ e.printStackTrace();
System.exit(1);
- }
+ }
+ finally {
+ // this will also release the lock on the key file
+ IOUtils.closeQuietly(kraf);
+ }
+
+ lr.key = key;
// pass launch parameters on to the ModuleManager via the socket
Socket clientSocket = null;
ObjectOutputStream out = null;
InputStream in = null;
-
try {
- try {
- clientSocket = new Socket((String) null, port);
- }
- catch (IOException e) {
- System.err.println("VASSAL: Couldn't open socket.");
- e.printStackTrace();
- System.exit(1);
- }
+ clientSocket = new Socket((String) null, port);
- try {
- out = new ObjectOutputStream(
- new BufferedOutputStream(clientSocket.getOutputStream()));
- out.writeObject(lr);
- out.flush();
- }
- catch (IOException e) {
- System.err.println("VASSAL: Couldn't write to socket.");
- e.printStackTrace();
- System.exit(1);
- }
+ out = new ObjectOutputStream(
+ new BufferedOutputStream(clientSocket.getOutputStream()));
+ out.writeObject(lr);
+ out.flush();
- try {
- in = clientSocket.getInputStream();
- IOUtils.copy(in, System.err);
- }
- catch (IOException e) {
- System.err.println("VASSAL: Couldn't read from socket.");
- e.printStackTrace();
- System.exit(1);
- }
+ in = clientSocket.getInputStream();
+ IOUtils.copy(in, System.err);
}
+ catch (IOException e) {
+// FIXME: should be a dialog...
+ System.err.println("VASSAL: Problem with socket on port " + port);
+ e.printStackTrace();
+ System.exit(1);
+ }
finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
@@ -200,52 +225,33 @@
}
}
- private final ServerSocket serverSocket;
-
private static ModuleManager instance = null;
public static ModuleManager getInstance() {
return instance;
}
- public ModuleManager() throws IOException {
+ private final long key;
+
+ private FileOutputStream lout;
+ private FileLock lock;
+
+ private final ServerSocket serverSocket;
+
+ public ModuleManager(ServerSocket serverSocket, long key,
+ FileOutputStream lout, FileLock lock)
+ throws IOException {
+
if (instance != null) throw new IllegalStateException();
instance = this;
- // if the port is bad, try a random port
- if (port < 0 || port > 65535) {
- ServerSocket socket = null;
+ this.serverSocket = serverSocket;
+ this.key = key;
- while (socket == null) {
- // check a random port in the range [49152,65535]
- port = (int)(Math.random() * 16384) + 49152;
- try {
- socket = new ServerSocket(port);
+ // we hang on to these to prevent the lock from being lost
+ this.lout = lout;
+ this.lock = lock;
- // we have a port, write it to the prefs
- final IntConfigurer portConfig = (IntConfigurer)
- Prefs.getGlobalPrefs().getOption(MODULE_MANAGER_PORT);
- portConfig.setValue(port);
- try {
- Prefs.getGlobalPrefs().write();
- }
- catch (IOException e) {
- WriteErrorDialog.error(e,
- Prefs.getGlobalPrefs().getFile().getPath());
- }
- }
- catch (ConnectException e) {
- // we can't connect, try another port
- IOUtils.closeQuietly(socket);
- }
- }
-
- serverSocket = socket;
- }
- else {
- serverSocket = new ServerSocket(port);
- }
-
final StartUp start = Info.isMacOSX() ?
new ModuleManagerMacOSXStartUp() : new StartUp();
@@ -400,8 +406,42 @@
return "incorrect key";
}
-// FIXME: is this being run on the EDT?
+ final LaunchRequestHandler handler = new LaunchRequestHandler(lr);
+ try {
+ SwingUtilities.invokeAndWait(handler);
+ }
+ catch (InterruptedException e) {
+ return "interrupted"; // FIXME
+ }
+ catch (InvocationTargetException e) {
+ ErrorDialog.bug(e);
+ return null;
+ }
+
+ return handler.getResult();
+ }
+ else {
+ return "unrecognized command"; // FIXME
+ }
+ }
+ private static class LaunchRequestHandler implements Runnable {
+ private final LaunchRequest lr;
+ private String result;
+
+ public LaunchRequestHandler(LaunchRequest lr) {
+ this.lr = lr;
+ }
+
+ public void run() {
+ result = handle();
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+ private String handle() {
final ModuleManagerWindow window = ModuleManagerWindow.getInstance();
switch (lr.mode) {
@@ -451,7 +491,8 @@
new Editor.LaunchAction(window, lr.module).actionPerformed(null);
break;
case IMPORT:
- new Editor.ImportLaunchAction(window, lr.importFile).actionPerformed(null);
+ new Editor.ImportLaunchAction(
+ window, lr.importFile).actionPerformed(null);
break;
case NEW:
new Editor.NewModuleLaunchAction(window).actionPerformed(null);
@@ -460,13 +501,12 @@
return "not yet implemented"; // FIXME
case NEW_EXT:
return "not yet implemented"; // FIXME
+ default:
+ return "unrecognized mode"; // FIXME
}
+
+ return null;
}
- else {
- return "unrecognized command"; // FIXME
- }
-
- return null;
}
private static class ModuleManagerMenuManager extends MenuManager {
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManagerWindow.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManagerWindow.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/launch/ModuleManagerWindow.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -1275,7 +1275,9 @@
public JPopupMenu buildPopup(int row) {
final JPopupMenu m = new JPopupMenu();
m.add(new Player.LaunchAction(ModuleManagerWindow.this, file));
- m.add(new Editor.ListLaunchAction(ModuleManagerWindow.this, file));
+ final Action editAction = new Editor.ListLaunchAction(ModuleManagerWindow.this, file);
+ editAction.setEnabled(!Info.isTooNewToEdit(metadata.getVassalVersion()));
+ m.add(editAction);
m.add(new AbstractAction(Resources.getString("General.remove")) {
private static final long serialVersionUID = 1L;
@@ -1410,8 +1412,10 @@
m.add(new ActivateExtensionAction(Resources.getString(isActive() ?
"ModuleManager.deactivate" : "ModuleManager.activate")));
- m.add(new EditExtensionLaunchAction(
- ModuleManagerWindow.this, getFile(), getSelectedModule()));
+ final Action editAction = new EditExtensionLaunchAction(
+ ModuleManagerWindow.this, getFile(), getSelectedModule());
+ editAction.setEnabled(!Info.isTooNewToEdit(metadata.getVassalVersion()));
+ m.add(editAction);
return m;
}
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/DialogUtils.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/DialogUtils.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/DialogUtils.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -25,6 +25,7 @@
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
import javax.swing.SwingUtilities;
@@ -61,8 +62,8 @@
private static final ExecutorService ex = Executors.newSingleThreadExecutor();
- public static void enqueue(final Runnable runnable) {
- ex.submit(new Runnable() {
+ public static Future<?> enqueue(final Runnable runnable) {
+ return ex.submit(new Runnable() {
public void run() {
try {
SwingUtilities.invokeAndWait(runnable);
Modified: VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/ErrorDialog.java
===================================================================
--- VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/ErrorDialog.java 2009-04-08 10:09:38 UTC (rev 5482)
+++ VASSAL-src/branches/uckelman-3.1/src/VASSAL/tools/ErrorDialog.java 2009-04-10 16:03:59 UTC (rev 5483)
@@ -24,6 +24,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import java.util.concurrent.Future;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
@@ -67,91 +68,101 @@
}
}
- public static void show(
+ public static Future<?> show(
String messageKey,
Object... args)
{
- ProblemDialog.show(JOptionPane.ERROR_MESSAGE, messageKey, args);
+ return ProblemDialog.show(JOptionPane.ERROR_MESSAGE, messageKey, args);
}
- public static void show(
+ public static Future<?> show(
Component parent,
String messageKey,
Object... args)
{
- ProblemDialog.show(JOptionPane.ERROR_MESSAGE, parent, messageKey, args);
+ return ProblemDialog.show(
+ JOptionPane.ERROR_MESSAGE, parent, messageKey, args
+ );
}
- public static void show(
+ public static Future<?> show(
Throwable thrown,
String messageKey,
Object... args)
{
- ProblemDialog.show(JOptionPane.ERROR_MESSAGE, thrown, messageKey, args);
+ return ProblemDialog.show(
+ JOptionPane.ERROR_MESSAGE, thrown, messageKey, args
+ );
}
- public static void show(
+ public static Future<?> show(
final Component parent,
final Throwable thrown,
final String messageKey,
final Object... args)
{
- ProblemDialog.show(JOptionPane.ERROR_MESSAGE, parent,
- thrown, messageKey, args);
+ return ProblemDialog.show(
+ JOptionPane.ERROR_MESSAGE, parent, thrown, messageKey, args
+ );
}
- public static void show(
+ public static Future<?> show(
final Component parent,
final Throwable thrown,
final String title,
final String heading,
final String message)
{
- ProblemDialog.show(JOptionPane.ERROR_MESSAGE, parent,
- thrown, title, heading, message);
+ return ProblemDialog.show(
+ JOptionPane.ERROR_MESSAGE, parent, thrown, title, heading, message
+ );
}
- public static void showDisableable(
+ public static Future<?> showDisableable(
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDisableable(JOptionPane.ERROR_MESSAGE,
- key, messageKey, args);
+ return ProblemDialog.showDisableable(
+ JOptionPane.ERROR_MESSAGE, key, messageKey, args
+ );
}
- public static void showDisableable(
+ public static Future<?> showDisableable(
Component parent,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDisableable(JOptionPane.ERROR_MESSAGE,
- parent, key, messageKey, args);
+ return ProblemDialog.showDisableable(
+ JOptionPane.ERROR_MESSAGE, parent, key, messageKey, args
+ );
}
- public static void showDisableable(
+ public static Future<?> showDisableable(
Throwable thrown,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDisableable(JOptionPane.ERROR_MESSAGE,
- thrown, key, messageKey, args);
+ return ProblemDialog.showDisableable(
+ JOptionPane.ERROR_MESSAGE, thrown, key, messageKey, args
+ );
}
- public static void showDisableable(
+ public static Future<?> showDisableable(
Component parent,
Throwable thrown,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDisableable(JOptionPane.ERROR_MESSAGE, parent,
- thrown, key, messageKey, args);
+ return ProblemDialog.showDisableable(
+ JOptionPane.ERROR_MESSAGE, parent, thrown, key, messageKey, args
+ );
}
- public static void showDisableable(
+ public static Future<?> showDisableable(
Component parent,
Throwable thrown,
Object key,
@@ -159,51 +170,56 @@
String heading,
String message)
{
- ProblemDialog.showDisableable(JOptionPane.ERROR_MESSAGE, parent,
- thrown, key, title, heading, message);
+ return ProblemDialog.showDisableable(
+ JOptionPane.ERROR_MESSAGE, parent, thrown, key, title, heading, message
+ );
}
- public static void showDetails(
+ public static Future<?> showDetails(
String details,
String messageKey,
Object... args)
{
- ProblemDialog.showDetails(JOptionPane.ERROR_MESSAGE,
- details, messageKey, args);
+ return ProblemDialog.showDetails(
+ JOptionPane.ERROR_MESSAGE, details, messageKey, args
+ );
}
- public static void showDetails(
+ public static Future<?> showDetails(
Component parent,
String details,
String messageKey,
Object... args)
{
- ProblemDialog.showDetails(JOptionPane.ERROR_MESSAGE,
- parent, details, messageKey, args);
+ return ProblemDialog.showDetails(
+ JOptionPane.ERROR_MESSAGE, parent, details, messageKey, args
+ );
}
- public static void showDetails(
+ public static Future<?> showDetails(
Throwable thrown,
String details,
String messageKey,
Object... args)
{
- ProblemDialog.showDetails(JOptionPane.ERROR_MESSAGE,
- thrown, details, messageKey, args);
+ return ProblemDialog.showDetails(
+ JOptionPane.ERROR_MESSAGE, thrown, details, messageKey, args
+ );
}
- public static void showDetails(
+ public static Future<?> showDetails(
Component parent,
Throwable thrown,
String details,
String messageKey,
Object... args)
{
- ProblemDialog.showDetails(JOptionPane.ERROR_MESSAGE,
- parent, thrown, details, messageKey, args);
+ return ProblemDialog.showDetails(
+ JOptionPane.ERROR_MESSAGE, parent, thrown, details, messageKey, args
+ );
}
- public static void showDetails(
+ public static Future<?> showDetails(
Component parent,
Throwable thrown,
String details,
@@ -211,43 +227,48 @@
String heading,
String message)
{
- ProblemDialog.showDetails(JOptionPane.ERROR_MESSAGE,
- parent, thrown, details, title, heading, message);
+ return ProblemDialog.showDetails(
+ JOptionPane.ERROR_MESSAGE, parent,
+ thrown, details, title, heading, message
+ );
}
- public static void showDetailsDisableable(
+ public static Future<?> showDetailsDisableable(
String details,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDetailsDisableable(JOptionPane.ERROR_MESSAGE,
- details, key, messageKey, args);
+ return ProblemDialog.showDetailsDisableable(
+ JOptionPane.ERROR_MESSAGE, details, key, messageKey, args
+ );
}
- public static void showDetailsDisableable(
+ public static Future<?> showDetailsDisableable(
Component parent,
String details,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDetailsDisableable(JOptionPane.ERROR_MESSAGE,
- parent, details, key, messageKey, args);
+ return ProblemDialog.showDetailsDisableable(
+ JOptionPane.ERROR_MESSAGE, parent, details, key, messageKey, args
+ );
}
- public static void showDetailsDisableable(
+ public static Future<?> showDetailsDisableable(
Throwable thrown,
String details,
Object key,
String messageKey,
Object... args)
{
- ProblemDialog.showDetailsDisableable(JOptionPane.ERROR_MESSAGE,
- thrown, details, key, messageKey, args);
+ return ProblemDialog.showDetailsDisableable(
+ JOptionPane.ERROR_MESSAGE, thrown, details, key, messageKey, args
+ );
}
- public static void showDetailsDisableable(
+ public static Future<?> showDetailsDisableable(
Component parent,
Throwable thrown,
String details,
@@ -255,11 +276,13 @@
String messageKey,
Object... args)
{
- ProblemDialog.showDetailsDisableable(JOptionPane.ERROR_MESSAGE,
- parent, thrown, details, key, messageKey, args);
+ return ProblemDialog.showDetailsDisableable(
+ JOptionPane.ERROR_MESSAGE, parent,
+ thrown, details, key, messageKey, args
+ );
}
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|