From: <aki...@us...> - 2010-10-28 19:28:44
|
Revision: 8740 http://gridarta.svn.sourceforge.net/gridarta/?rev=8740&view=rev Author: akirschbaum Date: 2010-10-28 19:28:32 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Fix 'custom type' map validator to not flag mobs within spawn points. Modified Paths: -------------- trunk/build.xml trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java Added Paths: ----------- trunk/test-mapvalidator/daimonin/ trunk/test-mapvalidator/daimonin/arch/ trunk/test-mapvalidator/daimonin/arch/artifacts trunk/test-mapvalidator/daimonin/arch/dev/ trunk/test-mapvalidator/daimonin/arch/dev/editor/ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/autojoin.txt trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/pickmaps/ trunk/test-mapvalidator/daimonin/arch/floor1.arc trunk/test-mapvalidator/daimonin/arch/mob1.arc trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc trunk/test-mapvalidator/daimonin/arch/treasures trunk/test-mapvalidator/daimonin/maps/ trunk/test-mapvalidator/daimonin/maps/CustomType trunk/test-mapvalidator/daimonin/maps/CustomType.expected trunk/test-mapvalidator/daimonin/maps/dev/ trunk/test-mapvalidator/daimonin/maps/dev/editor/ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator trunk/test-mapvalidator/daimonin/regtest.conf Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/build.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -843,7 +843,7 @@ </javadoc> </target> - <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire"/> + <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire,test-mapvalidator-daimonin"/> <target name="test-junit" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-textedit,test-utils"> <junitreport todir="docs/test"> @@ -1050,4 +1050,11 @@ </java> </target> + <target name="test-mapvalidator-daimonin" description="Executes the map validator tests using DaimoninEditor.jar." depends="jar-daimonin"> + <java jar="DaimoninEditor.jar" failonerror="true" fork="true"> + <arg value="--config=test-mapvalidator/daimonin/regtest.conf"/> + <arg value="--script=MapValidator"/> + </java> + </target> + </project> Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/daimonin/ChangeLog 2010-10-28 19:28:32 UTC (rev 8740) @@ -1,3 +1,8 @@ +2010-10-28 Andreas Kirschbaum + + * Fix 'custom type' map validator to not flag mobs within spawn + points. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java 2010-10-28 19:28:32 UTC (rev 8740) @@ -204,7 +204,7 @@ } else { final int envType; try { - envType = Integer.parseInt(tmp[1]); + envType = Integer.parseInt(tmp[2]); } catch (final NumberFormatException ex) { throw new NoSuchValidatorException("invalid env type: " + args[pos], ex); } Property changes on: trunk/test-mapvalidator/daimonin/arch/artifacts ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,67 @@ +<?xml version="1.0"?> +<!DOCTYPE GameObjectMatchers SYSTEM "GameObjectMatchers.dtd"> +<GameObjectMatchers> + + <GameObjectMatcher id="system_floor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="65 68 71" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_below_floor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="-666" /> + <!-- <Attrib name="layer" value="0" /> --> + </GameObjectMatcher> + + <GameObjectMatcher id="system_wall" system="true"> + <title xml:lang="en">T</title> + <And> + <TypeNrs numbers="77" /> + <Attrib name="layer" value="7" op="ne" /> + </And> + </GameObjectMatcher> + + <GameObjectMatcher id="system_monster" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="80 81 83" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_exit" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="41 66 69 94 95" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_environment_sensor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="133" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_monster_only" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="80 83" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_combat_values_objects" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="5 6 7 13 39 54 62 72 73 80 83 154 158" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_source" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="17 18 27 30 31 32 51 64 92 93 132 133 134" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_sink" system="true"> + <title xml:lang="en">T</title> + <Or> + <TypeNrs numbers="26 41 42 55 62 65 74 78 81 91 94 98 112 132" /> + </Or> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_sink2" system="true"> + <title xml:lang="en">T</title> + <Env/> + <TypeNrs numbers="-666" /> + </GameObjectMatcher> + +</GameObjectMatchers> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<!DOCTYPE lists SYSTEM "TreasureLists.dtd"> +<lists> +</lists> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,16 @@ +0 0 +1 2 +2 1 +2 2 +2 3 +3 2 +3 3 +2 4 +4 2 +2 5 +5 2 +3 4 +4 3 +2 7 +7 2 +4 4 Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/autojoin.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE spells SYSTEM "spells.dtd"> +<spells> +<spell id="0" name="none"/> +</spells> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,30 @@ +<?xml version="1.0" standalone="no" ?> +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists> + <list name="event"> + <listentry value="1" name="apply"/> + </list> + </lists> + <ignorelists/> + + <default_type> + <attribute arch="name" editor="name" type="string"> + This is the name of the object, displayed to the player. + </attribute> + </default_type> + + <type number="0" name="Misc"/> + + <type number="80" name="Mob"> + <attribute arch="dam" editor="damage" type="int"/> + </type> + + <type number="81" name="Spawn Point"/> + + <type number="83" name="Spawn Point Mob"> + <attribute arch="dam" editor="damage" type="int"/> + </type> + +</types> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/floor1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/floor1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/floor1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,3 @@ +Object floor1 +type 71 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/floor1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/mob1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/mob1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/mob1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,3 @@ +Object mob1 +type 80 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/mob1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,4 @@ +Object spawnpoint1 +type 81 +last_heal 9 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Property changes on: trunk/test-mapvalidator/daimonin/arch/treasures ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/CustomType =================================================================== --- trunk/test-mapvalidator/daimonin/maps/CustomType (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/CustomType 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,36 @@ +arch map +name test for CustomType map validator +msg +Modified: 2010-10-28 ank +endmsg +width 3 +height 1 +difficulty 1 +darkness -1 +end +arch floor1 +end +arch spawnpoint1 +arch mob1 +type 83 +dam 1 +end +end +arch floor1 +x 1 +end +arch spawnpoint1 +x 1 +arch mob1 +type 82 +dam 1 +end +end +arch floor1 +x 2 +end +arch mob1 +type 83 +dam 1 +x 2 +end Property changes on: trunk/test-mapvalidator/daimonin/maps/CustomType ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/CustomType.expected =================================================================== --- trunk/test-mapvalidator/daimonin/maps/CustomType.expected (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/CustomType.expected 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,2 @@ +[1|0] Object with custom type [mob1] [mob1] [80, 82] +[2|0] Object with custom type [mob1] [mob1] [80, 83] Property changes on: trunk/test-mapvalidator/daimonin/maps/CustomType.expected ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator =================================================================== --- trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script> + <name>MapValidator</name> + <code><![CDATA[import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.InputStream; +import java.util.Iterator; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.RecursiveFileIterator; +import net.sf.gridarta.model.validation.ErrorCollector; +import net.sf.gridarta.model.validation.errors.ValidationError; + +String checkMap(File mapFile, String mapPath) { + try { + map = mapManager.openMapFile(mapFile, false); + } catch (IOException ex) { + print("Cannot load map '"+mapFile+"': "+ex.getMessage()); + return null; + } + if (map == null) { + print(mapPath + ":"); + print("- cannot load map file"); + return null; + } + + ErrorCollector errorCollector; + try { + try { + validators.validateAll(map.getMapModel()); + } finally { + errorCollector = map.getMapModel().getErrors(); + } + } finally { + mapManager.release(map); + } + + StringBuffer sb = new StringBuffer(); + Iterator it = errorCollector.iterator(); + while (it.hasNext()) { + ValidationError validationError = it.next(); + + sb.append(validationError); + + Iterator it2 = validationError.getGameObjects().iterator(); + while (it2.hasNext()) { + GameObject gameObject = it2.next(); + sb.append(" [").append(gameObject.getBestName()).append(']'); + } + + String parameter0 = validationError.getParameter(0); + if (parameter0 != null) { + sb.append(" [").append(parameter0); + String parameter1 = validationError.getParameter(1); + if (parameter1 != null) { + sb.append(", ").append(parameter1); + } + sb.append(']'); + } + sb.append("\n"); + } + + return sb.toString(); +} + +if (baseDirectory == null || baseDirectory.length() <= 0) { + baseDirectory = "/"; +} +print("Checking maps below " + baseDirectory + "..."); +if (baseDirectory.endsWith("/")) { + baseDirectory = baseDirectory.substring(0, baseDirectory.length() - 1); +} + +String mapDefaultFolder = globalSettings.getMapsDirectory().getPath(); +String rootDirectory = mapDefaultFolder + baseDirectory; +boolean ok = true; +Iterator it = new RecursiveFileIterator(new File(rootDirectory)); +while (it.hasNext()) { + File file = it.next(); + String name = file.getName(); + String path = file.getPath(); + if (file.isFile() + && path.startsWith(rootDirectory) + && !name.endsWith(".expected")) { + File expectedFile = new File(file.getPath() + ".expected"); + if (expectedFile.exists()) { + String result = checkMap(file, file.getPath().substring(mapDefaultFolder.length())); + + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + final InputStream inputStream = new FileInputStream(expectedFile); + try { + final byte[] buf = new byte[1024]; + for (;;) { + final int len = inputStream.read(buf); + if (len == -1) { + break; + } + byteArrayOutputStream.write(buf, 0, len); + } + } finally { + inputStream.close(); + } + final String expected = byteArrayOutputStream.toString("UTF-8"); + if (result.equals(expected)) { + print(file + ": OK"); + } else { + print(file + ": unexpected result:"); + print(result); + print("expected result:"); + print(expected); + ok = false; + } + } + } +} +if (!ok) { + throw new AssertionError(); +} +]]></code> + <mode> + <autoboot>false</autoboot> + <bash>true</bash> + <filter>false</filter> + </mode> + <parameter> + <name>baseDirectory</name> + <description>Base Directory</description> + <type>java.lang.String</type> + <value>/</value> + </parameter> +</script> + Property changes on: trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/regtest.conf =================================================================== --- trunk/test-mapvalidator/daimonin/regtest.conf (rev 0) +++ trunk/test-mapvalidator/daimonin/regtest.conf 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,104 @@ + +# Whether the map validator is enabled. +MapValidator.All=true + +UpdaterAutoCheck=false + +# Whether this map validator check is is enabled. +Validator.AttributeRange=true + +# Whether this map validator check is is enabled. +Validator.BlockedMobOrSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.BlockedSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.BlockedSquare=true + +# Whether this map validator check is is enabled. +Validator.ConnectedInsideContainer=true + +# Whether this map validator check is is enabled. +Validator.ConnectedPickable=true + +# Whether this map validator check is is enabled. +Validator.Connection=true + +# Whether this map validator check is enabled. +Validator.CustomType=true + +# Whether this map validator check is is enabled. +Validator.DoubleLayer=true + +# Whether this map validator check is is enabled. +Validator.DoubleType=true + +# Whether this map validator check is is enabled. +Validator.EmptySpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.Exit=true + +# Whether this map validator check is is enabled. +Validator.MapDifficulty=true + +# Whether this map validator check is is enabled. +Validator.MobOutsideSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.Slaying=true + +# Whether this map validator check is is enabled. +Validator.SquareWithoutFloor=true + +# Whether this map validator check is is enabled. +Validator.SysObjectNotOnLayerZero=true + +# Whether this map validator check is is enabled. +Validator.TilePaths=true + +# Whether this map validator check is is enabled. +Validator.UndefinedArchetype=true + +# Whether this map validator check is is enabled. +Validator.UndefinedFace=true + +# Whether this map validator check is is enabled. +Validator.UnsetSlaying=true + +# Archetype directory. +archDirectory=test-mapvalidator/daimonin/arch + +configSource=ARCH_DIRECTORY + +# Last displayed version of the help documentation. +docuVersion=1 + +filterRealMaps=true + +# Language for the user interface. +language=en + +# Maps directory. +mapDirectory=test-mapvalidator/daimonin/maps + +# The settings for alpha faces. +mapViewSettings.alphaType=0 + +# Whether autojoining is enabled. +mapViewSettings.autojoin=false + +# Whether double faces are shown. +mapViewSettings.doubleFaces=false + +# Whether the map grid is visible. +mapViewSettings.gridVisible=false + +# Whether smoothing is active. +mapViewSettings.smoothing=false + +mediaDirectory=test-mapvalidator/daimonin/client/media + +# The image set to use. +useImageSet= Property changes on: trunk/test-mapvalidator/daimonin/regtest.conf ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-29 18:50:36
|
Revision: 8743 http://gridarta.svn.sourceforge.net/gridarta/?rev=8743&view=rev Author: akirschbaum Date: 2010-10-29 18:50:29 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Require ant 1.7.0 to prevent unit tests from failing. Modified Paths: -------------- trunk/INSTALL trunk/README trunk/src/app/net/sf/gridarta/package.html Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/INSTALL 2010-10-29 18:50:29 UTC (rev 8743) @@ -9,7 +9,7 @@ Build Requirements ------------------ * Java Software Development Kit 5.0 or newer -* Ant 1.6.5 or newer, including the "optional" tasks +* Ant 1.7.0 or newer, including the "optional" tasks On Debian: install packages "ant" and "ant-optional". On Mandriva: install "ant-nodeps". Modified: trunk/README =================================================================== --- trunk/README 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/README 2010-10-29 18:50:29 UTC (rev 8743) @@ -41,7 +41,7 @@ auto-boxing, static imports, foreach loops, assertions, covariant return types and varargs quite a lot. -Ant 1.6.5 or later +Ant 1.7.0 or later Previous versions of Ant might work but are not tested. Modified: trunk/src/app/net/sf/gridarta/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/package.html 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/src/app/net/sf/gridarta/package.html 2010-10-29 18:50:29 UTC (rev 8743) @@ -20,6 +20,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <body> -Common classes for Gridarta that aren't sorted in other packages yet. +Base package of all Gridarta classes. This package contains only one interface: +{@link MainControl} which defines the location for storing preferences. All +other types are part of sub-packages. </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-01 13:52:25
|
Revision: 8744 http://gridarta.svn.sourceforge.net/gridarta/?rev=8744&view=rev Author: akirschbaum Date: 2010-11-01 13:52:18 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Suppress stray query dialog whether to delete the current pickmap folder when switching between pickmap folders. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/atrinik/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/crossfire/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/daimonin/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-28 Andreas Kirschbaum * Fix 'custom type' map validator to not flag mobs within spawn Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:52:18 UTC (rev 8744) @@ -254,11 +254,11 @@ return false; } - if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { - return false; - } + if (performAction) { + if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { + return false; + } - if (performAction) { try { mapFolderTree.removeMapFolder(mapFolder, true); } catch (final MapFolderNotEmptyException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-03 07:58:19
|
Revision: 8747 http://gridarta.svn.sourceforge.net/gridarta/?rev=8747&view=rev Author: akirschbaum Date: 2010-11-03 07:58:12 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Update game object matchers to handle redundant "attribute 0" lines. [Crossfire] Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/crossfire/ChangeLog 2010-11-03 07:58:12 UTC (rev 8747) @@ -1,3 +1,8 @@ +2010-11-03 Andreas Kirschbaum + + * Update game object matchers to handle redundant "attribute 0" + lines. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 07:58:12 UTC (rev 8747) @@ -40,6 +40,7 @@ <And> <TypeNrs numbers="0"/> <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> <Attrib name="is_floor" value=""/> </And> </GameObjectMatcher> @@ -48,7 +49,10 @@ <title xml:lang="de">Verbunden</title> <title xml:lang="fr">Objets connectés</title> <title xml:lang="sv">Anslutna</title> - <Attrib name="connected" op="ne" value=""/> + <And> + <Attrib name="connected" op="ne" value=""/> + <Attrib name="connected" op="ne" value="0"/> + </And> </GameObjectMatcher> <GameObjectMatcher id="exit"> <title xml:lang="en">Exit</title> @@ -64,7 +68,10 @@ <title xml:lang="sv">Skatter</title> <And> <TypeNrs numbers="4 5 36 60 85 111 123 124 130"/> - <Attrib name="no_pick" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> </And> </GameObjectMatcher> <GameObjectMatcher id="door"> @@ -81,13 +88,19 @@ <title xml:lang="sv">Utrustning</title> <And> <TypeNrs numbers="3 13 14 15 16 33 34 35 39 70 87 99 100 104 109 113 122"/> - <Attrib name="no_pick" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> </And> </GameObjectMatcher> <GameObjectMatcher id="blocked"> <title xml:lang="en">Blocked</title> <title xml:lang="de">Blockiert</title> - <Attrib name="move_block" op="ne" value=""/> + <And> + <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> + </And> </GameObjectMatcher> <GameObjectMatcher id="weak_wall"> <title xml:lang="en">Weak wall</title> @@ -177,7 +190,9 @@ <And> <TypeNrs numbers="0"/> <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> <Attrib name="is_floor" value=""/> + <Attrib name="is_floor" value="0"/> </And> </GameObjectMatcher> @@ -252,10 +267,22 @@ <title xml:lang="en">Paid items</title> <title xml:lang="de">Bezahlte Gegenstände</title> <And> - <Attrib name="no_pick" value=""/> - <Attrib name="unpaid" value=""/> - <Attrib name="monster" value=""/> - <Attrib name="generator" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> + <Or> + <Attrib name="unpaid" value=""/> + <Attrib name="unpaid" value="0"/> + </Or> + <Or> + <Attrib name="monster" value=""/> + <Attrib name="monster" value="0"/> + </Or> + <Or> + <Attrib name="generator" value=""/> + <Attrib name="generator" value="0"/> + </Or> </And> </GameObjectMatcher> Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 07:58:12 UTC (rev 8747) @@ -1,10 +1,11 @@ arch map name test for ShopSquare map validator difficulty 1 -width 1 -height 3 +width 5 +height 4 msg Created: 2010-06-27 Andreas Kirschbaum +Modified: 2010-11-03 Andreas Kirschbaum endmsg end arch shop2 @@ -12,15 +13,80 @@ arch rod1 end arch shop2 +y 3 +end +arch mob1 +y 3 +end +arch shop2 +x 1 y 1 end arch rod1 +x 1 y 1 +no_pick 0 +end +arch shop2 +x 1 +y 2 +end +arch rod1 +x 1 +y 2 +no_pick 1 +end +arch shop2 +x 2 +y 1 +end +arch rod1 +x 2 +y 1 +unpaid 0 +end +arch shop2 +x 2 +y 2 +end +arch rod1 +x 2 +y 2 unpaid 1 end arch shop2 +x 3 +y 1 +end +arch rod1 +x 3 +y 1 +monster 0 +end +arch shop2 +x 3 y 2 end -arch mob1 +arch rod1 +x 3 y 2 +monster 1 end +arch shop2 +x 4 +y 1 +end +arch rod1 +x 4 +y 1 +generator 0 +end +arch shop2 +x 4 +y 2 +end +arch rod1 +x 4 +y 2 +generator 1 +end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 07:58:12 UTC (rev 8747) @@ -1 +1,5 @@ [0|0] Shop square contains paid item +[1|1] Shop square contains paid item +[2|1] Shop square contains paid item +[3|1] Shop square contains paid item +[4|1] Shop square contains paid item This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-03 20:09:21
|
Revision: 8748 http://gridarta.svn.sourceforge.net/gridarta/?rev=8748&view=rev Author: akirschbaum Date: 2010-11-03 20:09:15 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Do not consider game objects with "weight 0" as items. [Crossfire] Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/test-mapvalidator/crossfire/arch/rod1.arc trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/crossfire/ChangeLog 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,5 +1,7 @@ 2010-11-03 Andreas Kirschbaum + * Do not consider game objects with "weight 0" as items. + * Update game object matchers to handle redundant "attribute 0" lines. Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 20:09:15 UTC (rev 8748) @@ -283,6 +283,8 @@ <Attrib name="generator" value=""/> <Attrib name="generator" value="0"/> </Or> + <Attrib name="weight" op="ne" value=""/> + <Attrib name="weight" op="ne" value="0"/> </And> </GameObjectMatcher> Modified: trunk/test-mapvalidator/crossfire/arch/rod1.arc =================================================================== --- trunk/test-mapvalidator/crossfire/arch/rod1.arc 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/arch/rod1.arc 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,4 +1,5 @@ Object rod1 type 3 level 1 +weight 10 end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,7 +1,7 @@ arch map name test for ShopSquare map validator difficulty 1 -width 5 +width 6 height 4 msg Created: 2010-06-27 Andreas Kirschbaum @@ -90,3 +90,21 @@ y 2 generator 1 end +arch shop2 +x 5 +y 1 +end +arch rod1 +x 5 +y 1 +weight 0 +end +arch shop2 +x 5 +y 2 +end +arch rod1 +x 5 +y 2 +weight 1 +end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 20:09:15 UTC (rev 8748) @@ -3,3 +3,4 @@ [2|1] Shop square contains paid item [3|1] Shop square contains paid item [4|1] Shop square contains paid item +[5|2] Shop square contains paid item This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-04 19:18:04
|
Revision: 8751 http://gridarta.svn.sourceforge.net/gridarta/?rev=8751&view=rev Author: akirschbaum Date: 2010-11-04 19:17:57 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Do not warn about map difficulty 0 as many existing maps use this. [Crossfire] Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java trunk/src/doc/ref/validators.xhtml Added Paths: ----------- trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 trunk/test-mapvalidator/crossfire/maps/MapDifficulty0.expected trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected Removed Paths: ------------- trunk/test-mapvalidator/crossfire/maps/MapDifficulty trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -166,7 +166,7 @@ validator.5=net.sf.gridarta.model.validation.checks.DoubleLayerChecker validator.6=net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker 81 validator.7=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.8=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.8=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 10000 validator.9=net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker 80 validator.10=net.sf.gridarta.model.validation.checks.TilePathsChecker 8 validator.11=net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/crossfire/ChangeLog 2010-11-04 19:17:57 UTC (rev 8751) @@ -1,3 +1,8 @@ +2010-11-04 Andreas Kirschbaum + + * Do not warn about map difficulty 0 as many existing maps use + this. + 2010-11-03 Andreas Kirschbaum * Do not consider game objects with "weight 0" as items. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -144,7 +144,7 @@ validator.2=net.sf.gridarta.model.validation.checks.ConnectedInsideContainerChecker validator.3=net.sf.gridarta.model.validation.checks.ConnectedPickableChecker validator.4=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.5=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.5=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 0 10000 validator.6=net.sf.gridarta.model.validation.checks.TilePathsChecker 4 validator.7=net.sf.gridarta.model.validation.checks.UndefinedFaceChecker validator.8=net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -168,7 +168,7 @@ validator.7=net.sf.gridarta.model.validation.checks.DoubleLayerChecker validator.8=net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker 81 validator.9=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.10=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.10=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 10000 validator.11=net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker 80 validator.12=net.sf.gridarta.model.validation.checks.SquareWithoutFloorChecker 71,68 validator.13=net.sf.gridarta.model.validation.checks.SysObjectNotOnLayerZeroChecker Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java 2010-11-04 19:17:57 UTC (rev 8751) @@ -37,11 +37,25 @@ public class MapDifficultyChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractValidator<G, A, R> implements MapValidator<G, A, R> { /** + * The minimal acceptable difficulty. + */ + private final int minDifficulty; + + /** + * The maximal acceptable difficulty. + */ + private final int maxDifficulty; + + /** * Creates a new instance. * @param validatorPreferences the validator preferences to use + * @param minDifficulty the minimal acceptable difficulty + * @param maxDifficulty the maximal acceptable difficulty */ - public MapDifficultyChecker(@NotNull final ValidatorPreferences validatorPreferences) { + public MapDifficultyChecker(@NotNull final ValidatorPreferences validatorPreferences, final int minDifficulty, final int maxDifficulty) { super(validatorPreferences); + this.minDifficulty = minDifficulty; + this.maxDifficulty = maxDifficulty; } /** @@ -51,7 +65,7 @@ public void validateMap(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { final MapArchObject<A> mapArch = mapModel.getMapArchObject(); final int difficulty = mapArch.getDifficulty(); - if (difficulty < 1) { + if (difficulty < minDifficulty || difficulty > maxDifficulty) { errorCollector.collect(new MapDifficultyError<G, A, R>(mapModel, difficulty)); } } Modified: trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-04 19:17:57 UTC (rev 8751) @@ -158,7 +158,7 @@ */ @Test public void testNewMapDifficultyChecker() throws NoSuchValidatorException { - ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapDifficultyChecker"); + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 2"); } /** Modified: trunk/src/doc/ref/validators.xhtml =================================================================== --- trunk/src/doc/ref/validators.xhtml 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/src/doc/ref/validators.xhtml 2010-11-04 19:17:57 UTC (rev 8751) @@ -212,10 +212,10 @@ <y> <message>" is reported as a per map square warning. Any other lines are reported as per map warnings.</p> -<h2>net.sf.gridarta.model.validation.checks.MapDifficultyChecker</h2> +<h2>net.sf.gridarta.model.validation.checks.MapDifficultyChecker min max</h2> -<p>A map validator that checks for valid "difficulty" map attributes. - The map attribute is considered invalid if it is less than 1.</p> +<p>A map validator that checks that the "difficulty" map attribute is + within "min..max" (inclusive).</p> <h2>net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker type...</h2> Deleted: trunk/test-mapvalidator/crossfire/maps/MapDifficulty =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty 2010-11-04 19:17:57 UTC (rev 8751) @@ -1,8 +0,0 @@ -arch map -name test for MapDifficulty map validator -width 1 -height 1 -msg -Created: 2010-06-27 Andreas Kirschbaum -endmsg -end Deleted: trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected 2010-11-04 19:17:57 UTC (rev 8751) @@ -1 +0,0 @@ -Map difficulty invalid Copied: trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 (from rev 8747, trunk/test-mapvalidator/crossfire/maps/MapDifficulty) =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1,8 @@ +arch map +name test for MapDifficulty map validator +width 1 +height 1 +msg +Created: 2010-06-27 Andreas Kirschbaum +endmsg +end Copied: trunk/test-mapvalidator/crossfire/maps/MapDifficulty0.expected (from rev 8747, trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected) =================================================================== Added: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1,9 @@ +arch map +name test for MapDifficulty map validator +difficulty 12345678 +width 1 +height 1 +msg +Created: 2010-11-03 Andreas Kirschbaum +endmsg +end Property changes on: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1 @@ +Map difficulty invalid Property changes on: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 20:09:30
|
Revision: 8756 http://gridarta.svn.sourceforge.net/gridarta/?rev=8756&view=rev Author: akirschbaum Date: 2010-11-05 20:09:23 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Add "type" attribute to <Attrib> game object matchers. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java trunk/resource/system/dtd/GameObjectMatchers.dtd trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/atrinik/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/crossfire/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-04 Andreas Kirschbaum * Do not warn about map difficulty 0 as many existing maps use Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/daimonin/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -25,9 +25,9 @@ /** * An {@link GameObjectMatcher} that matches an attribute value. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo care about int comparison + * @author Andreas Kirschbaum */ -public class AttributeGameObjectMatcher implements GameObjectMatcher { +public abstract class AttributeGameObjectMatcher implements GameObjectMatcher { /** * The serial version UID. @@ -35,20 +35,6 @@ private static final long serialVersionUID = 1L; /** - * The attribute name to match. - * @serial - */ - @NotNull - private final String name; - - /** - * The attribute value to match. - * @serial - */ - @NotNull - private final String value; - - /** * The operator to use. * @serial */ @@ -56,23 +42,11 @@ private final Operation operation; /** - * Whether to query the archetype as well. - * @serial - */ - private final boolean useDefArch; - - /** * Creates an <code>AttributeGameObjectMatcher</code>. - * @param name the attribute name to match * @param operation the <code>Operator</code> to use - * @param value the attribute value to compare with - * @param useDefArch whether to query the archetype as well */ - public AttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) { - this.name = name; + protected AttributeGameObjectMatcher(@NotNull final Operation operation) { this.operation = operation; - this.value = value; - this.useDefArch = useDefArch; } /** @@ -80,8 +54,7 @@ */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> gameObject) { - final Comparable<String> actual = gameObject.getAttributeString(name, useDefArch); - final int ret = actual.compareTo(value); + final int ret = compareValue(gameObject); switch (operation) { case eq: return ret == 0; @@ -100,4 +73,12 @@ throw new IllegalStateException(); } + /** + * Compares the attribute value of a given game object with the expected + * value. + * @param gameObject the game object + * @return <0, 0, or >0 depending on the comparison result + */ + protected abstract int compareValue(@NotNull final GameObject<?, ?, ?> gameObject); + } // class AttributeGameObjectMatcher Modified: trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -54,6 +54,13 @@ private static final String XML_ATTRIB_ATTRIBUTE_OP = "op"; /** + * The name of the "type" attribute within {@link #XML_ELEMENT_ATTRIB} + * elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_TYPE = "type"; + + /** * The name of the "value" attribute within {@link #XML_ELEMENT_ATTRIB} * elements. */ @@ -256,10 +263,18 @@ * Creates an {@link AttributeGameObjectMatcher}. * @param el <code><Attribute/></code> xml element * @return the created matcher + * @throws ParsingException if the attribute matcher cannot be created */ @NotNull - private static GameObjectMatcher createAttributeArchObjectMatcher(@NotNull final Element el) { - return new AttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + private static GameObjectMatcher createAttributeArchObjectMatcher(@NotNull final Element el) throws ParsingException { + final String type = el.getAttribute(XML_ATTRIB_ATTRIBUTE_TYPE); + if (type.equals("string")) { + return new StringAttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + } else if (type.equals("int")) { + return new IntAttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + } else { + throw new AssertionError("impossible value '" + type + "' for XML_ATTRIB_ATTRIBUTE_TYPE"); + } } /** Added: trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -0,0 +1,90 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.match; + +import net.sf.gridarta.model.gameobject.GameObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link AttributeGameObjectMatcher} that compares attributes values using + * "int" type. + * @author Andreas Kirschbaum + */ +public class IntAttributeGameObjectMatcher extends AttributeGameObjectMatcher { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The attribute name to match. + * @serial + */ + @NotNull + private final String name; + + /** + * The attribute value to match. + * @serial + */ + private final int value; + + /** + * Whether to query the archetype as well. + * @serial + */ + private final boolean useDefArch; + + /** + * Creates an <code>AttributeGameObjectMatcher</code>. + * @param name the attribute name to match + * @param operation the <code>Operator</code> to use + * @param value the attribute value to compare with + * @param useDefArch whether to query the archetype as well + * @throws ParsingException if the value is not an integer + */ + public IntAttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) throws ParsingException { + super(operation); + this.name = name; + try { + this.value = Integer.parseInt(value); + } catch (final NumberFormatException ex) { + throw new ParsingException("invalid integer value: " + value, ex); + } + this.useDefArch = useDefArch; + } + + /** + * {@inheritDoc} + */ + @Override + protected int compareValue(@NotNull final GameObject<?, ?, ?> gameObject) { + final int actual = gameObject.getAttributeInt(name, useDefArch); + if (actual < value) { + return -1; + } + if (actual > value) { + return +1; + } + return 0; + } + +} // class StringAttributeGameObjectMatcher Property changes on: trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.match; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Thrown when a parsing error occurs. @@ -40,4 +41,13 @@ super(parsingError); } + /** + * Creates a new instance. + * @param parsingError the parsing error + * @param cause the cause + */ + public ParsingException(@NotNull final String parsingError, @Nullable final Throwable cause) { + super(parsingError, cause); + } + } // class ParsingException Added: trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -0,0 +1,80 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.match; + +import net.sf.gridarta.model.gameobject.GameObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link AttributeGameObjectMatcher} that compares attributes values using + * "string" type. + * @author Andreas Kirschbaum + */ +public class StringAttributeGameObjectMatcher extends AttributeGameObjectMatcher { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The attribute name to match. + * @serial + */ + @NotNull + private final String name; + + /** + * The attribute value to match. + * @serial + */ + @NotNull + private final String value; + + /** + * Whether to query the archetype as well. + * @serial + */ + private final boolean useDefArch; + + /** + * Creates an <code>AttributeGameObjectMatcher</code>. + * @param name the attribute name to match + * @param operation the <code>Operator</code> to use + * @param value the attribute value to compare with + * @param useDefArch whether to query the archetype as well + */ + public StringAttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) { + super(operation); + this.name = name; + this.value = value; + this.useDefArch = useDefArch; + } + + /** + * {@inheritDoc} + */ + @Override + protected int compareValue(@NotNull final GameObject<?, ?, ?> gameObject) { + final Comparable<String> actual = gameObject.getAttributeString(name, useDefArch); + return actual.compareTo(value); + } + +} // class StringAttributeGameObjectMatcher Property changes on: trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/resource/system/dtd/GameObjectMatchers.dtd =================================================================== --- trunk/resource/system/dtd/GameObjectMatchers.dtd 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/resource/system/dtd/GameObjectMatchers.dtd 2010-11-05 20:09:23 UTC (rev 8756) @@ -43,6 +43,7 @@ useArchetype (true|false) 'true' name NMTOKEN #REQUIRED value CDATA '1' + type (string|int) 'string' op (eq|ne|ge|gt|le|lt) 'eq' > Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 20:09:23 UTC (rev 8756) @@ -262,6 +262,9 @@ expected value: eq=equal, ne=not equal, ge=greater or equal, gt=greater, le=less or equal, lt=less. If omitted, 'eq' is assumed. +The 'type' attribute may be set to "int" to compare the attribute values as +integers. If omitted or set to "string", a string comparison is used. + The 'useArchetype' attribute specifies whether the archetype's value should be used if the game object does not define a value; it defaults to 'true' which is the normal behavior for the server. If set to 'false', a matcher can check for @@ -306,8 +309,8 @@ <pre><![CDATA[ <GameObjectMatcher id="name"> <And> - <Attrib name="damage" value="10" op="ge"/> - <Attrib name="damage" value="15" op="le"/> + <Attrib name="damage" type="int" value="10" op="ge"/> + <Attrib name="damage" type="int" value="15" op="le"/> </And> </GameObjectMatcher> ]]></pre> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-11-05 20:09:23 UTC (rev 8756) @@ -17,7 +17,7 @@ <title xml:lang="en">T</title> <And> <TypeNrs numbers="77" /> - <Attrib name="layer" value="7" op="ne" /> + <Attrib name="layer" type="int" value="7" op="ne" /> </And> </GameObjectMatcher> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 21:28:48
|
Revision: 8759 http://gridarta.svn.sourceforge.net/gridarta/?rev=8759&view=rev Author: akirschbaum Date: 2010-11-05 21:28:41 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Enhance "Shop square allows magic and/or prayers" validator: flag shop squares that are adjacent to squares that allow spells or prayers. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/ShopSquare trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java trunk/test-mapvalidator/crossfire/arch/wall1.arc Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/crossfire/ChangeLog 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,5 +1,9 @@ 2010-11-05 Andreas Kirschbaum + * Enhance "Shop square allows magic and/or prayers" validator: + flag shop squares that are adjacent to squares that allow spells + or prayers. + * Fix game object matchers to reliably match int valued attributes. * Add "type" attribute to <Attrib> game object matchers. Allowed Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 21:28:41 UTC (rev 8759) @@ -260,4 +260,14 @@ </And> </GameObjectMatcher> + <!-- Objects to be treated as blocked in map validator --> + <GameObjectMatcher id="system_blocked" system="true"> + <title xml:lang="en">Blocked</title> + <title xml:lang="de">Blockiert</title> + <And> + <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> + </And> + </GameObjectMatcher> + </GameObjectMatchers> Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -27,8 +27,10 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.validation.ErrorCollector; import net.sf.gridarta.model.validation.ValidatorPreferences; +import net.sf.gridarta.model.validation.errors.ShopSquare2Error; import net.sf.gridarta.model.validation.errors.ShopSquareError; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A {@link net.sf.gridarta.model.validation.MapValidator} to detect shop @@ -50,16 +52,25 @@ private final GameObjectMatcher noSpellsMatcher; /** + * The {@link GameObjectMatcher} for finding blocked squares. + */ + @Nullable + private final GameObjectMatcher blockedMatcher; + + /** * Creates a new instance. * @param validatorPreferences the validator preferences to use * @param shopMatcher the game object matcher for finding shop squares * @param noSpellsMatcher the game object matcher for finding no-spell * squares + * @param blockedMatcher the game object matcher for finding blocked + * squares */ - public ShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher) { + public ShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher, @Nullable final GameObjectMatcher blockedMatcher) { super(validatorPreferences); this.shopMatcher = shopMatcher; this.noSpellsMatcher = noSpellsMatcher; + this.blockedMatcher = blockedMatcher; } /** @@ -69,14 +80,49 @@ public void validateMap(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { final boolean[][] shopSquares = findMatchingSquares(mapModel, shopMatcher); final boolean[][] noSpellsSquares = findMatchingSquares(mapModel, noSpellsMatcher); + final boolean[][] blockedSquares = blockedMatcher == null ? null : findMatchingSquares(mapModel, blockedMatcher); final Point point = new Point(); for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) { for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) { - if (shopSquares[point.x][point.y] && !noSpellsSquares[point.x][point.y]) { - errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + if (shopSquares[point.x][point.y]) { + if (!noSpellsSquares[point.x][point.y]) { + errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + } else if (blockedSquares != null && hasAdjacentNonBlockedSpellsAllowedSquare(noSpellsSquares, blockedSquares, point)) { + errorCollector.collect(new ShopSquare2Error<G, A, R>(mapModel.getMapSquare(point))); + } } } } } + /** + * Returns whether a given square is not blocked and has a non-blocked + * adjacent square that allows spells. + * @param noSpellsSquares the map squares disallowing spells + * @param blockedSquares the blocked map squares + * @param point the map square to check + * @return whether a match was found + */ + private static boolean hasAdjacentNonBlockedSpellsAllowedSquare(@NotNull final boolean[][] noSpellsSquares, @NotNull final boolean[][] blockedSquares, @NotNull final Point point) { + if (blockedSquares[point.x][point.y]) { + return false; + } + + for (int dx = -1; dx <= +1; dx++) { + for (int dy = -1; dy <= +1; dy++) { + final int x = point.x + dx; + final int y = point.y + dy; + //noinspection ProhibitedExceptionCaught + try { + if (!noSpellsSquares[x][y] && !blockedSquares[x][y]) { + return true; + } + } catch (final ArrayIndexOutOfBoundsException ignored) { + // ignore: expected for points at the border of the map + } + } + } + return false; + } + } // class ShopSquareChecker Added: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -0,0 +1,48 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.validation.errors; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmodel.MapSquare; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link SquareValidationError} for shop tiles that have an adjacent map + * square that is not blocked and does allow spells or prayers. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ShopSquare2Error<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends SquareValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance. + * @param mapSquare the square on which the error occurred + */ + public ShopSquare2Error(@NotNull final MapSquare<G, A, R> mapSquare) { + super(mapSquare); + } + +} // class ShopSquare2Error Property changes on: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -188,7 +188,7 @@ */ @Test public void testNewShopSquareChecker() throws NoSuchValidatorException { - ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ShopSquareChecker matcher matcher"); + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ShopSquareChecker matcher matcher matcher"); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -209,7 +209,8 @@ if (shopSquareMatcher != null) { final GameObjectMatcher noSpellsMatcher = gameObjectMatchers.getMatcher("system_no_spells", "no_spells"); if (noSpellsMatcher != null) { - validators.addValidator(new ShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, noSpellsMatcher)); + final GameObjectMatcher blockedMatcher = gameObjectMatchers.getMatcher("system_blocked", "blocked"); + validators.addValidator(new ShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, noSpellsMatcher, blockedMatcher)); } final GameObjectMatcher paidItemMatcher = gameObjectMatchers.getMatcher("system_paid_item"); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1362,6 +1362,8 @@ Validator.ShopSquare.default=true Validator.ShopSquare.title=Shop square allows magic and/or prayers Validator.ShopSquare.msg=<html><h3>{0}</h3><p>On this square there is a shop square which allows magic and/or prayers.</p> +Validator.ShopSquare2.title=Adjacent shop square allows magic and/or prayers +Validator.ShopSquare2.msg=<html><h3>{0}</h3><p>On this square there is a shop square which has an adjacent square that both is not blocked and that does allows magic and/or prayers.</p> Validator.Slaying.default=true Validator.Slaying.title=Critical slaying characters Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1152,6 +1152,8 @@ Validator.ShopSquare.title=Gesch\u00e4ftsfl\u00e4che erlaubt Magie Validator.ShopSquare.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\u00e4ftsfl\u00e4che und erlaubt Magic.</p> +Validator.ShopSquare2.title=Angrenzende Gesch\u00e4ftsfl\u00e4che erlaubt Magie +Validator.ShopSquare2.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\u00e4ftsfl\u00e4che und besitzt ein angrenzendes Feld, welches Magic erlaubt.</p> Validator.Slaying.title=Ung\u00fcltige Zeichen f\u00fcr "slaying" Validator.Slaying.msg=<html><h3>{0}</h3><p>Dieses Feld enth\u00e4lt ein Objekt mit einem Attribut "slaying", das ung\u00fcltige Zeichen enth\u00e4lt.</p><p>Erlaubte Zeichen sind:<br><code>a-z A-Z 0-9 / . _</code></p><p>Sie k\u00f6nnen:</p><ul><li>Das Attribut \u00e4ndern</li></ul> Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1140,6 +1140,8 @@ #Validator.ShopSquare.title= #Validator.ShopSquare.msg= +#Validator.ShopSquare2.title= +#Validator.ShopSquare2.msg= #Validator.Slaying.title= #Validator.Slaying.msg= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1148,6 +1148,8 @@ #Validator.ShopSquare.title= #Validator.ShopSquare.msg= +#Validator.ShopSquare2.title= +#Validator.ShopSquare2.msg= Validator.MobOutsideSpawnPoint.title=Mob utan spawnpoint Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>H\u00e4r finns det en mob utanf\u00f6r en spawnpoint.<br>Detta \u00e4r ok, men du kanske \u00e4nd\u00e5 b\u00f6r stoppa moben i spawnpointen s\u00e5 den \u00e5terf\u00f6ds om den skulle d\u00f6.</p><p>Du kan:</p><ul><li>ignorera detta</li><li>skapa en spawnpoint f\u00f6r denna mob</li></ul> Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 21:28:41 UTC (rev 8759) @@ -48,8 +48,11 @@ <li>Checks for shop tiles that allow spells. Shop tiles are selected by matcher 'system_shop_tile' (or fallback 'shop_tile'); denied spells are selected by matcher - 'system_no_spells' (or fallback 'no_spells'). Not - checked if either matcher is not defined. + 'system_no_spells' (or fallback 'no_spells'). If matcher + 'system_blocked' (or fallback blocked') exists, also + checks for shop tiles with adjacent map squares that + allow spells which are both not blocked. Not checked if + either matcher is not defined. </li> <li>Checks for shop tiles that contain paid items. Shop tiles are selected by matcher 'system_shop_tile' (or Added: trunk/test-mapvalidator/crossfire/arch/wall1.arc =================================================================== --- trunk/test-mapvalidator/crossfire/arch/wall1.arc (rev 0) +++ trunk/test-mapvalidator/crossfire/arch/wall1.arc 2010-11-05 21:28:41 UTC (rev 8759) @@ -0,0 +1,3 @@ +Object wall1 +move_block all +end Property changes on: trunk/test-mapvalidator/crossfire/arch/wall1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-05 21:28:41 UTC (rev 8759) @@ -5,7 +5,7 @@ height 4 msg Created: 2010-06-27 Andreas Kirschbaum -Modified: 2010-11-03 Andreas Kirschbaum +Modified: 2010-11-05 ank endmsg end arch shop2 @@ -13,6 +13,12 @@ arch rod1 end arch shop2 +y 1 +end +arch shop2 +y 2 +end +arch shop2 y 3 end arch mob1 @@ -20,6 +26,9 @@ end arch shop2 x 1 +end +arch shop2 +x 1 y 1 end arch rod1 @@ -37,7 +46,14 @@ no_pick 1 end arch shop2 +x 1 +y 3 +end +arch shop2 x 2 +end +arch shop2 +x 2 y 1 end arch rod1 @@ -55,7 +71,14 @@ unpaid 1 end arch shop2 +x 2 +y 3 +end +arch shop2 x 3 +end +arch shop2 +x 3 y 1 end arch rod1 @@ -73,7 +96,14 @@ monster 1 end arch shop2 +x 3 +y 3 +end +arch shop2 x 4 +end +arch shop2 +x 4 y 1 end arch rod1 @@ -91,7 +121,14 @@ generator 1 end arch shop2 +x 4 +y 3 +end +arch shop2 x 5 +end +arch shop2 +x 5 y 1 end arch rod1 @@ -108,3 +145,7 @@ y 2 weight 1 end +arch shop2 +x 5 +y 3 +end Modified: trunk/test-mapvalidator/crossfire/maps/ShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/ShopSquare 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/ShopSquare 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,43 +1,223 @@ arch map name test for ShopSquare map validator difficulty 1 -width 4 -height 2 +width 14 +height 4 msg Created: 2010-06-27 Andreas Kirschbaum +Modified: 2010-11-05 ank endmsg end arch shop1 end +arch wall1 +y 1 +end arch shop2 -y 1 +y 2 no_magic 0 damned 0 end -arch shop1 +arch wall1 +y 3 +end +arch wall1 x 1 -no_magic 1 end -arch shop2 +arch wall1 x 1 y 1 -damned 0 end +arch wall1 +x 1 +y 2 +end +arch wall1 +x 1 +y 3 +end arch shop1 x 2 -damned 1 +no_magic 1 end +arch wall1 +x 2 +y 1 +end arch shop2 x 2 +y 2 +damned 0 +end +arch wall1 +x 2 +y 3 +end +arch wall1 +x 3 +end +arch wall1 +x 3 y 1 +end +arch wall1 +x 3 +y 2 +end +arch wall1 +x 3 +y 3 +end +arch shop1 +x 4 +damned 1 +end +arch wall1 +x 4 +y 1 +end +arch shop2 +x 4 +y 2 no_magic 0 end +arch wall1 +x 4 +y 3 +end +arch wall1 +x 5 +end +arch wall1 +x 5 +y 1 +end +arch wall1 +x 5 +y 2 +end +arch wall1 +x 5 +y 3 +end arch shop1 -x 3 +x 6 no_magic 1 damned 1 end +arch wall1 +x 6 +y 1 +end arch shop2 -x 3 +x 6 +y 2 +end +arch wall1 +x 6 +y 3 +end +arch wall1 +x 7 +end +arch wall1 +x 7 y 1 end +arch wall1 +x 7 +y 2 +end +arch wall1 +x 7 +y 3 +end +arch shop1 +x 8 +no_magic 1 +damned 1 +end +arch wall1 +x 8 +y 1 +end +arch shop2 +x 8 +y 2 +end +arch wall1 +x 8 +y 3 +end +arch wall1 +x 9 +y 1 +end +arch wall1 +x 9 +y 3 +end +arch wall1 +x 10 +end +arch wall1 +x 10 +y 1 +end +arch wall1 +x 10 +y 2 +end +arch wall1 +x 10 +y 3 +end +arch shop1 +x 11 +no_magic 1 +damned 1 +end +arch wall1 +x 11 +y 1 +end +arch shop2 +x 11 +y 2 +end +arch wall1 +x 11 +y 3 +end +arch shop1 +x 12 +no_magic 1 +damned 1 +end +arch wall1 +x 12 +y 1 +end +arch shop2 +x 12 +y 2 +end +arch wall1 +x 12 +y 3 +end +arch wall1 +x 13 +end +arch wall1 +x 13 +y 1 +end +arch wall1 +x 13 +y 2 +end +arch wall1 +x 13 +y 3 +end Modified: trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,6 +1,8 @@ [0|0] Shop square allows magic and/or prayers -[1|0] Shop square allows magic and/or prayers [2|0] Shop square allows magic and/or prayers -[0|1] Shop square allows magic and/or prayers -[1|1] Shop square allows magic and/or prayers -[2|1] Shop square allows magic and/or prayers +[4|0] Shop square allows magic and/or prayers +[8|0] Adjacent shop square allows magic and/or prayers +[0|2] Shop square allows magic and/or prayers +[2|2] Shop square allows magic and/or prayers +[4|2] Shop square allows magic and/or prayers +[8|2] Adjacent shop square allows magic and/or prayers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-06 06:33:31
|
Revision: 8760 http://gridarta.svn.sourceforge.net/gridarta/?rev=8760&view=rev Author: akirschbaum Date: 2010-11-06 06:33:24 +0000 (Sat, 06 Nov 2010) Log Message: ----------- Fix possible assertion failure. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-11-05 21:28:41 UTC (rev 8759) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-11-06 06:33:24 UTC (rev 8760) @@ -265,6 +265,9 @@ //noinspection ErrorNotRethrown try { result = ImageUtils.scaleImage(image, width, height); + } catch (final InterruptedException ignored) { + Thread.currentThread().interrupt(); + result = defaultImage; } catch (final OutOfMemoryError ignored) { result = defaultImage; } Modified: trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java 2010-11-05 21:28:41 UTC (rev 8759) +++ trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java 2010-11-06 06:33:24 UTC (rev 8760) @@ -61,20 +61,20 @@ * @param w the scaled width * @param h the scaled height * @return the scaled image + * @throws InterruptedException if scaling failed because the current thread + * was interrupted */ @NotNull - public static Image scaleImage(@NotNull final Image image, final int w, final int h) { + public static Image scaleImage(@NotNull final Image image, final int w, final int h) throws InterruptedException { final Image scaledImage = image.getScaledInstance(w, h, Image.SCALE_SMOOTH); final int id = 0; tracker.addImage(scaledImage, id); try { tracker.waitForID(id); - } catch (final InterruptedException ex) { - Thread.currentThread().interrupt(); - throw new AssertionError(ex); // XXX + } finally { + tracker.removeImage(scaledImage, id); } - tracker.removeImage(scaledImage, id); return scaledImage; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-06 16:23:03
|
Revision: 8766 http://gridarta.svn.sourceforge.net/gridarta/?rev=8766&view=rev Author: akirschbaum Date: 2010-11-06 15:27:29 +0000 (Sat, 06 Nov 2010) Log Message: ----------- Add configuration files for building .deb packages. Modified Paths: -------------- trunk/INSTALL Added Paths: ----------- trunk/debian/ trunk/debian/changelog trunk/debian/compat trunk/debian/control trunk/debian/copyright trunk/debian/docs trunk/debian/gridarta-atrinik.install trunk/debian/gridarta-atrinik.manpages trunk/debian/gridarta-atrinik.menu trunk/debian/gridarta-common.install trunk/debian/gridarta-common.manpages trunk/debian/gridarta-crossfire.install trunk/debian/gridarta-crossfire.manpages trunk/debian/gridarta-crossfire.menu trunk/debian/gridarta-daimonin.install trunk/debian/gridarta-daimonin.manpages trunk/debian/gridarta-daimonin.menu trunk/debian/gridarta.substvars trunk/debian/rules trunk/debian/source/ trunk/debian/source/format trunk/misc/ trunk/misc/gridarta-atrinik trunk/misc/gridarta-atrinik.6 trunk/misc/gridarta-atrinik.desktop trunk/misc/gridarta-crossfire trunk/misc/gridarta-crossfire.6 trunk/misc/gridarta-crossfire.desktop trunk/misc/gridarta-daimonin trunk/misc/gridarta-daimonin.6 trunk/misc/gridarta-daimonin.desktop trunk/misc/gridarta.6 trunk/misc/gridartarc Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-11-06 07:30:10 UTC (rev 8765) +++ trunk/INSTALL 2010-11-06 15:27:29 UTC (rev 8766) @@ -25,7 +25,9 @@ CrossfireEditor.jar, and DaimoninEditor.jar. To find out options about building Gridarta, run "ant -projecthelp". +To build Debian packages, run "debuild -uc -us". + How to Run ---------- java -jar AtrinikEditor.jar Property changes on: trunk/debian ___________________________________________________________________ Added: svn:ignore + files gridarta-atrinik gridarta-atrinik.debhelper.log gridarta-atrinik.postinst.debhelper gridarta-atrinik.postrm.debhelper gridarta-atrinik.substvars gridarta-common gridarta-common.debhelper.log gridarta-common.substvars gridarta-crossfire gridarta-crossfire.debhelper.log gridarta-crossfire.postinst.debhelper gridarta-crossfire.postrm.debhelper gridarta-crossfire.substvars gridarta-daimonin gridarta-daimonin.debhelper.log gridarta-daimonin.postinst.debhelper gridarta-daimonin.postrm.debhelper gridarta-daimonin.substvars gridarta.debhelper.log Added: trunk/debian/changelog =================================================================== --- trunk/debian/changelog (rev 0) +++ trunk/debian/changelog 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,5 @@ +gridarta (0.8.trunk) unstable; urgency=low + + * Initial Release. + + -- Andreas Kirschbaum <aki...@us...> Wed, 6 Nov 2010 11:48:52 +0200 Property changes on: trunk/debian/changelog ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/compat =================================================================== --- trunk/debian/compat (rev 0) +++ trunk/debian/compat 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +7 Property changes on: trunk/debian/compat ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/control =================================================================== --- trunk/debian/control (rev 0) +++ trunk/debian/control 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,48 @@ +Source: gridarta +Section: editors +Priority: optional +Maintainer: Andreas Kirschbaum <aki...@us...> +Build-Depends: debhelper (>= 7.0.50~), ant, ant-optional, openjdk-6-jdk | sun-java6-jdk +Standards-Version: 3.9.1 +Homepage: http://gridarta.sourceforge.net/ + +Package: gridarta-common +Architecture: all +Depends: ${misc:Depends} +Description: Common files for Gridarta + Gridarta is a map editor for Atrinik, Crossfire, and Daimonin map files. + . + This package contains common files for all editor variants. + +Package: gridarta-atrinik +Architecture: all +Tag: implemented-in::java, interface::x11, works-with::atrinik, x11::application, role::program, scope::application +Depends: ${misc:Depends}, openjdk-6-jre | sun-java6-jre +#Recommends: atrinik-maps +Suggests: menu +Description: A map editor for Atrinik map files + Gridarta is a map editor for Atrinik, Crossfire, and Daimonin map files. + . + This package contains the editor variant for Atrinik map files. + +Package: gridarta-crossfire +Architecture: all +Tag: implemented-in::java, interface::x11, works-with::crossfire, x11::application, role::program, scope::application +Depends: ${misc:Depends}, openjdk-6-jre | sun-java6-jre +Recommends: crossfire-maps +Suggests: menu +Description: A map editor for Crossfire map files + Gridarta is a map editor for Atrinik, Crossfire, and Daimonin map files. + . + This package contains the editor variant for Crossfire map files. + +Package: gridarta-daimonin +Architecture: all +Tag: implemented-in::java, interface::x11, works-with::daimonin, x11::application, role::program, scope::application +Depends: ${misc:Depends}, openjdk-6-jre | sun-java6-jre +#Recommends: daimonin-maps +Suggests: menu +Description: A map editor for Daimonin map files + Gridarta is a map editor for Atrinik, Crossfire, and Daimonin map files. + . + This package contains the editor variant for Daimonin map files. Property changes on: trunk/debian/control ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/copyright =================================================================== --- trunk/debian/copyright (rev 0) +++ trunk/debian/copyright 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,45 @@ +This work was packaged for Debian by: + + Andreas Kirschbaum <aki...@us...> on Wed, 6 Nov 2010 11:48:52 +0200 + +It was downloaded from: + + <https://gridarta.svn.sourceforge.net/svnroot/gridarta/trunk> + +Upstream Author(s): + Pasi Keränen + Michael Tönnies <in...@da...> + Andreas Vogel <av...@us...> + Christian Hujer <ch...@ri...> + Daniel Viegas <der...@us...> + Andreas Kirschbaum <aki...@us...> + +Copyright: + Copyright (C) 2000-2010 The Gridarta Developers. + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/> + +On Debian systems, the complete text of the GNU General +Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +The Debian packaging is: + + Copyright (C) 2010 Andreas Kirschbaum <aki...@us...> + +you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. Property changes on: trunk/debian/copyright ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/docs =================================================================== --- trunk/debian/docs (rev 0) +++ trunk/debian/docs 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +README Property changes on: trunk/debian/docs ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-atrinik.install =================================================================== --- trunk/debian/gridarta-atrinik.install (rev 0) +++ trunk/debian/gridarta-atrinik.install 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,3 @@ +AtrinikEditor.jar usr/share/java +misc/gridarta-atrinik usr/bin +misc/gridarta-atrinik.desktop usr/share/applications Property changes on: trunk/debian/gridarta-atrinik.install ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-atrinik.manpages =================================================================== --- trunk/debian/gridarta-atrinik.manpages (rev 0) +++ trunk/debian/gridarta-atrinik.manpages 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc/gridarta-atrinik.6 Property changes on: trunk/debian/gridarta-atrinik.manpages ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-atrinik.menu =================================================================== --- trunk/debian/gridarta-atrinik.menu (rev 0) +++ trunk/debian/gridarta-atrinik.menu 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,2 @@ +?package(gridarta-atrinik):needs="X11" section="Games/Tools" \ + title="Gridarta for Atrinik" command="/usr/bin/gridarta-atrinik" Property changes on: trunk/debian/gridarta-atrinik.menu ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-common.install =================================================================== --- trunk/debian/gridarta-common.install (rev 0) +++ trunk/debian/gridarta-common.install 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc/gridartarc etc/gridarta Property changes on: trunk/debian/gridarta-common.install ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-common.manpages =================================================================== --- trunk/debian/gridarta-common.manpages (rev 0) +++ trunk/debian/gridarta-common.manpages 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc/gridarta.6 Property changes on: trunk/debian/gridarta-common.manpages ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-crossfire.install =================================================================== --- trunk/debian/gridarta-crossfire.install (rev 0) +++ trunk/debian/gridarta-crossfire.install 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,3 @@ +CrossfireEditor.jar usr/share/java +misc/gridarta-crossfire usr/bin +misc/gridarta-crossfire.desktop usr/share/applications Property changes on: trunk/debian/gridarta-crossfire.install ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-crossfire.manpages =================================================================== --- trunk/debian/gridarta-crossfire.manpages (rev 0) +++ trunk/debian/gridarta-crossfire.manpages 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc/gridarta-crossfire.6 Property changes on: trunk/debian/gridarta-crossfire.manpages ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-crossfire.menu =================================================================== --- trunk/debian/gridarta-crossfire.menu (rev 0) +++ trunk/debian/gridarta-crossfire.menu 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,2 @@ +?package(gridarta-crossfire):needs="X11" section="Games/Tools" \ + title="Gridarta for Crossfire" command="/usr/bin/gridarta-crossfire" Property changes on: trunk/debian/gridarta-crossfire.menu ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-daimonin.install =================================================================== --- trunk/debian/gridarta-daimonin.install (rev 0) +++ trunk/debian/gridarta-daimonin.install 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,3 @@ +DaimoninEditor.jar usr/share/java +misc/gridarta-daimonin usr/bin +misc/gridarta-daimonin.desktop usr/share/applications Property changes on: trunk/debian/gridarta-daimonin.install ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-daimonin.manpages =================================================================== --- trunk/debian/gridarta-daimonin.manpages (rev 0) +++ trunk/debian/gridarta-daimonin.manpages 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc/gridarta-daimonin.6 Property changes on: trunk/debian/gridarta-daimonin.manpages ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta-daimonin.menu =================================================================== --- trunk/debian/gridarta-daimonin.menu (rev 0) +++ trunk/debian/gridarta-daimonin.menu 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,2 @@ +?package(gridarta-daimonin):needs="X11" section="Games/Tools" \ + title="Gridarta for Daimonin" command="/usr/bin/gridarta-daimonin" Property changes on: trunk/debian/gridarta-daimonin.menu ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/gridarta.substvars =================================================================== --- trunk/debian/gridarta.substvars (rev 0) +++ trunk/debian/gridarta.substvars 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +misc:Depends= Property changes on: trunk/debian/gridarta.substvars ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/rules =================================================================== --- trunk/debian/rules (rev 0) +++ trunk/debian/rules 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_auto_test: + dh_auto_test + ant test Property changes on: trunk/debian/rules ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/debian/source/format =================================================================== --- trunk/debian/source/format (rev 0) +++ trunk/debian/source/format 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +3.0 (native) Property changes on: trunk/debian/source/format ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-atrinik =================================================================== --- trunk/misc/gridarta-atrinik (rev 0) +++ trunk/misc/gridarta-atrinik 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,12 @@ +#!/bin/sh + +for rcfile in /etc/gridarta/gridartarc ~/.gridarta/gridartarc; do + if [ -e "$rcfile" ]; then + . "$rcfile" + fi +done + +. /usr/lib/java-wrappers/java-wrappers.sh +require_java_runtime +locate_jar AtrinikEditor.jar +"$JAVA_CMD" -jar "$found_jar" "$@" Property changes on: trunk/misc/gridarta-atrinik ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-atrinik.6 =================================================================== --- trunk/misc/gridarta-atrinik.6 (rev 0) +++ trunk/misc/gridarta-atrinik.6 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +.so man6/gridarta.6 Property changes on: trunk/misc/gridarta-atrinik.6 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-atrinik.desktop =================================================================== --- trunk/misc/gridarta-atrinik.desktop (rev 0) +++ trunk/misc/gridarta-atrinik.desktop 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Gridarta for Atrinik +GenericName=Gridarta +Comment=Map editor for Atrinik map files. +Exec=/usr/bin/gridarta-atrinik +Categories=Development;Java Property changes on: trunk/misc/gridarta-atrinik.desktop ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-crossfire =================================================================== --- trunk/misc/gridarta-crossfire (rev 0) +++ trunk/misc/gridarta-crossfire 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,12 @@ +#!/bin/sh + +for rcfile in /etc/gridarta/gridartarc ~/.gridarta/gridartarc; do + if [ -e "$rcfile" ]; then + . "$rcfile" + fi +done + +. /usr/lib/java-wrappers/java-wrappers.sh +require_java_runtime +locate_jar CrossfireEditor.jar +"$JAVA_CMD" -jar "$found_jar" "$@" Property changes on: trunk/misc/gridarta-crossfire ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-crossfire.6 =================================================================== --- trunk/misc/gridarta-crossfire.6 (rev 0) +++ trunk/misc/gridarta-crossfire.6 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +.so man6/gridarta.6 Property changes on: trunk/misc/gridarta-crossfire.6 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-crossfire.desktop =================================================================== --- trunk/misc/gridarta-crossfire.desktop (rev 0) +++ trunk/misc/gridarta-crossfire.desktop 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Gridarta for Crossfire +GenericName=Gridarta +Comment=Map editor for Crossfire map files. +Exec=/usr/bin/gridarta-crossfire +Categories=Development;Java Property changes on: trunk/misc/gridarta-crossfire.desktop ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-daimonin =================================================================== --- trunk/misc/gridarta-daimonin (rev 0) +++ trunk/misc/gridarta-daimonin 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,12 @@ +#!/bin/sh + +for rcfile in /etc/gridarta/gridartarc ~/.gridarta/gridartarc; do + if [ -e "$rcfile" ]; then + . "$rcfile" + fi +done + +. /usr/lib/java-wrappers/java-wrappers.sh +require_java_runtime +locate_jar DaimoninEditor.jar +"$JAVA_CMD" -jar "$found_jar" "$@" Property changes on: trunk/misc/gridarta-daimonin ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-daimonin.6 =================================================================== --- trunk/misc/gridarta-daimonin.6 (rev 0) +++ trunk/misc/gridarta-daimonin.6 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1 @@ +.so man6/gridarta.6 Property changes on: trunk/misc/gridarta-daimonin.6 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta-daimonin.desktop =================================================================== --- trunk/misc/gridarta-daimonin.desktop (rev 0) +++ trunk/misc/gridarta-daimonin.desktop 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Gridarta for Daimonin +GenericName=Gridarta +Comment=Map editor for Daimonin map files. +Exec=/usr/bin/gridarta-daimonin +Categories=Development;Java Property changes on: trunk/misc/gridarta-daimonin.desktop ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridarta.6 =================================================================== --- trunk/misc/gridarta.6 (rev 0) +++ trunk/misc/gridarta.6 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,82 @@ +.\" Hey, EMACS: -*- nroff -*- +.TH GRIDARTA 6 "November 6, 2010" +.\" Please adjust this date whenever revising the manpage. +.SH NAME +Gridarta, gridarta-atrinik, gridarta-crossfire, gridarta-daimonin \- a map editor for Atrinik, Crossfire, and Daimonin +.SH SYNOPSIS +.B gridarta-atrinik +.RI [ options ] " [files" ...] +.br +.B gridarta-crossfire +.RI [ options ] " [files" ...] +.br +.B gridarta-daimonin +.RI [ options ] " [files" ...] +.SH DESCRIPTION +This manual page documents briefly the +.B gridarta-atrinik +, +.B gridarta-crossfire +, and +.B gridarta-daimonin +commands. +.PP +.B Gridarta +is a program that allows to create and modify map files for the games Atrinik, +Crossfire, and Daimonin. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-b, \-\-batchpng +Create .png files for all given map files. The .png files are created in the +same directories as the map files. +.TP +.B \-c, \-\-collectarches +Runs archetype collection. This process combines individual files from the +"arch" directory into condensed files needed by the game server. +.TP +.B \-n, \-\-normal +Start the editor in GUI mode. This is the default if no other option is given. +.TP +.B \-s, \-\-singlepng +Create a .png file from the specified map file. This mode needs two file +arguments: the map file to convert and the .png file to write. +.TP +.B \-\-config=config-file +Specify the config file to use. The +.B config-file +must exist. To create a new config file, create an empty file; Gridarta will +fill in missing entries. The default is +.B ~/.gridarta/atrinik.conf +for +.B gridarta-atrinik +, +.B ~/.gridarta/crossfire.conf +for +.B gridarta-crossfire +, and +the Java preferences for +.B gridarta-daimonin +. +.TP +.B \-\-noexit +Do not call +.B System.exit() +to terminate the application. This option is useful only for debugging +Gridarta. +.TP +.B \-\-script=name [arg=value...] +Run a plugin script +.B name +with the given arguments. This mode does not take files but plugin script +arguments. To find out which parameter a particular script supports, pass an +invalid parameter name. +.SH AUTHOR +Gridarta was written by Pasi Keränen, Michael Tönnies, Andreas Vogel, Christian +Hujer, Daniel Viegas, and Andreas Kirschbaum. +.PP +This manual page was written by Andreas Kirschbaum. Property changes on: trunk/misc/gridarta.6 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/misc/gridartarc =================================================================== --- trunk/misc/gridartarc (rev 0) +++ trunk/misc/gridartarc 2010-11-06 15:27:29 UTC (rev 8766) @@ -0,0 +1,2 @@ +# The java command for running Gridarta. +#JAVA_CMD=/usr/lib/jvm/java-6-sun/bin/java Property changes on: trunk/misc/gridartarc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-07 10:27:39
|
Revision: 8767 http://gridarta.svn.sourceforge.net/gridarta/?rev=8767&view=rev Author: akirschbaum Date: 2010-11-07 10:27:33 +0000 (Sun, 07 Nov 2010) Log Message: ----------- Force non-GUI mode when using --script. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-11-06 15:27:29 UTC (rev 8766) +++ trunk/atrinik/ChangeLog 2010-11-07 10:27:33 UTC (rev 8767) @@ -1,3 +1,7 @@ +2010-11-07 Andreas Kirschbaum + + * Force non-GUI mode when using --script. + 2010-11-05 Andreas Kirschbaum * Add "type" attribute to <Attrib> game object matchers. Allowed Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-06 15:27:29 UTC (rev 8766) +++ trunk/crossfire/ChangeLog 2010-11-07 10:27:33 UTC (rev 8767) @@ -1,3 +1,7 @@ +2010-11-07 Andreas Kirschbaum + + * Force non-GUI mode when using --script. + 2010-11-06 Andreas Kirschbaum * Update game object matchers to treat game objects having Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-11-06 15:27:29 UTC (rev 8766) +++ trunk/daimonin/ChangeLog 2010-11-07 10:27:33 UTC (rev 8767) @@ -1,3 +1,7 @@ +2010-11-07 Andreas Kirschbaum + + * Force non-GUI mode when using --script. + 2010-11-05 Andreas Kirschbaum * Add "type" attribute to <Attrib> game object matchers. Allowed Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-11-06 15:27:29 UTC (rev 8766) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-11-07 10:27:33 UTC (rev 8767) @@ -230,7 +230,7 @@ actionBuilder.addParent(ActionBuilderFactory.getInstance().getActionBuilder(actionBuilderPackage)); // Create the application and give it the parameters - final ErrorView errorView = GraphicsEnvironment.isHeadless() || mode.isConsoleMode() ? new ConsoleErrorView() : new DefaultErrorView(null); + final ErrorView errorView = GraphicsEnvironment.isHeadless() || mode.isConsoleMode() || script != null ? new ConsoleErrorView() : new DefaultErrorView(null); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-07 12:02:38
|
Revision: 8770 http://gridarta.svn.sourceforge.net/gridarta/?rev=8770&view=rev Author: akirschbaum Date: 2010-11-07 12:02:30 +0000 (Sun, 07 Nov 2010) Log Message: ----------- Move model classes to model module. Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/ Copied: trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java (from rev 8769, trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2010-11-07 12:02:30 UTC (rev 8770) @@ -0,0 +1,128 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.anim; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.data.NamedObject; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.gridarta.utils.IOUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.misc.Progress; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base implementation of {@link AnimationObjects}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class DefaultAnimationObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractAnimationObjects<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The collected animation tree file. + */ + @NotNull + private final String animTreeFile; + + /** + * Creates a new instance. + * @param animTreeFile the collected animation tree file + */ + public DefaultAnimationObjects(@NotNull final String animTreeFile) { + super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfAnimationObject")); + this.animTreeFile = animTreeFile; + } + + /** + * {@inheritDoc} Collects the Animations. The animation data is written to + * "animations". The tree information for the editor is written to + * "animtree". + */ + @Override + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + collectAnimations(progress, collectedDirectory); + collectAnimTree(progress, collectedDirectory); + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnimations(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectAnimations"), size()); + final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final AnimationObject anim : this) { + animations.append("anim ").append(anim.getAnimName()).append('\n').append(anim.getAnimList()).append("mina\n"); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animations.close(); + } + progress.setValue(size()); + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectAnimTree"), size()); + final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, animTreeFile)), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final NamedObject anim : this) { + animtree.append(anim.getPath()).append('\n'); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animtree.close(); + } + progress.setValue(size()); + } + + +} // class DefaultAnimationObjects Property changes on: trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java (from rev 8769, trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2010-11-07 12:02:30 UTC (rev 8770) @@ -0,0 +1,365 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.face; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.PrintStream; +import java.io.Reader; +import java.net.URL; +import java.nio.channels.FileChannel; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.errorview.ErrorView; +import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.gridarta.utils.ArrayUtils; +import net.sf.gridarta.utils.IOUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.misc.Progress; +import org.apache.log4j.Category; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base implementation of {@link FaceObjects}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class DefaultFaceObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractFaceObjects<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The chunk size in bytes when reading file contents. + */ + private static final int CHUNK_SIZE = 4096; + + /** + * The Logger for printing log messages. + */ + private static final Category log = Logger.getLogger(DefaultFaceObjects.class); + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link ArchFaceProvider} to use for collection. + */ + @NotNull + private final ArchFaceProvider archFaceProvider; + + /** + * Creates a new instance. + * @param archFaceProvider the arch face provider to use for collection + */ + public DefaultFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfFaceObject")); + this.archFaceProvider = archFaceProvider; + } + + /** + * {@inheritDoc} Collects the faces. The graphics information is written to + * "crossfire.0" resp. "daimonin.0". The meta information (offsets etc.) is + * written to "bmaps". The tree information for the editor is written to + * "bmaps.paths" resp. "facetree". <p/> Theoretically it would also be + * possible to recode the images. But the Java image encoder isn't as good + * as that of gimp in many cases (yet much better as the old visualtek's). + */ + @Override + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + collectTreeFile(progress, collectedDirectory); + collectBmapsFile(progress, collectedDirectory); + collectImageFile(progress, collectedDirectory); + } + + /** + * Creates the image file. + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectImageFile(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final File file = new File(collectedDirectory, ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.image.name")); + final FileOutputStream fos = new FileOutputStream(file); + try { + final FileChannel outChannel = fos.getChannel(); + try { + final PrintStream binFile = new PrintStream(fos); + try { + final int numOfFaceObjects = size(); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectImages"), numOfFaceObjects); + int i = 0; + for (final FaceObject faceObject : this) { + final String face = faceObject.getFaceName(); + final String path = archFaceProvider.getFilename(face); + try { + final FileInputStream fin = new FileInputStream(path); + try { + final FileChannel inChannel = fin.getChannel(); + final long imageSize = inChannel.size(); + binFile.format("IMAGE %d %d %s\n", i, imageSize, face); + inChannel.transferTo(0L, imageSize, outChannel); + } finally { + fin.close(); + } + } catch (final FileNotFoundException ignored) { + ACTION_BUILDER.showMessageDialog(progress.getParentComponent(), "archCollectErrorFileNotFound", path); + return; + } catch (final IOException e) { + ACTION_BUILDER.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", path, e); + return; + } + + if (i++ % 100 == 0) { + progress.setValue(i); + } + } + progress.setValue(size()); // finished + } finally { + binFile.close(); + } + } finally { + outChannel.close(); + } + } finally { + fos.close(); + } + } + + /** + * Creates the tree file. + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectTreeFile(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + collectFile(progress, new File(collectedDirectory, ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.facetree.name")), ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectTree"), ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.facetree.output")); + } + + /** + * Creates the bmaps file. + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectBmapsFile(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + collectFile(progress, new File(collectedDirectory, ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.face.name")), ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectBmaps"), ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.face.output")); + } + + /** + * Creates an output file containing all faces. + * @param progress the process to report progress to + * @param file the output file to write + * @param label the progress label + * @param format the format string for writing the output file + * @throws IOException if an I/O error occurs + */ + private void collectFile(@NotNull final Progress progress, @NotNull final File file, @NotNull final String label, @NotNull final String format) throws IOException { + final FileOutputStream fos = new FileOutputStream(file); + try { + final OutputStreamWriter osw = new OutputStreamWriter(fos); + try { + final BufferedWriter bw = new BufferedWriter(osw); + try { + final int numOfFaceObjects = size(); + progress.setLabel(label, numOfFaceObjects); + int i = 0; + for (final FaceObject faceObject : this) { + final String path = faceObject.getPath(); + final String face = faceObject.getFaceName(); + bw.append(String.format(format, i, path, face)).append('\n'); + if (i++ % 100 == 0) { + progress.setValue(i); + } + } + progress.setValue(numOfFaceObjects); + } finally { + bw.close(); + } + } finally { + osw.close(); + } + } finally { + fos.close(); + } + } + + @NotNull + @Override + public FaceProvider loadFacesCollection(@NotNull final ErrorView errorView, @NotNull final File collectedDirectory) { + final String faceFile = ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.image.name"); + final String treeFile = ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.facetree.name"); + final File tmpFaceFile; + try { + tmpFaceFile = IOUtils.getFile(collectedDirectory, faceFile); + } catch (final IOException ex) { + errorView.addWarning(ErrorViewCategory.FACES_FILE_INVALID, new File(collectedDirectory, faceFile) + ": " + ex.getMessage()); + return new EmptyFaceProvider(); + } + final CollectedFaceProvider collectedFaceProvider; + int faces = 0; + final ErrorViewCollector faceFileErrorViewCollector = new ErrorViewCollector(errorView, tmpFaceFile); + try { + collectedFaceProvider = new CollectedFaceProvider(tmpFaceFile); + final byte[] data = getFileContents(tmpFaceFile); + + // Note: treeIn might stay null, this is optional data. + final ErrorViewCollector treeFileErrorViewCollector = new ErrorViewCollector(errorView, new File(collectedDirectory, treeFile)); + BufferedReader treeIn = null; + try { + final URL url = IOUtils.getResource(collectedDirectory, treeFile); + final InputStream inputStream2 = url.openStream(); + final Reader reader = new InputStreamReader(inputStream2, IOUtils.MAP_ENCODING); + //cher: it is safely closed but optional. InspectionGadgets doesn't detect where it's closed. + //noinspection IOResourceOpenedButNotSafelyClosed + treeIn = new BufferedReader(reader); + } catch (final FileNotFoundException ignored) { + treeFileErrorViewCollector.addWarning(ErrorViewCategory.FACES_FILE_INVALID); + } + final byte[] tag = "IMAGE ".getBytes(); // this is the starting string for a new png + final StringBuilder faceB = new StringBuilder(); // face name of png + try { + final Pattern pattern = Pattern.compile(ActionBuilderUtils.getString(ACTION_BUILDER, "configSource.facetree.input")); + int offset = 0; + while (offset < data.length) { + // File: Structure* + // Structure: "IMAGE " seqNr ' ' size ' ' facename '\n' PNGBinary + if (!ArrayUtils.contains(data, offset, tag)) { // check for IMAGE + throw new IOException("expecting 'IMAGE' at position " + offset); + } + offset += 6; // skip "IMAGE "; + while (data[offset++] != (byte) 0x20) { + // skip seqNr ' ' + } + int size = 0; + // read size ' ' + while (true) { + final char c = (char) data[offset++]; // XXX: do not cast from byte to char + if (c == ' ') { + break; + } + if (c < '0' || c > '9') { + throw new IOException("syntax error at position " + offset + ": not a digit"); + } + size *= 10; + size += (int) c - (int) '0'; + } + faceB.setLength(0); + // read facename '\n' + while (true) { + final char c = (char) data[offset++]; // XXX: do not cast from byte to char + if (c == '\n') { + break; + } + if (c == '/') { + faceB.setLength(0); + } else { + faceB.append(c); + } + } + final String faceName = faceB.toString().intern(); + + if (offset + size > data.length) { + throw new IOException("truncated at position " + offset); + } + + if (treeIn != null) { + final String originalFilename = treeIn.readLine(); + if (originalFilename == null) { + log.warn(ACTION_BUILDER.format("logFaceObjectWithoutOriginalName", faceName)); + } else { + final Matcher matcher = pattern.matcher(originalFilename); + if (matcher.matches()) { + try { + addFaceObject(faceName, matcher.group(1), offset, size); + } catch (final DuplicateFaceException ex) { + faceFileErrorViewCollector.addWarning(ErrorViewCategory.FACES_ENTRY_INVALID, "duplicate face: " + ex.getDuplicate().getFaceName()); + } catch (final IllegalFaceException ex) { + faceFileErrorViewCollector.addWarning(ErrorViewCategory.FACES_ENTRY_INVALID, "invalid face: " + ex.getFaceObject().getFaceName()); + } + } else { + treeFileErrorViewCollector.addWarning(ErrorViewCategory.FACES_ENTRY_INVALID, "syntax error: " + originalFilename); + } + } + } + collectedFaceProvider.addInfo(faceName, offset, size); // TODO Remove me + faces++; + offset += size; + } + } finally { + if (treeIn != null) { + treeIn.close(); + } + } + } catch (final IOException ex) { + faceFileErrorViewCollector.addWarning(ErrorViewCategory.FACES_FILE_INVALID, ex.getMessage()); + return new EmptyFaceProvider(); + } + if (log.isInfoEnabled()) { + log.info("Loaded " + faces + " faces from '" + tmpFaceFile + "'."); + } + return collectedFaceProvider; + } + + /** + * Returns the contents of a {@link File} as a <code>byte</code> array. + * @param file the file to read + * @return the file contents + * @throws IOException if the file cannot be read + */ + private static byte[] getFileContents(@NotNull final File file) throws IOException { + final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) file.length()); + final InputStream inputStream = new FileInputStream(file); + try { + final byte[] buf = new byte[CHUNK_SIZE]; + while (true) { + final int len = inputStream.read(buf); + if (len == -1) { + break; + } + bufOut.write(buf, 0, len); + } + } finally { + inputStream.close(); + } + return bufOut.toByteArray(); + } + +} // class DefaultFaceObjects Property changes on: trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-07 12:17:57
|
Revision: 8772 http://gridarta.svn.sourceforge.net/gridarta/?rev=8772&view=rev Author: akirschbaum Date: 2010-11-07 12:17:48 +0000 (Sun, 07 Nov 2010) Log Message: ----------- Do not consider FileFilters 'gui' code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Added Paths: ----------- trunk/utils/src/app/net/sf/gridarta/utils/FileFilters.java trunk/utils/src/app/net/sf/gridarta/utils/GuiFileFilters.java trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java trunk/utils/src/app/net/sf/gridarta/utils/MapFileFilter.java trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -23,7 +23,6 @@ import java.io.IOException; import java.net.URL; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -100,6 +99,7 @@ import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.atrinik.IGUIConstants; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -21,7 +21,6 @@ import java.awt.Component; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -96,6 +95,7 @@ import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.ConfigFileUtils; import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.gui.map.renderer.DefaultRendererFactory; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -23,7 +23,6 @@ import java.io.IOException; import java.net.URL; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -100,6 +99,7 @@ import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.daimonin.IGUIConstants; Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -29,7 +29,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -44,6 +43,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.AnimationObjectsReader; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.utils.FileFilters; import net.sf.gridarta.utils.Pair; import org.apache.log4j.Category; import org.apache.log4j.Logger; Deleted: trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -1,62 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.io; - -import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.utils.HideFileFilterProxy; -import net.sf.gridarta.gui.utils.MapFileFilter; -import net.sf.gridarta.utils.ActionBuilderUtils; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.util.filter.file.EndingFileFilter; - -/** - * Utility class defining {@link FileFilter}s. - * @author Andreas Kirschbaum - */ -public class GuiFileFilters { - - /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** - * Private constructor to prevent instantiation. - */ - private GuiFileFilters() { - } - - /** - * Swing FileFilter for map files. - */ - public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); - - /** - * Swing FileFilter for Python scripts. - */ - public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.python"), ".py")); - - /** - * Swing FileFilter for Lua scripts. - */ - public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.lua"), ".lua")); - -} // class FileFilters Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -24,13 +24,13 @@ import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JOptionPane; -import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.utils.FileChooserUtils; +import net.sf.gridarta.utils.FileFilters; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -34,7 +34,7 @@ import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.WindowConstants; -import net.sf.gridarta.gui.utils.FileFilters; +import net.sf.gridarta.utils.FileFilters; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MiscPreferences.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -34,10 +34,10 @@ import javax.swing.event.ChangeListener; import javax.swing.text.JTextComponent; import net.sf.gridarta.gui.utils.GUIConstants; -import net.sf.gridarta.gui.utils.MapFileFilter; import net.sf.gridarta.model.exitconnector.ExitConnectorModel; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.utils.ActionBuilderUtils; +import net.sf.gridarta.utils.MapFileFilter; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.prefs.AbstractPrefs; Deleted: trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -1,130 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.utils; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Map; -import java.util.WeakHashMap; -import java.util.prefs.Preferences; -import net.sf.gridarta.MainControl; -import net.sf.japi.util.filter.file.EndingFileFilter; -import org.jetbrains.annotations.NotNull; - -/** - * Swing FileFilter implementation that filters Daimonin map files. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class MapFileFilter extends EndingFileFilter { - - /** - * Whether to actually perform real checks or just file endings. - * <code>true</code> = real checks, <code>false</code> = file endings only. - */ - private static boolean performingRealChecks = Preferences.userNodeForPackage(MainControl.class).getBoolean("filterRealMaps", true); - - /** - * Already filtered files. Key: File Value: Boolean information whether or - * not the file should be accepted (<code>true</code> == accept, - * <code>false</code> == reject) - */ - @NotNull - private final Map<File, Boolean> cache = new WeakHashMap<File, Boolean>(); - - /** - * Creates a new instance. - * @param acceptDirectories whether the file filter should accept - * directories - * @param description the description to use for Swing - * @param endings the endings to accept, including their period - */ - public MapFileFilter(final boolean acceptDirectories, @NotNull final String description, @NotNull final String... endings) { - super(acceptDirectories, true, description, endings); - } - - /** - * Set whether to actually perform real checks or just file endings. - * @param performingRealChecks <code>true</code> for performing real checks, - * <code>false</code> to compare only file endings - */ - public static void setPerformingRealChecks(final boolean performingRealChecks) { - MapFileFilter.performingRealChecks = performingRealChecks; - Preferences.userNodeForPackage(MainControl.class).putBoolean("filterRealMaps", performingRealChecks); - } - - /** - * Get whether to actually perform real checks or just file endings. - * @return <code>true</code> for performing real checks, <code>false</code> - * to compare only file endings - */ - public static boolean isPerformingRealChecks() { - return performingRealChecks; - } - - /** - * {@inheritDoc} - * @noinspection ParameterNameDiffersFromOverriddenParameter - */ - @Override - public boolean accept(@NotNull final File pathName) { - if (pathName.isDirectory()) { - return true; - } - - //NullPointerException is expected when no mapping exists - //noinspection ProhibitedExceptionCaught - try { - return cache.get(pathName); - } catch (final NullPointerException ignored) { - } - - if (!performingRealChecks) { - return super.accept(pathName); - } - - try { - final FileInputStream fis = new FileInputStream(pathName); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final BufferedReader in = new BufferedReader(isr); - try { - final String line = in.readLine(); - final boolean ret = line != null && line.equals("arch map"); - cache.put(pathName, ret ? Boolean.TRUE : Boolean.FALSE); - return ret; - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ignored) { - return super.accept(pathName); - } - } - -} // class MapFileFilter Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -33,7 +33,6 @@ import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.gui.archetypetype.ArchetypeTypeChecks; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.scripts.DefaultScriptArchEditor; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; @@ -104,6 +103,7 @@ import net.sf.gridarta.script.ScriptParameters; import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.CommonConstants; +import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.utils.XmlHelper; Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -56,7 +56,6 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.gameobjectattributespanel.MsgTextTab; import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; -import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.mainwindow.GameObjectTab; import net.sf.gridarta.gui.mainwindow.WarningsTab; import net.sf.gridarta.gui.map.MapFileActions; @@ -173,6 +172,7 @@ import net.sf.gridarta.updater.UpdaterManager; import net.sf.gridarta.utils.ActionUtils; import net.sf.gridarta.utils.Exiter; +import net.sf.gridarta.utils.GuiFileFilters; import net.sf.gridarta.utils.ProcessRunner; import net.sf.gridarta.utils.SystemIcons; import net.sf.japi.swing.action.ActionBuilder; Deleted: trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -1,71 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.utils; - -import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.utils.ActionBuilderUtils; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.util.filter.file.EndingFileFilter; -import org.jetbrains.annotations.NotNull; - -/** - * Utility class defining {@link FileFilter}s. - * @author Andreas Kirschbaum - */ -public class FileFilters { - - /** - * Action Builder. - */ - @NotNull - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** - * Private constructor to prevent instantiation. - */ - private FileFilters() { - } - - /** - * Swing FileFilter for .arc files. - */ - @NotNull - public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.arc"), ".arc")); - - /** - * Swing FileFilter for .anim files. - */ - @NotNull - public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.anim"), ".anim")); - - /** - * Swing FileFilter for .face files. - */ - @NotNull - public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.face"), ".face")); - - /** - * Swing FileFilter for png graphics. - */ - @NotNull - public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.png"), ".png")); - -} // class FileFilters Deleted: trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -1,90 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.utils; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import javax.swing.filechooser.FileFilter; -import net.sf.japi.util.filter.file.AbstractFileFilter; -import org.jetbrains.annotations.NotNull; - -/** - * A FileFilter that wraps another FileFilter and filters out CVS and .xvpics - * files. The description and other filtering are taken from the wrapped file - * filter. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class HideFileFilterProxy extends AbstractFileFilter { - - /** - * The other file filter. - */ - @NotNull - private final FileFilter other; - - /** - * The default rejected directory names. - */ - @NotNull - private static final Collection<String> REJECTED_DIRECTORY_NAMES = Arrays.asList("CVS"); - - /** - * The rejected directory names. - */ - @NotNull - private final Collection<String> rejectedDirectoryNames = new ArrayList<String>(); - - /** - * Create a HideFileFilterProxy. - * @param other FileFilter to wrap - */ - public HideFileFilterProxy(@NotNull final FileFilter other) { - this.other = other; - rejectedDirectoryNames.addAll(REJECTED_DIRECTORY_NAMES); - } - - /** - * {@inheritDoc} Returns the description from the {@link #other} - * FileFilter. - */ - @NotNull - @Override - public String getDescription() { - return other.getDescription(); - } - - /** - * {@inheritDoc} First checks whether the file should be hidden, if not, - * checks the other FileFilter. - */ - @SuppressWarnings({ "ParameterNameDiffersFromOverriddenParameter" }) - @Override - public boolean accept(@NotNull final File pathName) { - if (pathName.getName().startsWith(".")) { - return false; - } - // XXX suppression for Bug in IDEA - //noinspection RedundantCast - return !(pathName.isDirectory() && rejectedDirectoryNames.contains(pathName.getName())) && ((java.io.FileFilter) other).accept(pathName); - } - -} // class HideFileFilterProxy Copied: trunk/utils/src/app/net/sf/gridarta/utils/FileFilters.java (from rev 8771, trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java) =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/FileFilters.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/utils/FileFilters.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -0,0 +1,70 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +import javax.swing.filechooser.FileFilter; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.util.filter.file.EndingFileFilter; +import org.jetbrains.annotations.NotNull; + +/** + * Utility class defining {@link FileFilter}s. + * @author Andreas Kirschbaum + */ +public class FileFilters { + + /** + * Action Builder. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * Private constructor to prevent instantiation. + */ + private FileFilters() { + } + + /** + * Swing FileFilter for .arc files. + */ + @NotNull + public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.arc"), ".arc")); + + /** + * Swing FileFilter for .anim files. + */ + @NotNull + public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.anim"), ".anim")); + + /** + * Swing FileFilter for .face files. + */ + @NotNull + public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.face"), ".face")); + + /** + * Swing FileFilter for png graphics. + */ + @NotNull + public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.png"), ".png")); + +} // class FileFilters Property changes on: trunk/utils/src/app/net/sf/gridarta/utils/FileFilters.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/utils/src/app/net/sf/gridarta/utils/GuiFileFilters.java (from rev 8769, trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java) =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/GuiFileFilters.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/utils/GuiFileFilters.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -0,0 +1,59 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +import javax.swing.filechooser.FileFilter; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.util.filter.file.EndingFileFilter; + +/** + * Utility class defining {@link FileFilter}s. + * @author Andreas Kirschbaum + */ +public class GuiFileFilters { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * Private constructor to prevent instantiation. + */ + private GuiFileFilters() { + } + + /** + * Swing FileFilter for map files. + */ + public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); + + /** + * Swing FileFilter for Python scripts. + */ + public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.python"), ".py")); + + /** + * Swing FileFilter for Lua scripts. + */ + public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ActionBuilderUtils.getString(ACTION_BUILDER, "fileDialog.filter.lua"), ".lua")); + +} // class FileFilters Property changes on: trunk/utils/src/app/net/sf/gridarta/utils/GuiFileFilters.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java (from rev 8771, trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java) =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -0,0 +1,90 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import javax.swing.filechooser.FileFilter; +import net.sf.japi.util.filter.file.AbstractFileFilter; +import org.jetbrains.annotations.NotNull; + +/** + * A FileFilter that wraps another FileFilter and filters out CVS and .xvpics + * files. The description and other filtering are taken from the wrapped file + * filter. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class HideFileFilterProxy extends AbstractFileFilter { + + /** + * The other file filter. + */ + @NotNull + private final FileFilter other; + + /** + * The default rejected directory names. + */ + @NotNull + private static final Collection<String> REJECTED_DIRECTORY_NAMES = Arrays.asList("CVS"); + + /** + * The rejected directory names. + */ + @NotNull + private final Collection<String> rejectedDirectoryNames = new ArrayList<String>(); + + /** + * Create a HideFileFilterProxy. + * @param other FileFilter to wrap + */ + public HideFileFilterProxy(@NotNull final FileFilter other) { + this.other = other; + rejectedDirectoryNames.addAll(REJECTED_DIRECTORY_NAMES); + } + + /** + * {@inheritDoc} Returns the description from the {@link #other} + * FileFilter. + */ + @NotNull + @Override + public String getDescription() { + return other.getDescription(); + } + + /** + * {@inheritDoc} First checks whether the file should be hidden, if not, + * checks the other FileFilter. + */ + @SuppressWarnings({ "ParameterNameDiffersFromOverriddenParameter" }) + @Override + public boolean accept(@NotNull final File pathName) { + if (pathName.getName().startsWith(".")) { + return false; + } + // XXX suppression for Bug in IDEA + //noinspection RedundantCast + return !(pathName.isDirectory() && rejectedDirectoryNames.contains(pathName.getName())) && ((java.io.FileFilter) other).accept(pathName); + } + +} // class HideFileFilterProxy Property changes on: trunk/utils/src/app/net/sf/gridarta/utils/HideFileFilterProxy.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/utils/src/app/net/sf/gridarta/utils/MapFileFilter.java (from rev 8769, trunk/src/app/net/sf/gridarta/gui/utils/MapFileFilter.java) =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/MapFileFilter.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/utils/MapFileFilter.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -0,0 +1,130 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Map; +import java.util.WeakHashMap; +import java.util.prefs.Preferences; +import net.sf.gridarta.MainControl; +import net.sf.japi.util.filter.file.EndingFileFilter; +import org.jetbrains.annotations.NotNull; + +/** + * Swing FileFilter implementation that filters Daimonin map files. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class MapFileFilter extends EndingFileFilter { + + /** + * Whether to actually perform real checks or just file endings. + * <code>true</code> = real checks, <code>false</code> = file endings only. + */ + private static boolean performingRealChecks = Preferences.userNodeForPackage(MainControl.class).getBoolean("filterRealMaps", true); + + /** + * Already filtered files. Key: File Value: Boolean information whether or + * not the file should be accepted (<code>true</code> == accept, + * <code>false</code> == reject) + */ + @NotNull + private final Map<File, Boolean> cache = new WeakHashMap<File, Boolean>(); + + /** + * Creates a new instance. + * @param acceptDirectories whether the file filter should accept + * directories + * @param description the description to use for Swing + * @param endings the endings to accept, including their period + */ + public MapFileFilter(final boolean acceptDirectories, @NotNull final String description, @NotNull final String... endings) { + super(acceptDirectories, true, description, endings); + } + + /** + * Set whether to actually perform real checks or just file endings. + * @param performingRealChecks <code>true</code> for performing real checks, + * <code>false</code> to compare only file endings + */ + public static void setPerformingRealChecks(final boolean performingRealChecks) { + MapFileFilter.performingRealChecks = performingRealChecks; + Preferences.userNodeForPackage(MainControl.class).putBoolean("filterRealMaps", performingRealChecks); + } + + /** + * Get whether to actually perform real checks or just file endings. + * @return <code>true</code> for performing real checks, <code>false</code> + * to compare only file endings + */ + public static boolean isPerformingRealChecks() { + return performingRealChecks; + } + + /** + * {@inheritDoc} + * @noinspection ParameterNameDiffersFromOverriddenParameter + */ + @Override + public boolean accept(@NotNull final File pathName) { + if (pathName.isDirectory()) { + return true; + } + + //NullPointerException is expected when no mapping exists + //noinspection ProhibitedExceptionCaught + try { + return cache.get(pathName); + } catch (final NullPointerException ignored) { + } + + if (!performingRealChecks) { + return super.accept(pathName); + } + + try { + final FileInputStream fis = new FileInputStream(pathName); + try { + final InputStreamReader isr = new InputStreamReader(fis); + try { + final BufferedReader in = new BufferedReader(isr); + try { + final String line = in.readLine(); + final boolean ret = line != null && line.equals("arch map"); + cache.put(pathName, ret ? Boolean.TRUE : Boolean.FALSE); + return ret; + } finally { + in.close(); + } + } finally { + isr.close(); + } + } finally { + fis.close(); + } + } catch (final IOException ignored) { + return super.accept(pathName); + } + } + +} // class MapFileFilter Property changes on: trunk/utils/src/app/net/sf/gridarta/utils/MapFileFilter.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Deleted: trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java =================================================================== --- trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java 2010-11-07 12:05:25 UTC (rev 8771) +++ trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -1,106 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.utils; - -import java.io.File; -import javax.swing.filechooser.FileFilter; -import net.sf.japi.util.filter.file.AbstractFileFilter; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test for {@link HideFileFilterProxy}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class HideFileFilterProxyTest { - - /** - * Test case for {@link HideFileFilterProxy#HideFileFilterProxy(FileFilter)}. - */ - @Test - public void testHideFileFilterProxy() { - //noinspection ResultOfObjectAllocationIgnored - new HideFileFilterProxy(new MockFileFilter(true)); - } - - /** - * Test case for {@link HideFileFilterProxy#getDescription()}. - */ - @Test - public void testGetDescription() { - final FileFilter oUT = new HideFileFilterProxy(new MockFileFilter(true)); - Assert.assertEquals("MOCK", oUT.getDescription()); - } - - /** - * Test case for {@link HideFileFilterProxy#accept(File)}. - */ - @Test - public void testAccept() { - final FileFilter oUT1 = new HideFileFilterProxy(new MockFileFilter(true)); - Assert.assertTrue(oUT1.accept(new File("foobar"))); - //Assert.assertFalse(oUT1.accept(new File("CVS"))); - Assert.assertFalse(oUT1.accept(new File(".svn"))); - - final FileFilter oUT2 = new HideFileFilterProxy(new MockFileFilter(false)); - Assert.assertFalse(oUT2.accept(new File("foobar"))); - //Assert.assertFalse(oUT2.accept(new File("CVS"))); - Assert.assertFalse(oUT2.accept(new File(".svn"))); - } - - /** - * Mock File Filter that's used as parent file filter for the - * HideFileFilterProxy under test. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ - private static class MockFileFilter extends AbstractFileFilter { - - /** - * Whether this file filter will accept or reject files. - */ - private final boolean accepts; - - /** - * Create a MockFileFilter. - * @param accepts Whether this file filter will accept or reject files. - */ - private MockFileFilter(final boolean accepts) { - this.accepts = accepts; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean accept(final File f) { - return accepts; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "MOCK"; - } - - } // class MockFileFilter - -} // class HideFileFilterProxyTest Copied: trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java (from rev 8769, trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java) =================================================================== --- trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java (rev 0) +++ trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java 2010-11-07 12:17:48 UTC (rev 8772) @@ -0,0 +1,106 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +import java.io.File; +import javax.swing.filechooser.FileFilter; +import net.sf.japi.util.filter.file.AbstractFileFilter; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test for {@link HideFileFilterProxy}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class HideFileFilterProxyTest { + + /** + * Test case for {@link HideFileFilterProxy#HideFileFilterProxy(FileFilter)}. + */ + @Test + public void testHideFileFilterProxy() { + //noinspection ResultOfObjectAllocationIgnored + new HideFileFilterProxy(new MockFileFilter(true)); + } + + /** + * Test case for {@link HideFileFilterProxy#getDescription()}. + */ + @Test + public void testGetDescription() { + final FileFilter oUT = new HideFileFilterProxy(new MockFileFilter(true)); + Assert.assertEquals("MOCK", oUT.getDescription()); + } + + /** + * Test case for {@link HideFileFilterProxy#accept(File)}. + */ + @Test + public void testAccept() { + final FileFilter oUT1 = new HideFileFilterProxy(new MockFileFilter(true)); + Assert.assertTrue(oUT1.accept(new File("foobar"))); + //Assert.assertFalse(oUT1.accept(new File("CVS"))); + Assert.assertFalse(oUT1.accept(new File(".svn"))); + + final FileFilter oUT2 = new HideFileFilterProxy(new MockFileFilter(false)); + Assert.assertFalse(oUT2.accept(new File("foobar"))); + //Assert.assertFalse(oUT2.accept(new File("CVS"))); + Assert.assertFalse(oUT2.accept(new File(".svn"))); + } + + /** + * Mock File Filter that's used as parent file filter for the + * HideFileFilterProxy under test. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ + private static class MockFileFilter extends AbstractFileFilter { + + /** + * Whether this file filter will accept or reject files. + */ + private final boolean accepts; + + /** + * Create a MockFileFilter. + * @param accepts Whether this file filter will accept or reject files. + */ + private MockFileFilter(final boolean accepts) { + this.accepts = accepts; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean accept(final File f) { + return accepts; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return "MOCK"; + } + + } // class MockFileFilter + +} // class HideFileFilterProxyTest Property changes on: trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-07 12:35:42
|
Revision: 8773 http://gridarta.svn.sourceforge.net/gridarta/?rev=8773&view=rev Author: akirschbaum Date: 2010-11-07 12:35:35 +0000 (Sun, 07 Nov 2010) Log Message: ----------- Move 'gui' class GUIConstants out of utils module. Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java Removed Paths: ------------- trunk/utils/src/app/net/sf/gridarta/gui/ Copied: trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java (from rev 8772, trunk/utils/src/app/net/sf/gridarta/gui/utils/GUIConstants.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java 2010-11-07 12:35:35 UTC (rev 8773) @@ -0,0 +1,40 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.utils; + +import java.awt.Insets; +import javax.swing.border.Border; +import javax.swing.border.EmptyBorder; + +/** + * Defines common UI constants used in different dialogs. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author Andreas Kirschbaum + * @noinspection InterfaceNeverImplemented + */ +public interface GUIConstants { + + /** + * The Border object to be used when creating dialogs. + */ + Border DIALOG_BORDER = new EmptyBorder(new Insets(4, 4, 4, 4)); + +} // interface GUIConstants Property changes on: trunk/src/app/net/sf/gridarta/gui/utils/GUIConstants.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-08 08:39:00
|
Revision: 8774 http://gridarta.svn.sourceforge.net/gridarta/?rev=8774&view=rev Author: akirschbaum Date: 2010-11-08 08:38:49 +0000 (Mon, 08 Nov 2010) Log Message: ----------- Move MapManager and related classes to model module. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultMapManager.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultPickmapManager.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/FileControl.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManager.java trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManagerListener.java trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolder.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptTask.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java trunk/src/app/net/sf/gridarta/script/parameter/MapParameter.java trunk/src/app/net/sf/gridarta/script/parameter/PluginParameterFactory.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java trunk/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java trunk/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/mapmanager/ trunk/src/app/net/sf/gridarta/model/ trunk/src/app/net/sf/gridarta/model/mapmanager/ trunk/src/test/net/sf/gridarta/model/mapmanager/ Removed Paths: ------------- trunk/src/app/net/sf/gridarta/mapmanager/ trunk/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java trunk/src/app/net/sf/gridarta/model/mapmanager/DefaultMapManager.java trunk/src/app/net/sf/gridarta/model/mapmanager/DefaultPickmapManager.java trunk/src/app/net/sf/gridarta/model/mapmanager/FileControl.java trunk/src/app/net/sf/gridarta/model/mapmanager/MapManager.java trunk/src/app/net/sf/gridarta/model/mapmanager/MapManagerListener.java trunk/src/test/net/sf/gridarta/mapmanager/ Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -23,7 +23,7 @@ import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -51,7 +51,7 @@ import net.sf.gridarta.gui.map.maptilepane.IsoMapTilePane; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.gui.utils.TextComponentUtils; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -44,8 +44,6 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; -import net.sf.gridarta.mapmanager.AbstractMapManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -75,6 +73,8 @@ import net.sf.gridarta.model.io.SubDirectoryCacheFiles; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.MapControlFactory; +import net.sf.gridarta.model.mapmanager.AbstractMapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -23,7 +23,7 @@ import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -43,7 +43,7 @@ import net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane; import net.sf.gridarta.gui.map.maptilepane.FlatMapTilePane; import net.sf.gridarta.gui.utils.TextComponentUtils; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -42,8 +42,6 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; -import net.sf.gridarta.mapmanager.AbstractMapManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -70,6 +68,8 @@ import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.MapControlFactory; +import net.sf.gridarta.model.mapmanager.AbstractMapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/DefaultMapPropertiesDialogFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -23,7 +23,7 @@ import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -52,7 +52,7 @@ import net.sf.gridarta.gui.map.maptilepane.IsoMapTilePane; import net.sf.gridarta.gui.utils.GUIConstants; import net.sf.gridarta.gui.utils.TextComponentUtils; -import net.sf.gridarta.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -44,8 +44,6 @@ import net.sf.gridarta.maincontrol.DefaultMainControl; import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; -import net.sf.gridarta.mapmanager.AbstractMapManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -75,6 +73,8 @@ import net.sf.gridarta.model.io.SubDirectoryCacheFiles; import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; import net.sf.gridarta.model.mapcontrol.MapControlFactory; +import net.sf.gridarta.model.mapmanager.AbstractMapManager; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.InsertionMode; import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/AbstractMapManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.io.File; import java.io.IOException; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultMapManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultMapManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.io.File; import java.util.List; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultPickmapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultPickmapManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/DefaultPickmapManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.io.File; import java.util.List; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/FileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/FileControl.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/FileControl.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.io.File; import net.sf.gridarta.model.archetype.Archetype; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.io.File; import java.io.IOException; Modified: trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManagerListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/MapManagerListener.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/model/src/app/net/sf/gridarta/model/mapmanager/MapManagerListener.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.mapmanager; +package net.sf.gridarta.model.mapmanager; import java.util.EventListener; import net.sf.gridarta.model.archetype.Archetype; Modified: trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java =================================================================== --- trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,12 +25,12 @@ import java.util.Collection; import java.util.List; import java.util.regex.Matcher; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.IOErrorException; import net.sf.gridarta.model.mappathnormalizer.InvalidPathException; Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,13 +25,13 @@ import java.util.Map; import java.util.Set; import javax.swing.SwingUtilities; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.maparchobject.MapArchObjectListener; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/exitconnector/ExitConnectorActions.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -22,8 +22,6 @@ import java.awt.Point; import java.io.File; import java.io.IOException; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; @@ -35,6 +33,8 @@ import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.InsertionModeSet; import net.sf.gridarta.model.mapmodel.MapModel; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -71,8 +71,6 @@ import net.sf.gridarta.gui.treasurelist.CFTreasureListTree; import net.sf.gridarta.gui.utils.AnimationComponent; import net.sf.gridarta.gui.utils.FaceComponent; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.AbstractArchetypeAttributeSpell; @@ -108,6 +106,8 @@ import net.sf.gridarta.model.gameobject.GameObjectUtils; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialogFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -27,7 +27,6 @@ import javax.swing.JFrame; import javax.swing.filechooser.FileFilter; import net.sf.gridarta.gui.treasurelist.CFTreasureListTree; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -35,6 +34,7 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ErrorListView.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -40,14 +40,14 @@ import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcursor.MapCursor; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -40,10 +40,10 @@ import net.sf.gridarta.gui.scripts.ScriptArchEditor; import net.sf.gridarta.gui.scripts.ScriptTask; import net.sf.gridarta.gui.utils.Severity; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.scripts.ScriptArchData; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -42,14 +42,14 @@ import net.sf.gridarta.gui.selectedsquare.SelectedSquareModelListener; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.utils.Severity; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -29,13 +29,13 @@ import net.sf.gridarta.gui.map.mapview.MapViewManagerListener; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.renderer.ImageCreator2; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -39,9 +39,6 @@ import net.sf.gridarta.gui.mappropertiesdialog.MapPropertiesDialogFactory; import net.sf.gridarta.gui.selectedsquare.SelectedSquareModel; import net.sf.gridarta.gui.shrinkmapsizedialog.ShrinkMapSizeDialogManager; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.exitconnector.ExitMatcher; @@ -51,6 +48,9 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.IOErrorException; import net.sf.gridarta.model.mappathnormalizer.InvalidPathException; Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/AbstractMapTilePane.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -36,11 +36,11 @@ import net.sf.gridarta.actions.MapSizeMismatchException; import net.sf.gridarta.gui.utils.DirectionLayout; import net.sf.gridarta.gui.utils.GUIConstants; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/FlatMapTilePane.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -20,11 +20,11 @@ package net.sf.gridarta.gui.map.maptilepane; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/maptilepane/IsoMapTilePane.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -20,11 +20,11 @@ package net.sf.gridarta.gui.map.maptilepane; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.direction.Direction; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mappathnormalizer.MapPathNormalizer; import net.sf.gridarta.model.settings.GlobalSettings; Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -26,13 +26,13 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -21,11 +21,11 @@ import java.io.File; import java.io.IOException; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; Modified: trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -24,12 +24,12 @@ import java.util.Comparator; import java.util.LinkedList; import java.util.List; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.mapviewsettings.MapViewSettingsListener; import net.sf.gridarta.model.match.NamedGameObjectMatcher; Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -37,12 +37,12 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.gui.mapimagecache.MapImageCacheListener; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.utils.ActionUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,12 +25,12 @@ import javax.swing.AbstractAction; import javax.swing.KeyStroke; import net.sf.gridarta.gui.map.mapview.MapView; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.validation.ErrorCollector; Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -22,7 +22,6 @@ import java.io.File; import java.util.Arrays; import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; @@ -30,6 +29,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFile.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,13 +25,13 @@ import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.gui.map.mapview.MapViewBasic; import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReader; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolder.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolder.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolder.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -26,12 +26,12 @@ import java.util.Iterator; import java.util.List; import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReaderFactory; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -28,8 +28,6 @@ import java.util.Map; import net.sf.gridarta.gui.map.renderer.MapRenderer; import net.sf.gridarta.gui.map.renderer.RendererFactory; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.CacheFiles; @@ -37,6 +35,8 @@ import net.sf.gridarta.model.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcontrol.MapControlListener; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -27,10 +27,10 @@ import javax.swing.AbstractListModel; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.FileControl; import net.sf.gridarta.model.settings.GlobalSettings; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -24,10 +24,10 @@ import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.FileControl; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -27,10 +27,10 @@ import javax.swing.ImageIcon; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.FileControl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -29,14 +29,14 @@ import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import net.sf.gridarta.gui.utils.MenuUtils; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcontrol.MapControlListener; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,10 +25,10 @@ import net.sf.gridarta.MainControl; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.FileControl; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; Modified: trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,12 +25,12 @@ import net.sf.gridarta.gui.map.mapview.MapViewsListener; import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.map.tools.ToolPalette; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/misc/DefaultFileControl.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -29,12 +29,12 @@ import net.sf.gridarta.gui.map.mapview.MapViewsManager; import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.gridarta.utils.ActionBuilderUtils; Modified: trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/misc/RecentManager.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -20,12 +20,12 @@ package net.sf.gridarta.gui.misc; import net.sf.gridarta.gui.mapmenu.MapMenuManager; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -36,8 +36,6 @@ import net.sf.gridarta.gui.map.mapview.MapViewManager; import net.sf.gridarta.gui.map.mapview.MapViewManagerListener; import net.sf.gridarta.gui.map.renderer.MapRenderer; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.data.NamedObjects; @@ -50,6 +48,8 @@ import net.sf.gridarta.model.mapcursor.MapCursor; import net.sf.gridarta.model.mapcursor.MapCursorEvent; import net.sf.gridarta.model.mapcursor.MapCursorListener; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -41,9 +41,6 @@ import net.sf.gridarta.gui.mapfiles.MapFolderTree; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.ObjectChooserTab; -import net.sf.gridarta.mapmanager.FileControl; -import net.sf.gridarta.mapmanager.MapManager; -import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.MapReaderFactory; @@ -52,6 +49,9 @@ import net.sf.gridarta.model.mapcontrol.DefaultMapControl; import net.sf.gridarta.model.mapcontrol.MapControl; import net.sf.gridarta.model.mapcontrol.MapControlListener; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.MapManagerListener; import net.sf.gridarta.model.mapmodel.MapModelListener; import net.sf.gridarta.model.mapmodel.MapSquare; import net.sf.gridarta.model.pickmapsettings.PickmapSettings; Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterCellRenderer.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -22,8 +22,8 @@ import java.awt.Component; import javax.swing.DefaultListCellRenderer; import javax.swing.JList; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import org.jetbrains.annotations.NotNull; public class MapParameterCellRenderer extends DefaultListCellRenderer { Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterComboBoxModel.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -21,11 +21,11 @@ import java.util.List; import javax.swing.DefaultComboBoxModel; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapmanager.MapManager; import org.jetbrains.annotations.NotNull; public class MapParameterComboBoxModel<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DefaultComboBoxModel { Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/MapParameterView.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -25,10 +25,10 @@ import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JPanel; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.script.parameter.MapParameter; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/PluginParameterViewFactory.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -21,12 +21,12 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.objectchooser.ObjectChooser; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.script.parameter.ArchParameter; import net.sf.gridarta.script.parameter.BooleanParameter; import net.sf.gridarta.script.parameter.DoubleParameter; Modified: trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -44,11 +44,11 @@ import javax.swing.WindowConstants; import javax.swing.filechooser.FileFilter; import javax.swing.text.JTextComponent; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.scripts.ScriptArchData; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptUtils; Modified: trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-11-07 12:35:35 UTC (rev 8773) +++ trunk/src/app/net/sf/gridarta/gui/scripts/ScriptArchDataUtils.java 2010-11-08 08:38:49 UTC (rev 8774) @@ -22,10 +22,10 @@ import java.awt.Frame; import javax.swing.JList; import javax.swing.JOptionPane; -import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.scripts.ScriptArchUtils; impo... [truncated message content] |
From: <aki...@us...> - 2010-11-08 21:53:10
|
Revision: 8775 http://gridarta.svn.sourceforge.net/gridarta/?rev=8775&view=rev Author: akirschbaum Date: 2010-11-08 21:53:04 +0000 (Mon, 08 Nov 2010) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java Modified: trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java 2010-11-08 08:38:49 UTC (rev 8774) +++ trunk/model/src/test/net/sf/gridarta/model/floodfill/FillUtilsTest.java 2010-11-08 21:53:04 UTC (rev 8775) @@ -50,7 +50,7 @@ @Test public void testFillAdjacent() throws CannotInsertGameObjectException, DuplicateArchetypeException { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); - final TestMapModelHelper mapModelHelper = mapModelCreator.newMapModelCreator(); + final TestMapModelHelper mapModelHelper = mapModelCreator.newTestMapModelHelper(); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(4, 5); final TestArchetype head = mapModelCreator.getArchetype("2x2a"); Modified: trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2010-11-08 08:38:49 UTC (rev 8774) +++ trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2010-11-08 21:53:04 UTC (rev 8775) @@ -45,7 +45,7 @@ @Test public void testDoMoveSquareTopSingle() throws CannotInsertGameObjectException, DuplicateArchetypeException { final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); - final TestMapModelHelper mapModelHelper = mapModelCreator.newMapModelCreator(); + final TestMapModelHelper mapModelHelper = mapModelCreator.newTestMapModelHelper(); final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(1, 1); final Point point = new Point(0, 0); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-11-08 08:38:49 UTC (rev 8774) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-11-08 21:53:04 UTC (rev 8775) @@ -249,15 +249,6 @@ } /** - * Creates a new {@link TestMapModelHelper} instance. - * @return the new instance - * @throws DuplicateArchetypeException if an internal error occurs - */ - public TestMapModelHelper newMapModelCreator() throws DuplicateArchetypeException { - return new TestMapModelHelper(topmostInsertionMode, gameObjectFactory, archetypeSet, faceObjectProviders, animationObjects); - } - - /** * Returns the {@link MapViewSettings} instance. * @return the map view settings instance */ Modified: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-11-08 08:38:49 UTC (rev 8774) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-11-08 21:53:04 UTC (rev 8775) @@ -174,7 +174,7 @@ * @throws DuplicateArchetypeException if an internal error occurs */ public TestMapModelHelper newMapModelCreator() throws DuplicateArchetypeException { - return mapModelCreator.newMapModelCreator(); + return mapModelCreator.newTestMapModelHelper(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-09 18:43:29
|
Revision: 8776 http://gridarta.svn.sourceforge.net/gridarta/?rev=8776&view=rev Author: akirschbaum Date: 2010-11-09 18:43:21 +0000 (Tue, 09 Nov 2010) Log Message: ----------- Move non-GUI code into model module. Modified Paths: -------------- trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java trunk/src/test/net/sf/gridarta/gui/selectedsquare/SelectedSquareActionsTest.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/model/src/test/net/sf/gridarta/model/mapmanager/ trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java trunk/src/test/net/sf/gridarta/model/gameobject/ trunk/src/test/net/sf/gridarta/model/io/ trunk/src/test/net/sf/gridarta/model/mapmanager/ Copied: trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java (from rev 8775, trunk/src/test/net/sf/gridarta/model/io/TestCacheFiles.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -0,0 +1,41 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.io; + +import java.io.File; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A {@link CacheFiles} implementation for regression test. + * @author Andreas Kirschbaum + */ +public class TestCacheFiles implements CacheFiles { + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getCacheFile(@NotNull final File file, @Nullable final String prefix) { + return file; + } + +} // class TestCacheFiles Property changes on: trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -0,0 +1,294 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.mapcontrol; + +import java.io.File; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; +import net.sf.gridarta.model.autojoin.AutojoinListsHelper; +import net.sf.gridarta.model.exitconnector.ExitMatcher; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.io.DefaultMapWriter; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.io.MapArchObjectParserFactory; +import net.sf.gridarta.model.io.MapReaderFactory; +import net.sf.gridarta.model.io.MapWriter; +import net.sf.gridarta.model.io.PathManager; +import net.sf.gridarta.model.io.TestMapArchObjectParserFactory; +import net.sf.gridarta.model.io.TestMapReaderFactory; +import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObjectFactory; +import net.sf.gridarta.model.mapmanager.AbstractMapManager; +import net.sf.gridarta.model.mapmanager.DefaultMapManager; +import net.sf.gridarta.model.mapmanager.FileControl; +import net.sf.gridarta.model.mapmanager.MapManager; +import net.sf.gridarta.model.mapmanager.TestFileControl; +import net.sf.gridarta.model.mapmodel.InsertionModeSet; +import net.sf.gridarta.model.mapmodel.MapModelFactory; +import net.sf.gridarta.model.mapmodel.TestMapModelCreator; +import net.sf.gridarta.model.mapmodel.TestMapModelHelper; +import net.sf.gridarta.model.match.GameObjectMatcher; +import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; +import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.settings.TestGlobalSettings; +import net.sf.gridarta.utils.Size2D; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Helper class for creating {@link MapControl} instances for regression tests. + * @author Andreas Kirschbaum + */ +public class TestMapControlCreator { + + /** + * The {@link MapManager} instance. + */ + @NotNull + private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> mapManager; + + /** + * The pickmap {@link MapManager} instance. + */ + @NotNull + private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> pickmapManager; + + /** + * The {@link PathManager} instance. + */ + @NotNull + private final PathManager pathManager; + + /** + * The {@link ExitMatcher} instance. + */ + @NotNull + private final ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype> exitMatcher; + + /** + * The {@link MapReaderFactory} instance. + */ + @NotNull + private final MapReaderFactory<TestGameObject, TestMapArchObject> mapReaderFactory; + + /** + * The {@link GlobalSettings} instance. + */ + @NotNull + private final GlobalSettings globalSettings; + + /** + * The {@link MapArchObjectFactory} instance. + */ + @NotNull + private final MapArchObjectFactory<TestMapArchObject> mapArchObjectFactory = new TestMapArchObjectFactory(); + + /** + * The {@link FileControl} instance. + */ + @NotNull + private final FileControl<TestGameObject, TestMapArchObject, TestArchetype> fileControl = new TestFileControl(); + + /** + * The {@link MapModelFactory} instance. + */ + @NotNull + private final MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype> mapModelFactory; + + /** + * The {@link MapControlFactory} instance. + */ + @NotNull + private final MapControlFactory<TestGameObject, TestMapArchObject, TestArchetype> mapControlFactory; + + /** + * The {@link TestMapModelCreator} instance. + */ + @NotNull + private final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + + /** + * Creates a new instance. + */ + public TestMapControlCreator() { + final GameObjectMatcher exitGameObjectMatcher = new TypeNrsGameObjectMatcher(TestMapModelHelper.EXIT_TYPE); + exitMatcher = new ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype>(exitGameObjectMatcher); + final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); + final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser = mapModelCreator.newGameObjectParser(); + mapReaderFactory = new TestMapReaderFactory(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapModelCreator.getMapViewSettings()); + globalSettings = new TestGlobalSettings(); + final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); + final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); + pathManager = new PathManager(globalSettings); + mapModelFactory = new MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype>(archetypeChooserModel, mapModelCreator.getAutojoinLists(), mapModelCreator.getMapViewSettings(), mapModelCreator.getGameObjectFactory(), mapModelCreator.getGameObjectMatchers(), mapModelCreator.getTopmostInsertionMode()); + mapControlFactory = new TestMapControlFactory(mapWriter, globalSettings, mapModelFactory); + final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); + tmpMapManager.setFileControl(fileControl); + mapManager = tmpMapManager; + final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpPickmapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); + tmpPickmapManager.setFileControl(fileControl); + pickmapManager = tmpPickmapManager; + } + + /** + * Creates a new {@link TestMapModelHelper} instance. + * @return the new instance + * @throws DuplicateArchetypeException if an internal error occurs + */ + public TestMapModelHelper newMapModelCreator() throws DuplicateArchetypeException { + return mapModelCreator.newTestMapModelHelper(); + } + + /** + * Creates a new map control. + * @param mapFile the map file + * @param mapName the map name + * @param mapSize the map size + * @return the map control + */ + public MapControl<TestGameObject, TestMapArchObject, TestArchetype> newMapControl(@Nullable final File mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize) { + final TestMapArchObject mapArchObject = mapArchObjectFactory.newMapArchObject(false); + mapArchObject.setMapSize(mapSize); + mapArchObject.setMapName(mapName); + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = mapManager.newMap(null, mapArchObject, mapFile, true); + return mapControl; + } + + /** + * Returns the {@link PathManager}. + * @return the path manager + */ + @NotNull + public PathManager getPathManager() { + return pathManager; + } + + /** + * Returns the {@link GlobalSettings}. + * @return the global settings + */ + @NotNull + public GlobalSettings getGlobalSettings() { + return globalSettings; + } + + /** + * Returns the {@link ExitMatcher}. + * @return the exit matcher + */ + @NotNull + public ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype> getExitMatcher() { + return exitMatcher; + } + + /** + * Returns the {@link ArchetypeSet}. + * @return the archetype set + */ + @NotNull + public ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> getArchetypeSet() { + return mapModelCreator.getArchetypeSet(); + } + + /** + * Returns the {@link MapManager}. + * @return the map manager + */ + @NotNull + public MapManager<TestGameObject, TestMapArchObject, TestArchetype> getMapManager() { + return mapManager; + } + + /** + * Returns the {@link InsertionModeSet}. + * @return the insertion mode set + */ + @NotNull + public InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype> getInsertionModeSet() { + return mapModelCreator.getInsertionModeSet(); + } + + /** + * Returns the {@link FileControl} instance. + * @return the file control instance + */ + @NotNull + public FileControl<TestGameObject, TestMapArchObject, TestArchetype> getFileControl() { + return fileControl; + } + + /** + * Returns a new {@link AutojoinListsHelper} instance. + * @return the autojoin lists helper instance + */ + @NotNull + public AutojoinListsHelper newAutojoinListsHelper() { + return new AutojoinListsHelper(mapModelCreator); + } + + /** + * Returns the {@link TestMapModelCreator} instance. + * @return the test map model creator instance + */ + @NotNull + public TestMapModelCreator getMapModelCreator() { + return mapModelCreator; + } + + /** + * Returns a new {@link MapManager} instance. + * @return the map manager instance + */ + @NotNull + public MapManager<TestGameObject, TestMapArchObject, TestArchetype> newMapManager() { + return new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); + } + + /** + * Returns the {@link MapArchObjectFactory} instance. + * @return the test map arch object factory instance + */ + @NotNull + public MapArchObjectFactory<TestMapArchObject> getMapArchObjectFactory() { + return mapArchObjectFactory; + } + + /** + * Returns the {@link MapModelFactory} instance. + * @return the test map model factory instance + */ + @NotNull + public MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype> getMapModelFactory() { + return mapModelFactory; + } + + /** + * Returns the {@link MapManager pickmap manager} instance. + * @return the test pickmap manager instance + */ + @NotNull + public MapManager<TestGameObject, TestMapArchObject, TestArchetype> getPickmapManager() { + return pickmapManager; + } + +} // class TestMapControlCreator Property changes on: trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java (from rev 8775, trunk/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -0,0 +1,97 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.mapmanager; + +import java.awt.Point; +import java.io.File; +import java.io.IOException; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; +import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; +import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.TestMapModelHelper; +import net.sf.gridarta.utils.Size2D; +import org.junit.Test; + +/** + * Regression tests for {@link DefaultMapManager}. + * @author Andreas Kirschbaum + */ +public class DefaultMapManagerTest { + + /** + * A map that has been resized must still be revertable. + * @throws CannotInsertGameObjectException if the test fails + * @throws DuplicateArchetypeException if the test fails + * @throws IOException if an I/O error occurs + */ + @Test + public void testRevertResizedMap() throws CannotInsertGameObjectException, DuplicateArchetypeException, IOException { + final File file = File.createTempFile("gridarta", null); + try { + final TestMapControlCreator testMapControlCreator = new TestMapControlCreator(); + final TestMapModelHelper mapModelHelper = testMapControlCreator.newMapModelCreator(); + final Size2D originalSize = new Size2D(2, 1); + final Size2D newSize = new Size2D(1, 2); + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = testMapControlCreator.newMapControl(file, "test", originalSize); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); + final MapManager<TestGameObject, TestMapArchObject, TestArchetype> mapManager = testMapControlCreator.getMapManager(); + + mapModel.beginTransaction("test"); + try { + mapModelHelper.insertFloor(mapModel, new Point(1, 0)); + } finally { + mapModel.endTransaction(); + } + mapControl.save(); + TestMapModelHelper.checkMapContents(mapModel, "|floor"); + + mapModel.beginTransaction("test"); + try { + mapModel.getMapArchObject().setMapSize(newSize); + } finally { + mapModel.endTransaction(); + } + mapModel.beginTransaction("test"); + try { + mapModelHelper.insertFloor(mapModel, new Point(0, 1)); + } finally { + mapModel.endTransaction(); + } + TestMapModelHelper.checkMapContents(mapModel, "", "floor"); + + mapModel.beginTransaction("test"); + try { + mapManager.revert(mapControl); + } finally { + mapModel.endTransaction(); + } + TestMapModelHelper.checkMapContents(mapModel, "|floor"); + } finally { + //noinspection ResultOfMethodCallIgnored + file.delete(); + } + } + +} // class DefaultMapManagerTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java (from rev 8775, trunk/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -0,0 +1,150 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.mapmanager; + +import java.io.File; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A {@link FileControl} implementation for testing purposes. + * @author Andreas Kirschbaum + */ +public class TestFileControl implements FileControl<TestGameObject, TestMapArchObject, TestArchetype> { + + /** + * Collects the performed actions. + */ + @NotNull + private final StringBuilder sb = new StringBuilder(); + + /** + * {@inheritDoc} + */ + @Override + public void editScript() { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void openFile() { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean save(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void saveAllMaps() { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean closeAllMaps() { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean saveAs(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean confirmSaveChanges(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void reportSaveError(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl, @NotNull final String message) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void reportSaveError(@NotNull final File mapFile, @NotNull final String message) { + sb.append("reportSaveError: "); + sb.append(mapFile); + sb.append(" "); + sb.append(message); + sb.append("\n"); + } + + /** + * {@inheritDoc} + */ + @Override + public void reportLoadError(@Nullable final File file, @NotNull final String message) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void reportOutOfMapBoundsDeleted(@NotNull final File file, final int outOfMapBoundsDeleted, @NotNull final StringBuilder outOfMapBoundsObjects) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public void reportOutOfMemory(@NotNull final File file) { + throw new AssertionError(); + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return sb.toString(); + } + +} // class TestFileControl Property changes on: trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/actions/UndoActionsTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -20,7 +20,6 @@ package net.sf.gridarta.actions; import java.awt.Point; -import net.sf.gridarta.gui.map.test.TestMapControlCreator; import net.sf.gridarta.gui.undo.UndoControl; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; @@ -30,6 +29,7 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; import net.sf.gridarta.model.mapmanager.MapManager; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; Modified: trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -21,7 +21,6 @@ import java.awt.Point; import java.io.File; -import net.sf.gridarta.gui.map.test.TestMapControlCreator; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.baseobject.BaseObject; @@ -31,6 +30,7 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; import net.sf.gridarta.model.mapmanager.TestFileControl; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; Modified: trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/gui/copybuffer/CopyBufferTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -23,12 +23,13 @@ import java.awt.Rectangle; import java.io.File; import net.sf.gridarta.gui.map.mapview.MapView; -import net.sf.gridarta.gui.map.test.TestMapControlCreator; +import net.sf.gridarta.gui.map.test.TestMapControlCreatorUtils; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; import net.sf.gridarta.model.mapgrid.SelectionMode; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; @@ -74,8 +75,8 @@ TestMapModelHelper.checkContents(ob1, ob2); // select + cut - final CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> copyBuffer = testMapControlCreator.newCopyBuffer(); - final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreator.newMapView(mapControl); + final CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> copyBuffer = TestMapControlCreatorUtils.newCopyBuffer(testMapControlCreator); + final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreatorUtils.newMapView(mapControl); mapView.getMapViewBasic().getMapGrid().select(new Point(1, 1), new Point(1, 1), SelectionMode.ADD); copyBuffer.cut(mapView, new Rectangle(1, 1, 1, 1)); Deleted: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -1,329 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.map.test; - -import java.awt.Image; -import java.awt.image.BufferedImage; -import java.io.File; -import net.sf.gridarta.gui.copybuffer.CopyBuffer; -import net.sf.gridarta.gui.map.mapview.MapView; -import net.sf.gridarta.gui.map.mapview.MapViewBasic; -import net.sf.gridarta.gui.map.mapview.MapViewFactory; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.map.mapview.TestMapView; -import net.sf.gridarta.gui.map.mapview.TestMapViewBasic; -import net.sf.gridarta.gui.map.mapview.TestMapViewFactory; -import net.sf.gridarta.gui.map.renderer.RendererFactory; -import net.sf.gridarta.gui.map.renderer.TestRendererFactory; -import net.sf.gridarta.gui.mapimagecache.MapImageCache; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DuplicateArchetypeException; -import net.sf.gridarta.model.archetype.TestArchetype; -import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; -import net.sf.gridarta.model.autojoin.AutojoinListsHelper; -import net.sf.gridarta.model.exitconnector.ExitMatcher; -import net.sf.gridarta.model.gameobject.TestGameObject; -import net.sf.gridarta.model.io.CacheFiles; -import net.sf.gridarta.model.io.DefaultMapWriter; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.io.MapArchObjectParserFactory; -import net.sf.gridarta.model.io.MapReaderFactory; -import net.sf.gridarta.model.io.MapWriter; -import net.sf.gridarta.model.io.PathManager; -import net.sf.gridarta.model.io.TestCacheFiles; -import net.sf.gridarta.model.io.TestMapArchObjectParserFactory; -import net.sf.gridarta.model.io.TestMapReaderFactory; -import net.sf.gridarta.model.maparchobject.MapArchObjectFactory; -import net.sf.gridarta.model.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.maparchobject.TestMapArchObjectFactory; -import net.sf.gridarta.model.mapcontrol.MapControl; -import net.sf.gridarta.model.mapcontrol.MapControlFactory; -import net.sf.gridarta.model.mapcontrol.TestMapControlFactory; -import net.sf.gridarta.model.mapmanager.AbstractMapManager; -import net.sf.gridarta.model.mapmanager.DefaultMapManager; -import net.sf.gridarta.model.mapmanager.FileControl; -import net.sf.gridarta.model.mapmanager.MapManager; -import net.sf.gridarta.model.mapmanager.TestFileControl; -import net.sf.gridarta.model.mapmodel.InsertionModeSet; -import net.sf.gridarta.model.mapmodel.MapModelFactory; -import net.sf.gridarta.model.mapmodel.TestMapModelCreator; -import net.sf.gridarta.model.mapmodel.TestMapModelHelper; -import net.sf.gridarta.model.match.GameObjectMatcher; -import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; -import net.sf.gridarta.model.settings.GlobalSettings; -import net.sf.gridarta.model.settings.TestGlobalSettings; -import net.sf.gridarta.utils.Size2D; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Helper class for creating {@link MapControl} instances for regression tests. - * @author Andreas Kirschbaum - */ -public class TestMapControlCreator { - - /** - * The {@link MapManager} instance. - */ - @NotNull - private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> mapManager; - - /** - * The pickmap {@link MapManager} instance. - */ - @NotNull - private final MapManager<TestGameObject, TestMapArchObject, TestArchetype> pickmapManager; - - /** - * The {@link PathManager} instance. - */ - @NotNull - private final PathManager pathManager; - - /** - * The {@link ExitMatcher} instance. - */ - @NotNull - private final ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype> exitMatcher; - - /** - * The {@link MapReaderFactory} instance. - */ - @NotNull - private final MapReaderFactory<TestGameObject, TestMapArchObject> mapReaderFactory; - - /** - * The {@link GlobalSettings} instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - /** - * The {@link MapArchObjectFactory} instance. - */ - @NotNull - private final MapArchObjectFactory<TestMapArchObject> mapArchObjectFactory = new TestMapArchObjectFactory(); - - /** - * The {@link FileControl} instance. - */ - @NotNull - private final FileControl<TestGameObject, TestMapArchObject, TestArchetype> fileControl = new TestFileControl(); - - /** - * The {@link MapModelFactory} instance. - */ - @NotNull - private final MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype> mapModelFactory; - - /** - * The {@link MapControlFactory} instance. - */ - @NotNull - private final MapControlFactory<TestGameObject, TestMapArchObject, TestArchetype> mapControlFactory; - - /** - * The {@link TestMapModelCreator} instance. - */ - @NotNull - private final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); - - /** - * Creates a new instance. - */ - public TestMapControlCreator() { - final GameObjectMatcher exitGameObjectMatcher = new TypeNrsGameObjectMatcher(TestMapModelHelper.EXIT_TYPE); - exitMatcher = new ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype>(exitGameObjectMatcher); - final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); - final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser = mapModelCreator.newGameObjectParser(); - mapReaderFactory = new TestMapReaderFactory(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapModelCreator.getMapViewSettings()); - globalSettings = new TestGlobalSettings(); - final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); - final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); - pathManager = new PathManager(globalSettings); - mapModelFactory = new MapModelFactory<TestGameObject, TestMapArchObject, TestArchetype>(archetypeChooserModel, mapModelCreator.getAutojoinLists(), mapModelCreator.getMapViewSettings(), mapModelCreator.getGameObjectFactory(), mapModelCreator.getGameObjectMatchers(), mapModelCreator.getTopmostInsertionMode()); - mapControlFactory = new TestMapControlFactory(mapWriter, globalSettings, mapModelFactory); - final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpMapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); - tmpMapManager.setFileControl(fileControl); - mapManager = tmpMapManager; - final AbstractMapManager<TestGameObject, TestMapArchObject, TestArchetype> tmpPickmapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); - tmpPickmapManager.setFileControl(fileControl); - pickmapManager = tmpPickmapManager; - } - - /** - * Creates a new {@link TestMapModelHelper} instance. - * @return the new instance - * @throws DuplicateArchetypeException if an internal error occurs - */ - public TestMapModelHelper newMapModelCreator() throws DuplicateArchetypeException { - return mapModelCreator.newTestMapModelHelper(); - } - - /** - * Creates a new map control. - * @param mapFile the map file - * @param mapName the map name - * @param mapSize the map size - * @return the map control - */ - public MapControl<TestGameObject, TestMapArchObject, TestArchetype> newMapControl(@Nullable final File mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize) { - final TestMapArchObject mapArchObject = mapArchObjectFactory.newMapArchObject(false); - mapArchObject.setMapSize(mapSize); - mapArchObject.setMapName(mapName); - final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = mapManager.newMap(null, mapArchObject, mapFile, true); - return mapControl; - } - - /** - * Returns the {@link PathManager}. - * @return the path manager - */ - @NotNull - public PathManager getPathManager() { - return pathManager; - } - - /** - * Returns the {@link GlobalSettings}. - * @return the global settings - */ - @NotNull - public GlobalSettings getGlobalSettings() { - return globalSettings; - } - - /** - * Returns the {@link ExitMatcher}. - * @return the exit matcher - */ - @NotNull - public ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype> getExitMatcher() { - return exitMatcher; - } - - /** - * Returns the {@link ArchetypeSet}. - * @return the archetype set - */ - @NotNull - public ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> getArchetypeSet() { - return mapModelCreator.getArchetypeSet(); - } - - /** - * Returns the {@link MapManager}. - * @return the map manager - */ - @NotNull - public MapManager<TestGameObject, TestMapArchObject, TestArchetype> getMapManager() { - return mapManager; - } - - /** - * Returns the {@link InsertionModeSet}. - * @return the insertion mode set - */ - @NotNull - public InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype> getInsertionModeSet() { - return mapModelCreator.getInsertionModeSet(); - } - - /** - * Creates a new {@link MapView} instance. - * @param mapControl the associated map control - * @return the map view instance - */ - @NotNull - public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { - final MapViewBasic<TestGameObject, TestMapArchObject, TestArchetype> mapViewBasic = new TestMapViewBasic(mapControl.getMapModel()); - final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = new TestMapView(mapControl, mapViewBasic); - return mapView; - } - - /** - * Returns a new {@link CopyBuffer} instance. - * @return the copy buffer instance - */ - @NotNull - public CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> newCopyBuffer() { - return new CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype>(mapModelCreator.getMapViewSettings(), mapModelCreator.getGameObjectFactory(), mapArchObjectFactory, mapModelFactory, mapModelCreator.getInsertionModeSet()); - } - - /** - * Creates a new {@link MapViewsManager} instance. - * @return the map views manager instance - */ - @NotNull - public MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> newMapViewsManager() { - final MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> mapViewFactory = new TestMapViewFactory(); - return new MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype>(mapModelCreator.getMapViewSettings(), mapViewFactory, mapManager, pickmapManager); - } - - /** - * Creates a new {@link MapImageCache} instance. - * @return the map image cache instance - */ - @NotNull - public MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> newMapImageCache() { - final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory = new TestRendererFactory(); - final Image defaultIcon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); - final Image defaultPreview = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); - final CacheFiles cacheFiles = new TestCacheFiles(); - return new MapImageCache<TestGameObject, TestMapArchObject, TestArchetype>(mapManager, defaultIcon, defaultPreview, rendererFactory, cacheFiles); - } - - /** - * Returns the {@link FileControl} instance. - * @return the file control instance - */ - @NotNull - public FileControl<TestGameObject, TestMapArchObject, TestArchetype> getFileControl() { - return fileControl; - } - - /** - * Returns a new {@link AutojoinListsHelper} instance. - * @return the autojoin lists helper instance - */ - @NotNull - public AutojoinListsHelper newAutojoinListsHelper() { - return new AutojoinListsHelper(mapModelCreator); - } - - /** - * Returns the {@link TestMapModelCreator} instance. - * @return the test map model creator instance - */ - @NotNull - public TestMapModelCreator getMapModelCreator() { - return mapModelCreator; - } - - /** - * Returns a new {@link MapManager} instance. - * @return the map manager instance - */ - @NotNull - public MapManager<TestGameObject, TestMapArchObject, TestArchetype> newMapManager() { - return new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype>(mapReaderFactory, mapControlFactory, globalSettings, mapModelCreator.getFaceObjectProviders()); - } - -} // class TestMapControlCreator Copied: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java (from rev 8775, trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreator.java) =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java (rev 0) +++ trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -0,0 +1,105 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.map.test; + +import java.awt.Image; +import java.awt.image.BufferedImage; +import net.sf.gridarta.gui.copybuffer.CopyBuffer; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewBasic; +import net.sf.gridarta.gui.map.mapview.MapViewFactory; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.map.mapview.TestMapView; +import net.sf.gridarta.gui.map.mapview.TestMapViewBasic; +import net.sf.gridarta.gui.map.mapview.TestMapViewFactory; +import net.sf.gridarta.gui.map.renderer.RendererFactory; +import net.sf.gridarta.gui.map.renderer.TestRendererFactory; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.io.CacheFiles; +import net.sf.gridarta.model.io.TestCacheFiles; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; +import net.sf.gridarta.model.mapmodel.TestMapModelCreator; +import org.jetbrains.annotations.NotNull; + +/** + * Helper class for creating {@link MapControl} instances for regression tests. + * @author Andreas Kirschbaum + */ +public class TestMapControlCreatorUtils { + + /** + * Private constructor to prevent instantiation. + */ + private TestMapControlCreatorUtils() { + } + + /** + * Creates a new {@link MapView} instance. + * @param mapControl the associated map control + * @return the map view instance + */ + @NotNull + public static MapView<TestGameObject, TestMapArchObject, TestArchetype> newMapView(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { + final MapViewBasic<TestGameObject, TestMapArchObject, TestArchetype> mapViewBasic = new TestMapViewBasic(mapControl.getMapModel()); + final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = new TestMapView(mapControl, mapViewBasic); + return mapView; + } + + /** + * Returns a new {@link CopyBuffer} instance. + * @param mapControlCreator the map control creator + * @return the copy buffer instance + */ + @NotNull + public static CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype> newCopyBuffer(@NotNull final TestMapControlCreator mapControlCreator) { + final TestMapModelCreator mapModelCreator = mapControlCreator.getMapModelCreator(); + return new CopyBuffer<TestGameObject, TestMapArchObject, TestArchetype>(mapModelCreator.getMapViewSettings(), mapModelCreator.getGameObjectFactory(), mapControlCreator.getMapArchObjectFactory(), mapControlCreator.getMapModelFactory(), mapModelCreator.getInsertionModeSet()); + } + + /** + * Creates a new {@link MapViewsManager} instance. + * @param mapControlCreator the map control creator + * @return the map views manager instance + */ + @NotNull + public static MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> newMapViewsManager(@NotNull final TestMapControlCreator mapControlCreator) { + final MapViewFactory<TestGameObject, TestMapArchObject, TestArchetype> mapViewFactory = new TestMapViewFactory(); + return new MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype>(mapControlCreator.getMapModelCreator().getMapViewSettings(), mapViewFactory, mapControlCreator.getMapManager(), mapControlCreator.getPickmapManager()); + } + + /** + * Creates a new {@link MapImageCache} instance. + * @param mapControlCreator the map control creator + * @return the map image cache instance + */ + @NotNull + public static MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> newMapImageCache(@NotNull final TestMapControlCreator mapControlCreator) { + final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory = new TestRendererFactory(); + final Image defaultIcon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + final Image defaultPreview = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + final CacheFiles cacheFiles = new TestCacheFiles(); + return new MapImageCache<TestGameObject, TestMapArchObject, TestArchetype>(mapControlCreator.getMapManager(), defaultIcon, defaultPreview, rendererFactory, cacheFiles); + } + +} // class TestMapControlCreatorUtils Property changes on: trunk/src/test/net/sf/gridarta/gui/map/test/TestMapControlCreatorUtils.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/gui/mapmenu/MapMenuManagerTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -23,13 +23,14 @@ import java.io.File; import java.io.IOException; import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.map.test.TestMapControlCreator; +import net.sf.gridarta.gui.map.test.TestMapControlCreatorUtils; import net.sf.gridarta.gui.mapimagecache.MapImageCache; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; import org.junit.Assert; @@ -54,8 +55,8 @@ } final TestMapControlCreator testMapControlCreator = new TestMapControlCreator(); - final MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> mapViewsManager = testMapControlCreator.newMapViewsManager(); - final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> mapImageCache = testMapControlCreator.newMapImageCache(); + final MapViewsManager<TestGameObject, TestMapArchObject, TestArchetype> mapViewsManager = TestMapControlCreatorUtils.newMapViewsManager(testMapControlCreator); + final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype> mapImageCache = TestMapControlCreatorUtils.newMapImageCache(testMapControlCreator); final MapMenuPreferences<TestGameObject, TestMapArchObject, TestArchetype> mapMenuPreferences = new AbstractMapMenuPreferences<TestGameObject, TestMapArchObject, TestArchetype>(mapViewsManager, testMapControlCreator.getGlobalSettings(), mapImageCache, testMapControlCreator.getFileControl()) { /** Modified: trunk/src/test/net/sf/gridarta/gui/selectedsquare/SelectedSquareActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/selectedsquare/SelectedSquareActionsTest.java 2010-11-08 21:53:04 UTC (rev 8775) +++ trunk/src/test/net/sf/gridarta/gui/selectedsquare/SelectedSquareActionsTest.java 2010-11-09 18:43:21 UTC (rev 8776) @@ -22,12 +22,13 @@ import java.awt.Point; import java.io.File; import net.sf.gridarta.gui.map.mapview.MapView; -import net.sf.gridarta.gui.map.test.TestMapControlCreator; +import net.sf.gridarta.gui.map.test.TestMapControlCreatorUtils; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.MapSquare; @@ -1023,7 +1024,7 @@ @NotNull private static SelectedSquareModel<TestGameObject, TestMapArchObject, TestArchetype> newSelectedSquareModel(@NotNull final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl) { final SelectedSquareModel<TestGameObject, TestMapArchObject, TestArchetype> selectedSquareModel = new SelectedSquareModel<TestGameObject, TestMapArchObject, TestArchetype>(); - final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreator.newMapView(mapControl); + final MapView<TestGameObject, TestMapArchObject, TestArchetype> mapView = TestMapControlCreatorUtils.newMapView(mapControl); selectedSquareModel.setSelectedMapSquare(new MapSquareSelection<TestGameObject, TestMapArchObject, TestArchetype>(mapView)); return selectedSquareModel; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-09 22:57:06
|
Revision: 8777 http://gridarta.svn.sourceforge.net/gridarta/?rev=8777&view=rev Author: akirschbaum Date: 2010-11-09 22:57:00 +0000 (Tue, 09 Nov 2010) Log Message: ----------- Add GlobalSettingsListener.mapsDirectoryChanged(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/settings/AbstractGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettingsListener.java trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java Modified: trunk/model/src/app/net/sf/gridarta/model/settings/AbstractGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/AbstractGlobalSettings.java 2010-11-09 18:43:21 UTC (rev 8776) +++ trunk/model/src/app/net/sf/gridarta/model/settings/AbstractGlobalSettings.java 2010-11-09 22:57:00 UTC (rev 8777) @@ -19,6 +19,7 @@ package net.sf.gridarta.model.settings; +import java.io.File; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; @@ -60,4 +61,14 @@ } } + /** + * Notifies all listeners about a changed maps directory. + */ + protected void fireMapsDirectoryChanged() { + final File mapsDirectory = getMapsDirectory(); + for (final GlobalSettingsListener listener : listenerList.getListeners()) { + listener.mapsDirectoryChanged(mapsDirectory); + } + } + } // class AbstractGlobalSettings Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2010-11-09 18:43:21 UTC (rev 8776) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2010-11-09 22:57:00 UTC (rev 8777) @@ -213,7 +213,7 @@ } else if (evt.getKey().equals(ARCH_DIRECTORY_KEY)) { archDirectory = new File(preferences.get(ARCH_DIRECTORY_KEY, archDirectoryDefault)); } else if (evt.getKey().equals(MAP_DIRECTORY_KEY)) { - mapsDirectory = new File(preferences.get(MAP_DIRECTORY_KEY, mapsDirectoryDefault)); + setMapsDirectoryInt(new File(preferences.get(MAP_DIRECTORY_KEY, mapsDirectoryDefault)), false); } else if (evt.getKey().equals(MEDIA_DIRECTORY_KEY)) { mediaDirectory = new File(preferences.get(MEDIA_DIRECTORY_KEY, mediaDirectoryDefault)); } else if (evt.getKey().equals(IMAGE_SET_KEY)) { @@ -295,12 +295,24 @@ */ @Override public void setMapsDirectory(@NotNull final File mapsDirectory) { + setMapsDirectoryInt(mapsDirectory, true); + } + + /** + * Sets the {@link #mapsDirectory}. + * @param mapsDirectory the new maps directory + * @param updatePreferences whether the preferences should be updated + */ + private void setMapsDirectoryInt(@NotNull final File mapsDirectory, final boolean updatePreferences) { if (this.mapsDirectory.equals(mapsDirectory)) { return; } this.mapsDirectory = mapsDirectory; - preferences.put(MAP_DIRECTORY_KEY, mapsDirectory.toString()); + if (updatePreferences) { + preferences.put(MAP_DIRECTORY_KEY, mapsDirectory.toString()); + } + fireMapsDirectoryChanged(); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettingsListener.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettingsListener.java 2010-11-09 18:43:21 UTC (rev 8776) +++ trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettingsListener.java 2010-11-09 22:57:00 UTC (rev 8777) @@ -19,7 +19,9 @@ package net.sf.gridarta.model.settings; +import java.io.File; import java.util.EventListener; +import org.jetbrains.annotations.NotNull; /** * Interface for listeners interested in {@link GlobalSettings} events. @@ -33,4 +35,10 @@ */ void showMainToolbarChanged(boolean visible); + /** + * Called whenever the maps directory has changed. + * @param mapsDirectory the maps directory + */ + void mapsDirectoryChanged(@NotNull File mapsDirectory); + } // interface GlobalSettingsListener Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java 2010-11-09 18:43:21 UTC (rev 8776) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java 2010-11-09 22:57:00 UTC (rev 8777) @@ -20,6 +20,7 @@ package net.sf.gridarta.gui.misc; import java.awt.Component; +import java.io.File; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.model.settings.GlobalSettingsListener; import net.sf.japi.swing.action.ActionBuilder; @@ -53,6 +54,11 @@ toolbar.setVisible(visible); } + @Override + public void mapsDirectoryChanged(@NotNull final File mapsDirectory) { + // ignore + } + }; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-10 10:14:19
|
Revision: 8779 http://gridarta.svn.sourceforge.net/gridarta/?rev=8779&view=rev Author: akirschbaum Date: 2010-11-10 10:14:12 +0000 (Wed, 10 Nov 2010) Log Message: ----------- Add nullable annotations. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java 2010-11-09 23:22:38 UTC (rev 8778) +++ trunk/src/app/net/sf/gridarta/gui/utils/SwingUtils.java 2010-11-10 10:14:12 UTC (rev 8779) @@ -54,6 +54,7 @@ * @param component the component this label is attached to * @return the label */ + @NotNull public static Component createLabel(@NotNull final String key, @Nullable final Component component) { final JComponent label = component == null ? ACTION_BUILDER.createLabel(key + ".text") : ACTION_BUILDER.createLabel(component, key + ".text"); label.setToolTipText(ActionBuilderUtils.getString(ACTION_BUILDER, key + ".shortdescription")); Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2010-11-09 23:22:38 UTC (rev 8778) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java 2010-11-10 10:14:12 UTC (rev 8779) @@ -53,24 +53,30 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ScriptEditControl.class); /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); // last active popup is stored here + @Nullable private static CFPythonPopup activePopup = null; + @NotNull private final ScriptEditView view; // view (window with text areas) + @NotNull private final List<String> tabs; // open tabs, contains absolute filenames (or "<>") in order left to right /** * JFileChooser for opening script files. */ + @NotNull private final JFileChooser openFileChooser; @NotNull @@ -97,7 +103,7 @@ * popup will be closed (if still open). * @param activePopup active popup to register */ - public static void registerActivePopup(final CFPythonPopup activePopup) { + public static void registerActivePopup(@NotNull final CFPythonPopup activePopup) { ScriptEditControl.activePopup = activePopup; } @@ -113,7 +119,7 @@ /** * Open a new empty script document. */ - public void openScriptFile(final String pathName) { + public void openScriptFile(@NotNull final String pathName) { final File file = new File(pathName); if (!file.exists() || !file.isFile()) { @@ -134,7 +140,8 @@ * be ignored if invalid * @return the file chooser */ - private JFileChooser createOpenFileChooser(final File defaultScriptDir) { + @NotNull + private JFileChooser createOpenFileChooser(@NotNull final File defaultScriptDir) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setMultiSelectionEnabled(false); @@ -298,7 +305,7 @@ * @return <code>true</code> if the file was saved, or <code>false</code> if * an error occurred */ - public boolean saveTextToFile(final File file, final String text) { + public boolean saveTextToFile(@NotNull final File file, @NotNull final String text) { try { final FileOutputStream fos = new FileOutputStream(file); try { @@ -333,7 +340,7 @@ */ @Nullable String getActiveFilePath() { - if (view == null || tabs == null || view.getSelectedIndex() < 0 || tabs.size() <= 0) { + if (view.getSelectedIndex() < 0 || tabs.size() <= 0) { return null; } Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2010-11-09 23:22:38 UTC (rev 8778) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2010-11-10 10:14:12 UTC (rev 8779) @@ -61,11 +61,13 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(ScriptEditView.class); /** * Action Builder. */ + @NotNull private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** @@ -89,36 +91,44 @@ * The key used to store the editor window x-coordinate in preferences * file. */ + @NotNull private static final String WINDOW_X = "ScriptEditWindow.x"; /** * The key used to store the editor window y-coordinate in preferences * file. */ + @NotNull private static final String WINDOW_Y = "ScriptEditWindow.y"; /** * The key used to store the editor window width in preferences file. */ + @NotNull private static final String WINDOW_WIDTH = "ScriptEditWindow.width"; /** * The key used to store the editor window height in preferences file. */ + @NotNull private static final String WINDOW_HEIGHT = "ScriptEditWindow.height"; /** * The actions for the script editor. */ + @NotNull private final Actions actions; /** * The undo related actions for the script editor. */ + @NotNull private final ScriptEditUndoActions scriptEditUndoActions; + @NotNull private final JTabbedPane tabPane; // tab pane + @NotNull private final List<JEditTextArea> textAreas; // list of 'JEditTextArea' objects, same order as tabs /** @@ -127,7 +137,7 @@ * @param preferences the preferences to use * @param exiter the exiter instance */ - public ScriptEditView(final ScriptEditControl control, @NotNull final Frame owner, @NotNull final Preferences preferences, @NotNull final Exiter exiter) { + public ScriptEditView(@NotNull final ScriptEditControl control, @NotNull final Frame owner, @NotNull final Preferences preferences, @NotNull final Exiter exiter) { super(owner, "Script Pad"); this.preferences = preferences; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); @@ -195,7 +205,7 @@ * @param title title of this script (filename) * @param file file where this script is stored, null if new script opened */ - public void addTab(final String title, @Nullable final File file) { + public void addTab(@NotNull final String title, @Nullable final File file) { final JEditTextArea ta = new JEditTextArea(textAreaDefaults); // open new TextArea //ta.setFont(new Font("Courier New", Font.PLAIN, 12)); final SyntaxDocument syntaxDocument = new SyntaxDocument(); @@ -320,7 +330,7 @@ * @param index index of the tab to change title * @param title new title string */ - public void setTitleAt(final int index, final String title) { + public void setTitleAt(final int index, @NotNull final String title) { tabPane.setTitleAt(index, title); } @@ -342,7 +352,7 @@ * @param message the message to be shown * @return true if the user agrees, false if user disagrees */ - public boolean askConfirm(final String title, final String message) { + public boolean askConfirm(@NotNull final String title, @NotNull final String message) { return JOptionPane.showConfirmDialog(this, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION; } @@ -353,11 +363,11 @@ * @param messageType type of message (see JOptionPane constants), defines * icon used */ - public void showMessage(final String title, final String message, final int messageType) { + public void showMessage(@NotNull final String title, @NotNull final String message, final int messageType) { JOptionPane.showMessageDialog(this, message, title, messageType); } - public void showMessage(final String title, final String message) { + public void showMessage(@NotNull final String title, @NotNull final String message) { JOptionPane.showMessageDialog(this, message, title, JOptionPane.INFORMATION_MESSAGE); } @@ -366,17 +376,18 @@ */ private class EditTabListener implements ChangeListener { + @NotNull private final ScriptEditView view; // view private int index; // index of selected tab - private EditTabListener(final ScriptEditView view) { + private EditTabListener(@NotNull final ScriptEditView view) { this.view = view; index = view.getSelectedIndex(); } @Override - public void stateChanged(final ChangeEvent e) { + public void stateChanged(@NotNull final ChangeEvent e) { if (index != view.getSelectedIndex()) { index = view.getSelectedIndex(); // active selected tab has changed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-13 18:06:45
|
Revision: 8784 http://gridarta.svn.sourceforge.net/gridarta/?rev=8784&view=rev Author: akirschbaum Date: 2010-11-13 18:06:38 +0000 (Sat, 13 Nov 2010) Log Message: ----------- Remove outdated build files. Removed Paths: ------------- trunk/atrinik/build.xml trunk/crossfire/build.xml trunk/daimonin/build.xml Property Changed: ---------------- trunk/atrinik/ trunk/crossfire/ trunk/daimonin/ Property changes on: trunk/atrinik ___________________________________________________________________ Modified: svn:ignore - AtrinikEditor.jar build.properties class classes developer.properties tags update.properties + developer.properties update.properties Deleted: trunk/atrinik/build.xml =================================================================== --- trunk/atrinik/build.xml 2010-11-13 17:59:16 UTC (rev 8783) +++ trunk/atrinik/build.xml 2010-11-13 18:06:38 UTC (rev 8784) @@ -1,256 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. - ~ - ~ This program is free software; you can redistribute it and/or modify - ~ it under the terms of the GNU General Public License as published by - ~ the Free Software Foundation; either version 2 of the License, or - ~ (at your option) any later version. - ~ - ~ This program is distributed in the hope that it will be useful, - ~ but WITHOUT ANY WARRANTY; without even the implied warranty of - ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ~ GNU General Public License for more details. - ~ - ~ You should have received a copy of the GNU General Public License along - ~ with this program; if not, write to the Free Software Foundation, Inc., - ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - --> - -<!-- - - This is the Ant buildfile for the Gridarta Editor for Atrinik - - - - Apache Ant is a Java-based cross-platform build tool. - - For more information about Ant, visit <http://ant.apache.org/> - - - - Do not move, edit or delete this file. It should stay in the - - main directory of the Atrinik Editor. - - - - How to use Ant for the Atrinik Editor: - - - - o Install Ant on your system. Make sure both the JAVA_HOME - - and ANT_HOME environment variables are set correctly. - - - - o Change into the Atrinik Editor main directory. - - run "ant" to compile, - - run "ant run" to run the editor. - --> -<project name="Gridarta Editor for Atrinik" default="jar"> - - <!-- set properties and clean build directory --> - <target name="init"> - <property name="package" value="net.sf.gridarta.var.atrinik.maincontrol"/> - <property name="targetName" value="Atrinik"/> - <property file="developer.properties"/> - <property name="src.dir" value="src/app"/> - <property name="lib.dir" value="lib"/> - <property name="devlib.dir" value="devlib/"/> - <!-- Don't forget trailing / ! --> - <property name="test.dir" value="test"/> - <property name="resource.dir" value="resource"/> - <property name="arch.dir" value="../arch"/> - <property name="build.dir.production" value="class/production"/> - <property name="jarname" value="${targetName}Editor.jar"/> - <property name="build.source.version" value="1.5"/> - <property name="build.target.version" value="${build.source.version}"/> - <property name="build.source.encoding" value="utf-8"/> - <property name="checkstyle.path" value="${devlib.dir}checkstyle-all-3.5.jar"/> - <property name="checkstyle.conv" value="${devlib.dir}checkstyle_checks.xml"/> - <property name="todo.file" value="todo.txt"/> - <property name="debug" value="false"/> - <property name="user.ftp.depends" value="yes"/> - <property name="user.ftp.passive" value="yes"/> - <property name="user.ftp.ignoreNoncriticalErrors" value="yes"/> - <property name="build.developer" value="unknown"/> - <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> - <property name="javac.fork" value="no"/> - <tstamp> - <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> - </tstamp> - <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> - <property name="build.svnversion" value="unknown"/> - <property name="build.version" value="Gridzilla"/> - <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> - <echoproperties destfile="build.properties"> - <propertyset negate="true"> - <propertyref prefix="user.ftp"/> - <propertyref prefix="user.scp"/> - </propertyset> - </echoproperties> - </target> - - <!-- create ctags. --> - <target name="ctags" if="user.ctags" depends="init" description="creates tags file with symbol definitions for vim and other editors."> - <exec executable="ctags"> - <arg line="-R ${src.dir}"/> - </exec> - </target> - - <!-- delete and recreate the build directory --> - <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir.production}"/> - <mkdir dir="${build.dir.production}"/> - </target> - - <!-- compiling all Java classes --> - <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar"/> - <fileset dir="../lib/" includes="*.jar"/> - </classpath> - <compilerarg line="${javac.args}"/> - </javac> - </target> - - <!-- create JAR file --> - <target name="jar" depends="compile" description="compiles source and creates jar."> - <!-- copy the resource files into the build dir --> - <copy todir="${build.dir.production}"> - <fileset dir="${resource.dir}"> - <include name="icons/**/*.*"/> - <include name="resource/**"/> - <include name="system/**/*.*"/> - <exclude name="**/.xvpics/**"/> - </fileset> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="${src.dir}" includes="**/*.properties"/> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="../resource"> - <include name="icons/**/*.*"/> - <include name="log4j.properties"/> - <include name="system/**/*.*"/> - <include name="toolbarButtonGraphics/**/*.*"/> - </fileset> - </copy> - <!--copy file="${arch.dir}/archetypes" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/atrinik.0" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/treasures" todir="${build.dir.production}" /--> - <delete dir="${build.dir.production}/customize"/> - - <jar destfile="${jarname}" index="true"> - <!-- pack everything into the jar file --> - <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> - <fileset file="build.properties"/> - <fileset file="../COPYING"/> - <fileset dir="${lib.dir}"> - <include name="*-LICENSE"/> - </fileset> - <fileset dir="../lib"> - <include name="bsh-LICENSE"/> - <include name="java-getopt-1.0.13"/> - <include name="japi.jar-LICENSE"/> - <include name="log4j-1.2.13.jar-LICENSE"/> - <include name="jdom.jar-LICENSE"/> - <include name="java-getopt-1.0.13.jar-LICENSE"/> - </fileset> - <zipfileset src="../lib/log4j-1.2.13.jar"/> - <zipfileset src="../lib/java-getopt-1.0.13.jar"/> - <zipfileset src="../lib/jdom.jar"/> - <zipfileset src="../lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> - <zipgroupfileset dir="../lib/" includes="japi-*.jar"/> - <!-- creating the manifest --> - <manifest> - <attribute name="Main-Class" value="${package}.AtrinikEditor"/> - <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> - </manifest> - </jar> - - <!-- delete the build directory --> - <delete dir="${build.dir.production}"/> - </target> - - <!-- run the jar file with default memory (64 Mb on most systems) --> - <target name="run" depends="init" description="runs editor."> - <java jar="${jarname}" fork="true" failonerror="true"/> - </target> - - <!-- run the jar file with extra memory (128 Mb) --> - <target name="run_high" depends="init" description="runs editor with extra memory (128m)."> - <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m"/> - </target> - - <!-- Create API documentation. --> - <target name="doc" depends="init" description="creates JavaDoc documentation for editor source."> - <mkdir dir="javadoc"/> - <javadoc destdir="javadoc" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="${targetName} Editor — API Documentation" doctitle="${targetName} Editor<br />API Documentation" header="${targetName} Editor<br />API Documentation" footer="${targetName} Editor<br />API Documentation" bottom="<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn="yes" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/${package}/overview.html" link="${user.javadoc.link}"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE"/> - <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE"/> - </classpath> - <sourcepath path="${src.dir}"/> - <packageset dir="src" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <tag name="todo" description="Todo:"/> - <tag name="used" description="Manually marked as used." enabled="false"/> - <tag name="fixme" description="Fixme:"/> - <tag name="xxx" description="XXX:"/> - <tag name="note" description="Note:"/> - <tag name="devs" description="At Developers:"/> - </javadoc> - </target> - - <!-- Check the source style. - - @see http://checkstyle.sf.net/ - --> - <target name="checkstyle" depends="init" description="performs style checks for source."> - <taskdef resource="checkstyletask.properties" classpath="${checkstyle.path}"/> - <mkdir dir="${test.dir}"/> - <checkstyle config="${checkstyle.conv}"> - <fileset dir="${src.dir}" includes="**/*.java"/> - <formatter type="plain"/> - <formatter type="xml" toFile="${test.dir}/checkstyle_errors.xml"/> - </checkstyle> - </target> - - <!-- Prints a todo list. - - Useful e.g. to parse the list from within vi and jump from todo change to todo change. - --> - <target name="todo" depends="init" description="prints a file with todo information"> - <concat> - <fileset file="${todo.file}"/> - </concat> - </target> - - <target name="preparePublish" description="preparse files to publish" depends="jar"> - <property name="update.number" value="${build.number}"/> - <property name="update.tstamp" value="${build.tstamp}"/> - <property name="update.developer" value="${build.developer}"/> - <property name="update.url" value="${user.update.url}"/> - <echoproperties destfile="update.properties"> - <propertyset> - <propertyref prefix="update"/> - </propertyset> - </echoproperties> - </target> - - <target name="ftpPublish" description="publishes ${jarname} using ftp" depends="preparePublish"> - <ftp server="${user.ftp.host}" userid="${user.ftp.user}" password="${user.ftp.pass}" remotedir="${user.ftp.dir}" depends="${user.ftp.depends}" passive="${user.ftp.passive}" ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </ftp> - </target> - - <target name="scpPublish" description="publishes ${jarname} using scp" depends="preparePublish"> - <scp todir="${user.scp.dir}" passphrase="${user.scp.passphrase}" trust="${user.scp.trust}" keyfile="${user.scp.keyfile}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </scp> - </target> - -</project> Property changes on: trunk/crossfire ___________________________________________________________________ Modified: svn:ignore - build.properties class classes CrossfireEditor.jar developer.properties tags + developer.properties Deleted: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2010-11-13 17:59:16 UTC (rev 8783) +++ trunk/crossfire/build.xml 2010-11-13 18:06:38 UTC (rev 8784) @@ -1,257 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. - ~ - ~ This program is free software; you can redistribute it and/or modify - ~ it under the terms of the GNU General Public License as published by - ~ the Free Software Foundation; either version 2 of the License, or - ~ (at your option) any later version. - ~ - ~ This program is distributed in the hope that it will be useful, - ~ but WITHOUT ANY WARRANTY; without even the implied warranty of - ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ~ GNU General Public License for more details. - ~ - ~ You should have received a copy of the GNU General Public License along - ~ with this program; if not, write to the Free Software Foundation, Inc., - ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - --> - -<!-- - - This is the Ant buildfile for the Gridarta Editor for Crossfire - - - - Apache Ant is a Java-based cross-platform build tool. - - For more information about Ant, visit <http://ant.apache.org/> - - - - Do not move, edit or delete this file. It should stay in the - - main directory of the Crossfire Editor. - - - - How to use Ant for the Crossfire Editor: - - - - o Install Ant on your system. Make sure both the JAVA_HOME - - and ANT_HOME environment variables are set correctly. - - - - o Change into the Crossfire Editor main directory. - - run "ant" to compile, - - run "ant run" to run the editor. - --> -<project name="Gridarta Editor for Crossfire" default="jar"> - - <!-- set properties and clean build directory --> - <target name="init"> - <property name="package" value="net.sf.gridarta.var.crossfire.maincontrol"/> - <property name="targetName" value="Crossfire"/> - <property file="developer.properties"/> - <property name="src.dir" value="src/app"/> - <property name="lib.dir" value="lib"/> - <property name="devlib.dir" value="devlib/"/> - <!-- Don't forget trailing / ! --> - <property name="test.dir" value="test"/> - <property name="resource.dir" value="resource"/> - <property name="build.dir.production" value="class/production"/> - <property name="jarname" value="${targetName}Editor.jar"/> - <property name="build.source.version" value="1.5"/> - <property name="build.target.version" value="${build.source.version}"/> - <property name="build.source.encoding" value="utf-8"/> - <property name="todo.file" value="todo.txt"/> - <property name="debug" value="false"/> - <property name="user.ftp.depends" value="yes"/> - <property name="user.ftp.passive" value="yes"/> - <property name="user.ftp.ignoreNoncriticalErrors" value="yes"/> - <property name="build.developer" value="unknown"/> - <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> - <property name="javac.fork" value="no"/> - <tstamp> - <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> - </tstamp> - <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> - <property name="build.svnversion" value="unknown"/> - <property name="build.version" value="Gridzilla"/> - <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> - <echoproperties destfile="build.properties"> - <propertyset> - <propertyref prefix="build.developer"/> - <propertyref prefix="build.number"/> - <propertyref prefix="build.tstamp"/> - <propertyref prefix="build.svnversion"/> - <propertyref prefix="build.version"/> - </propertyset> - </echoproperties> - </target> - - <!-- create ctags. --> - <target name="ctags" if="user.ctags" depends="init" description="creates tags file with symbol definitions for vim and other editors."> - <exec executable="ctags"> - <arg line="-R ${src.dir}"/> - </exec> - </target> - - <!-- delete and recreate the build directory --> - <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir.production}"/> - <mkdir dir="${build.dir.production}"/> - </target> - - <!-- compiling all Java classes --> - <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar"/> - <fileset dir="../lib/" includes="*.jar"/> - </classpath> - <compilerarg line="${javac.args}"/> - </javac> - </target> - - <!-- create JAR file --> - <target name="jar" depends="compile" description="compiles source and creates jar."> - <jar destfile="${jarname}" index="true"> - <!-- pack everything into the jar file --> - <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> - <fileset dir="${src.dir}" includes="**/*.properties,cfpython_menu.def"/> - <fileset file="build.properties"/> - <fileset file="../COPYING"/> - <fileset dir="${lib.dir}"> - <include name="*-LICENSE"/> - </fileset> - <fileset dir="../lib"> - <include name="bsh-LICENSE"/> - <include name="java-getopt-1.0.13"/> - <include name="japi.jar-LICENSE"/> - <include name="log4j-1.2.13.jar-LICENSE"/> - <include name="jdom.jar-LICENSE"/> - <include name="java-getopt-1.0.13.jar-LICENSE"/> - </fileset> - <fileset dir="${resource.dir}"> - <include name="icons/**"/> - <include name="resource/**"/> - <include name="system/**"/> - </fileset> - <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../resource"> - <include name="icons/**"/> - <include name="log4j.properties"/> - <include name="system/**"/> - <include name="toolbarButtonGraphics/**/*.*"/> - </fileset> - <zipfileset src="../lib/log4j-1.2.13.jar"/> - <zipfileset src="../lib/java-getopt-1.0.13.jar"/> - <zipfileset src="../lib/jdom.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> - <zipgroupfileset dir="../lib/" includes="japi-*.jar"/> - <!-- creating the manifest --> - <manifest> - <attribute name="Main-Class" value="${package}.CrossfireEditor"/> - <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> - </manifest> - </jar> - - <!-- delete the build directory --> - <delete dir="${build.dir.production}"/> - </target> - - <!-- run the jar file with default memory (64 Mb on most systems) --> - <target name="run" depends="init" description="runs editor."> - <java jar="${jarname}" fork="true" failonerror="true"/> - </target> - - <!-- run the jar file with extra memory (128 Mb) --> - <target name="run_high" depends="init" description="runs editor with extra memory (128m)."> - <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m"/> - </target> - - <!-- Create API documentation. --> - <target name="doc" depends="init" description="creates JavaDoc documentation for editor source."> - <mkdir dir="javadoc"/> - <javadoc destdir="javadoc" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="${targetName} Editor — API Documentation" doctitle="${targetName} Editor<br />API Documentation" header="${targetName} Editor<br />API Documentation" footer="${targetName} Editor<br />API Documentation" bottom="<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn="yes" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/${package}/overview.html" link="${user.javadoc.link}"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE"/> - <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE"/> - </classpath> - <packageset dir="src" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <packageset dir="../src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <packageset dir="../textedit/src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <packageset dir="../utils/src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <packageset dir="../model/src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <packageset dir="../preferences/src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <tag name="todo" description="Todo:"/> - <tag name="used" description="Manually marked as used." enabled="false"/> - <tag name="fixme" description="Fixme:"/> - <tag name="xxx" description="XXX:"/> - <tag name="note" description="Note:"/> - <tag name="devs" description="At Developers:"/> - </javadoc> - </target> - - <!-- Check the source style. - - @see http://checkstyle.sf.net/ - --> - <target name="checkstyle" depends="init" description="performs style checks for source."> - <taskdef resource="checkstyletask.properties" classpath="${checkstyle.path}"/> - <mkdir dir="${test.dir}"/> - <checkstyle config="${checkstyle.conv}"> - <fileset dir="${src.dir}" includes="**/*.java"/> - <formatter type="plain"/> - <formatter type="xml" toFile="${test.dir}/checkstyle_errors.xml"/> - </checkstyle> - </target> - - <!-- Prints a todo list. - - Useful e.g. to parse the list from within vi and jump from todo change to todo change. - --> - <target name="todo" depends="init" description="prints a file with todo information"> - <concat> - <fileset file="${todo.file}"/> - </concat> - </target> - - <target name="preparePublish" description="preparse files to publish" depends="jar"> - <property name="update.number" value="${build.number}"/> - <property name="update.tstamp" value="${build.tstamp}"/> - <property name="update.developer" value="${build.developer}"/> - <property name="update.url" value="${user.update.url}"/> - <echoproperties destfile="update.properties"> - <propertyset> - <propertyref prefix="update"/> - </propertyset> - </echoproperties> - </target> - - <target name="ftpPublish" description="publishes ${jarname} using ftp" depends="preparePublish"> - <ftp server="${user.ftp.host}" userid="${user.ftp.user}" password="${user.ftp.pass}" remotedir="${user.ftp.dir}" depends="${user.ftp.depends}" passive="${user.ftp.passive}" ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </ftp> - </target> - - <target name="scpPublish" description="publishes ${jarname} using scp" depends="preparePublish"> - <scp todir="${user.scp.dir}" passphrase="${user.scp.passphrase}" trust="${user.scp.trust}" keyfile="${user.scp.keyfile}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </scp> - </target> - -</project> Property changes on: trunk/daimonin ___________________________________________________________________ Modified: svn:ignore - build.properties class classes DaimoninEditor.jar developer.properties tags update.properties + developer.properties update.properties Deleted: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2010-11-13 17:59:16 UTC (rev 8783) +++ trunk/daimonin/build.xml 2010-11-13 18:06:38 UTC (rev 8784) @@ -1,256 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><!-- - ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - ~ Copyright (C) 2000-2010 The Gridarta Developers. - ~ - ~ This program is free software; you can redistribute it and/or modify - ~ it under the terms of the GNU General Public License as published by - ~ the Free Software Foundation; either version 2 of the License, or - ~ (at your option) any later version. - ~ - ~ This program is distributed in the hope that it will be useful, - ~ but WITHOUT ANY WARRANTY; without even the implied warranty of - ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ~ GNU General Public License for more details. - ~ - ~ You should have received a copy of the GNU General Public License along - ~ with this program; if not, write to the Free Software Foundation, Inc., - ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - --> - -<!-- - - This is the Ant buildfile for the Gridarta Editor for Daimonin - - - - Apache Ant is a Java-based cross-platform build tool. - - For more information about Ant, visit <http://ant.apache.org/> - - - - Do not move, edit or delete this file. It should stay in the - - main directory of the Daimonin Editor. - - - - How to use Ant for the Daimonin Editor: - - - - o Install Ant on your system. Make sure both the JAVA_HOME - - and ANT_HOME environment variables are set correctly. - - - - o Change into the Daimonin Editor main directory. - - run "ant" to compile, - - run "ant run" to run the editor. - --> -<project name="Gridarta Editor for Daimonin" default="jar"> - - <!-- set properties and clean build directory --> - <target name="init"> - <property name="package" value="net.sf.gridarta.var.daimonin.maincontrol"/> - <property name="targetName" value="Daimonin"/> - <property file="developer.properties"/> - <property name="src.dir" value="src/app"/> - <property name="lib.dir" value="lib"/> - <property name="devlib.dir" value="devlib/"/> - <!-- Don't forget trailing / ! --> - <property name="test.dir" value="test"/> - <property name="resource.dir" value="resource"/> - <property name="arch.dir" value="../arch"/> - <property name="build.dir.production" value="class/production"/> - <property name="jarname" value="${targetName}Editor.jar"/> - <property name="build.source.version" value="1.5"/> - <property name="build.target.version" value="${build.source.version}"/> - <property name="build.source.encoding" value="utf-8"/> - <property name="checkstyle.path" value="${devlib.dir}checkstyle-all-3.5.jar"/> - <property name="checkstyle.conv" value="${devlib.dir}checkstyle_checks.xml"/> - <property name="todo.file" value="todo.txt"/> - <property name="debug" value="false"/> - <property name="user.ftp.depends" value="yes"/> - <property name="user.ftp.passive" value="yes"/> - <property name="user.ftp.ignoreNoncriticalErrors" value="yes"/> - <property name="build.developer" value="unknown"/> - <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> - <property name="javac.fork" value="no"/> - <tstamp> - <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> - </tstamp> - <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> - <property name="build.svnversion" value="unknown"/> - <property name="build.version" value="Gridzilla"/> - <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> - <echoproperties destfile="build.properties"> - <propertyset negate="true"> - <propertyref prefix="user.ftp"/> - <propertyref prefix="user.scp"/> - </propertyset> - </echoproperties> - </target> - - <!-- create ctags. --> - <target name="ctags" if="user.ctags" depends="init" description="creates tags file with symbol definitions for vim and other editors."> - <exec executable="ctags"> - <arg line="-R ${src.dir}"/> - </exec> - </target> - - <!-- delete and recreate the build directory --> - <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir.production}"/> - <mkdir dir="${build.dir.production}"/> - </target> - - <!-- compiling all Java classes --> - <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar"/> - <fileset dir="../lib/" includes="*.jar"/> - </classpath> - <compilerarg line="${javac.args}"/> - </javac> - </target> - - <!-- create JAR file --> - <target name="jar" depends="compile" description="compiles source and creates jar."> - <!-- copy the resource files into the build dir --> - <copy todir="${build.dir.production}"> - <fileset dir="${resource.dir}"> - <include name="icons/**/*.*"/> - <include name="resource/**"/> - <include name="system/**/*.*"/> - <exclude name="**/.xvpics/**"/> - </fileset> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="${src.dir}" includes="**/*.properties"/> - </copy> - <copy todir="${build.dir.production}"> - <fileset dir="../resource"> - <include name="icons/**/*.*"/> - <include name="log4j.properties"/> - <include name="system/**/*.*"/> - <include name="toolbarButtonGraphics/**/*.*"/> - </fileset> - </copy> - <!--copy file="${arch.dir}/archetypes" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/daimonin.0" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/treasures" todir="${build.dir.production}" /--> - <delete dir="${build.dir.production}/customize"/> - - <jar destfile="${jarname}" index="true"> - <!-- pack everything into the jar file --> - <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> - <fileset file="build.properties"/> - <fileset file="../COPYING"/> - <fileset dir="${lib.dir}"> - <include name="*-LICENSE"/> - </fileset> - <fileset dir="../lib"> - <include name="bsh-LICENSE"/> - <include name="java-getopt-1.0.13"/> - <include name="japi.jar-LICENSE"/> - <include name="log4j-1.2.13.jar-LICENSE"/> - <include name="jdom.jar-LICENSE"/> - <include name="java-getopt-1.0.13.jar-LICENSE"/> - </fileset> - <zipfileset src="../lib/log4j-1.2.13.jar"/> - <zipfileset src="../lib/java-getopt-1.0.13.jar"/> - <zipfileset src="../lib/jdom.jar"/> - <zipfileset src="../lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> - <zipfileset src="../lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> - <zipgroupfileset dir="../lib/" includes="japi-*.jar"/> - <!-- creating the manifest --> - <manifest> - <attribute name="Main-Class" value="${package}.DaimoninEditor"/> - <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> - </manifest> - </jar> - - <!-- delete the build directory --> - <delete dir="${build.dir.production}"/> - </target> - - <!-- run the jar file with default memory (64 Mb on most systems) --> - <target name="run" depends="init" description="runs editor."> - <java jar="${jarname}" fork="true" failonerror="true"/> - </target> - - <!-- run the jar file with extra memory (128 Mb) --> - <target name="run_high" depends="init" description="runs editor with extra memory (128m)."> - <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m"/> - </target> - - <!-- Create API documentation. --> - <target name="doc" depends="init" description="creates JavaDoc documentation for editor source."> - <mkdir dir="javadoc"/> - <javadoc destdir="javadoc" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="${targetName} Editor — API Documentation" doctitle="${targetName} Editor<br />API Documentation" header="${targetName} Editor<br />API Documentation" footer="${targetName} Editor<br />API Documentation" bottom="<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn="yes" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/${package}/overview.html" link="${user.javadoc.link}"> - <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE"/> - <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE"/> - </classpath> - <sourcepath path="${src.dir}"/> - <packageset dir="src" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <tag name="todo" description="Todo:"/> - <tag name="used" description="Manually marked as used." enabled="false"/> - <tag name="fixme" description="Fixme:"/> - <tag name="xxx" description="XXX:"/> - <tag name="note" description="Note:"/> - <tag name="devs" description="At Developers:"/> - </javadoc> - </target> - - <!-- Check the source style. - - @see http://checkstyle.sf.net/ - --> - <target name="checkstyle" depends="init" description="performs style checks for source."> - <taskdef resource="checkstyletask.properties" classpath="${checkstyle.path}"/> - <mkdir dir="${test.dir}"/> - <checkstyle config="${checkstyle.conv}"> - <fileset dir="${src.dir}" includes="**/*.java"/> - <formatter type="plain"/> - <formatter type="xml" toFile="${test.dir}/checkstyle_errors.xml"/> - </checkstyle> - </target> - - <!-- Prints a todo list. - - Useful e.g. to parse the list from within vi and jump from todo change to todo change. - --> - <target name="todo" depends="init" description="prints a file with todo information"> - <concat> - <fileset file="${todo.file}"/> - </concat> - </target> - - <target name="preparePublish" description="preparse files to publish" depends="jar"> - <property name="update.number" value="${build.number}"/> - <property name="update.tstamp" value="${build.tstamp}"/> - <property name="update.developer" value="${build.developer}"/> - <property name="update.url" value="${user.update.url}"/> - <echoproperties destfile="update.properties"> - <propertyset> - <propertyref prefix="update"/> - </propertyset> - </echoproperties> - </target> - - <target name="ftpPublish" description="publishes ${jarname} using ftp" depends="preparePublish"> - <ftp server="${user.ftp.host}" userid="${user.ftp.user}" password="${user.ftp.pass}" remotedir="${user.ftp.dir}" depends="${user.ftp.depends}" passive="${user.ftp.passive}" ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </ftp> - </target> - - <target name="scpPublish" description="publishes ${jarname} using scp" depends="preparePublish"> - <scp todir="${user.scp.dir}" passphrase="${user.scp.passphrase}" trust="${user.scp.trust}" keyfile="${user.scp.keyfile}"> - <fileset dir="."> - <include name="${jarname}"/> - <include name="update.properties"/> - </fileset> - </scp> - </target> - -</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-13 18:23:14
|
Revision: 8782 http://gridarta.svn.sourceforge.net/gridarta/?rev=8782&view=rev Author: akirschbaum Date: 2010-11-13 17:32:50 +0000 (Sat, 13 Nov 2010) Log Message: ----------- Clean up module dependencies. Modified Paths: -------------- trunk/atrinik.iml trunk/build.xml trunk/crossfire.iml trunk/daimonin.iml trunk/gridarta.iml trunk/model.iml trunk/preferences.iml trunk/textedit.iml trunk/utils.iml Modified: trunk/atrinik.iml =================================================================== --- trunk/atrinik.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/atrinik.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -11,6 +11,7 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> + <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> @@ -24,7 +25,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -33,7 +34,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -42,7 +43,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -51,7 +52,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -60,7 +61,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -69,7 +70,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -78,17 +79,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="model" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/build.xml 2010-11-13 17:32:50 UTC (rev 8782) @@ -54,6 +54,85 @@ <property name="svn.tag.targetUrl" value="${svn.baseUrl}/tags/${project.version.major}.${project.version.minor}.${project.version.patch}"/> <property name="svn.tag.message" value="Creating release tag for version ${project.version.major}.${project.version.minor}.${project.version.patch}"/> + <path id="path.class.atrinik.app"> + <pathelement location="dest/atrinik/app"/> + </path> + <path id="path.class.atrinik.test"> + <path refid="path.class.atrinik.app"/> + <pathelement location="dest/atrinik/test"/> + </path> + + <path id="path.class.crossfire.app"> + <pathelement location="dest/crossfire/app"/> + </path> + <path id="path.class.crossfire.test"> + <path refid="path.class.crossfire.app"/> + <pathelement location="dest/crossfire/test"/> + </path> + + <path id="path.class.daimonin.app"> + <pathelement location="dest/daimonin/app"/> + </path> + <path id="path.class.daimonin.test"> + <path refid="path.class.daimonin.app"/> + <pathelement location="dest/daimonin/test"/> + </path> + + <path id="path.class.gridarta.app"> + <pathelement location="dest/gridarta/app"/> + </path> + <path id="path.class.gridarta.test"> + <path refid="path.class.gridarta.app"/> + <pathelement location="dest/gridarta/test"/> + </path> + + <path id="path.class.model.app"> + <pathelement location="dest/model/app"/> + </path> + <path id="path.class.model.test"> + <path refid="path.class.model.app"/> + <pathelement location="dest/model/test"/> + </path> + + <path id="path.class.preferences.app"> + <pathelement location="dest/preferences/app"/> + </path> + <path id="path.class.preferences.test"> + <path refid="path.class.preferences.app"/> + <pathelement location="dest/preferences/test"/> + </path> + + <path id="path.class.textedit.app"> + <pathelement location="dest/textedit/app"/> + </path> + <path id="path.class.textedit.test"> + <path refid="path.class.textedit.app"/> + <pathelement location="dest/textedit/test"/> + </path> + + <path id="path.class.utils.app"> + <pathelement location="dest/utils/app"/> + </path> + <path id="path.class.utils.test"> + <path refid="path.class.utils.app"/> + <pathelement location="dest/utils/test"/> + </path> + + <path id="path.lib.annotations" location="lib/annotations.jar"/> + <path id="path.lib.bsh-core" location="lib/bsh-core-2.0b4.jar"/> + <path id="path.lib.bsh-util" location="lib/bsh-util-2.0b4.jar"/> + <path id="path.lib.getopt" location="lib/java-getopt-1.0.13.jar"/> + <path id="path.lib.japi-swing-about" location="lib/japi-lib-swing-about-0.1.0.jar"/> + <path id="path.lib.japi-swing-action" location="lib/japi-lib-swing-action-0.1.0.jar"/> + <path id="path.lib.japi-swing-misc" location="lib/japi-lib-swing-misc-trunk-1398.jar"/> + <path id="path.lib.japi-swing-prefs" location="lib/japi-lib-swing-prefs-0.1.0.jar"/> + <path id="path.lib.japi-swing-tod" location="lib/japi-lib-swing-tod-0.1.0.jar"/> + <path id="path.lib.japi-util" location="lib/japi-lib-util-trunk-1379.jar"/> + <path id="path.lib.japi-xml" location="lib/japi-lib-xml-0.1.0.jar"/> + <path id="path.lib.jdom" location="lib/jdom.jar"/> + <path id="path.lib.log4j" location="lib/log4j-1.2.13.jar"/> + <path id="path.lib.junit" location="lib/junit-4.2.jar"/> + <path id="xsltpath"> <fileset dir="lib" includes="**/*.jar"/> </path> @@ -226,30 +305,27 @@ <mkdir dir="dest/atrinik/app"/> <javac srcdir="atrinik/src/app" destdir="dest/atrinik/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/preferences/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.gridarta.app"/> + <path refid="path.class.model.app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.japi-swing-prefs"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/atrinik/test"/> <javac srcdir="atrinik/src/test" destdir="dest/atrinik/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/atrinik/app"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.atrinik.app"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -262,30 +338,27 @@ <mkdir dir="dest/crossfire/app"/> <javac srcdir="crossfire/src/app" destdir="dest/crossfire/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/preferences/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.gridarta.app"/> + <path refid="path.class.model.app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.japi-swing-prefs"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/crossfire/test"/> <javac srcdir="crossfire/src/test" destdir="dest/crossfire/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/crossfire/app"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/gridarta/test"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.crossfire.app"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -298,27 +371,25 @@ <mkdir dir="dest/daimonin/app"/> <javac srcdir="daimonin/src/app" destdir="dest/daimonin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.gridarta.app"/> + <path refid="path.class.model.app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.japi-swing-prefs"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/daimonin/test"/> <javac srcdir="daimonin/src/test" destdir="dest/daimonin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/daimonin/app"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.daimonin.app"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -331,35 +402,35 @@ <mkdir dir="dest/gridarta/app"/> <javac srcdir="src/app" destdir="dest/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="bsh-core-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-util-2.0b4.jar"/> - <fileset dir="lib" includes="japi-lib-swing-about-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-tod-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="java-getopt-1.0.13.jar"/> - <fileset dir="lib" includes="jdom.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/preferences/app"/> - <pathelement location="dest/textedit/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.model.app"/> + <path refid="path.class.preferences.app"/> + <path refid="path.class.textedit.app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.bsh-core"/> + <path refid="path.lib.bsh-util"/> + <path refid="path.lib.getopt"/> + <path refid="path.lib.japi-swing-about"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.japi-swing-prefs"/> + <path refid="path.lib.japi-swing-tod"/> + <path refid="path.lib.japi-util"/> + <path refid="path.lib.jdom"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/gridarta/test"/> <javac srcdir="src/test" destdir="dest/gridarta/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/preferences/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.gridarta.app"/> + <path refid="path.class.model.test"/> + <path refid="path.class.preferences.test"/> + <path refid="path.class.textedit.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -372,29 +443,26 @@ <mkdir dir="dest/model/app"/> <javac srcdir="model/src/app" destdir="dest/model/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> - <fileset dir="lib" includes="jdom.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.japi-util"/> + <path refid="path.lib.japi-xml"/> + <path refid="path.lib.jdom"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/model/test"/> <javac srcdir="model/src/test" destdir="dest/model/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/utils/app"/> - <pathelement location="dest/utils/test"/> + <path refid="path.class.model.app"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-misc"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -407,18 +475,16 @@ <mkdir dir="dest/preferences/app"/> <javac srcdir="preferences/src/app" destdir="dest/preferences/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/preferences/test"/> <javac srcdir="preferences/src/test" destdir="dest/preferences/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/preferences/app"/> + <path refid="path.class.preferences.app"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -431,19 +497,18 @@ <mkdir dir="dest/textedit/app"/> <javac srcdir="textedit/src/app" destdir="dest/textedit/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/textedit/test"/> <javac srcdir="textedit/src/test" destdir="dest/textedit/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/textedit/app"/> + <path refid="path.class.textedit.app"/> + <path refid="path.class.utils.test"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -456,21 +521,21 @@ <mkdir dir="dest/utils/app"/> <javac srcdir="utils/src/app" destdir="dest/utils/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-util"/> + <path refid="path.lib.log4j"/> </classpath> <compilerarg line="${javac.args}"/> </javac> <mkdir dir="dest/utils/test"/> <javac srcdir="utils/src/test" destdir="dest/utils/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-util"/> + <path refid="path.lib.junit"/> </classpath> <compilerarg line="${javac.args}"/> </javac> @@ -531,22 +596,14 @@ </classpath> <sourcepath> <pathelement path="${user.javadoc.javasrc}"/> - <pathelement path="src/app"/> - <pathelement path="src/test"/> - <pathelement path="atrinik/src/app"/> - <pathelement path="atrinik/src/test"/> - <pathelement path="crossfire/src/app"/> - <pathelement path="crossfire/src/test"/> - <pathelement path="daimonin/src/app"/> - <pathelement path="daimonin/src/test"/> - <pathelement path="model/src/app"/> - <pathelement path="model/src/test"/> - <pathelement path="preferences/src/app"/> - <pathelement path="preferences/src/test"/> - <pathelement path="textedit/src/app"/> - <pathelement path="textedit/src/test"/> - <pathelement path="utils/src/app"/> - <pathelement path="utils/src/test"/> + <path refid="path.class.atrinik.test"/> + <path refid="path.class.crossfire.test"/> + <path refid="path.class.daimonin.test"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.preferences.test"/> + <path refid="path.class.textedit.test"/> + <path refid="path.class.utils.test"/> </sourcepath> <packageset dir="src/app" defaultexcludes="yes"/> <packageset dir="src/test" defaultexcludes="yes"/> @@ -728,12 +785,7 @@ </target> <target name="checkstyle" description="Runs checkstyle to style-check the source code"> - <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-all-5.0.jar"> - <classpath> - <pathelement path="lib/antlr.jar"/> - <pathelement path="lib/commons-beanutils-core.jar"/> - </classpath> - </taskdef> + <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-all-5.0.jar"/> <mkdir dir="dest/doc"/> <checkstyle config="src/checkstyle.xml" failOnViolation="true"> <formatter type="plain" tofile="dest/doc/checkstyle_report.txt"/> @@ -782,22 +834,14 @@ </classpath> <sourcepath> <pathelement path="${user.javadoc.javasrc}"/> - <pathelement path="src/app"/> - <pathelement path="src/test"/> - <pathelement path="atrinik/src/app"/> - <pathelement path="atrinik/src/test"/> - <pathelement path="crossfire/src/app"/> - <pathelement path="crossfire/src/test"/> - <pathelement path="daimonin/src/app"/> - <pathelement path="daimonin/src/test"/> - <pathelement path="model/src/app"/> - <pathelement path="model/src/test"/> - <pathelement path="preferences/src/app"/> - <pathelement path="preferences/src/test"/> - <pathelement path="textedit/src/app"/> - <pathelement path="textedit/src/test"/> - <pathelement path="utils/src/app"/> - <pathelement path="utils/src/test"/> + <path refid="path.class.atrinik.test"/> + <path refid="path.class.crossfire.test"/> + <path refid="path.class.daimonin.test"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.preferences.test"/> + <path refid="path.class.textedit.test"/> + <path refid="path.class.utils.test"/> </sourcepath> <packageset dir="src/app" defaultexcludes="yes"/> <packageset dir="src/test" defaultexcludes="yes"/> @@ -858,15 +902,13 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/atrinik/app"/> - <pathelement location="dest/atrinik/test"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.atrinik.test"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -884,16 +926,13 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/crossfire/app"/> - <pathelement location="dest/crossfire/test"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/gridarta/test"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.crossfire.test"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -911,12 +950,13 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/daimonin/app"/> - <pathelement location="dest/daimonin/test"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.daimonin.test"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -934,14 +974,12 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/gridarta/test"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> + <path refid="path.class.gridarta.test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -959,15 +997,12 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/gridarta/app"/> - <pathelement location="dest/model/app"/> - <pathelement location="dest/model/test"/> - <pathelement location="dest/utils/app"/> - <pathelement location="dest/utils/test"/> + <path refid="path.class.model.test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-swing-action"/> + <path refid="path.lib.japi-xml"/> + <path refid="path.lib.junit"/> + <path refid="path.lib.log4j"/> <pathelement location="resource"/> </classpath> <formatter type="plain"/> @@ -986,9 +1021,7 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/preferences/app"/> - <pathelement location="dest/preferences/test"/> + <path refid="path.class.preferences.test"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -1006,9 +1039,7 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/textedit/app"/> - <pathelement location="dest/textedit/test"/> + <path refid="path.class.textedit.test"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> @@ -1026,10 +1057,9 @@ <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="junit-4.2.jar"/> - <pathelement location="dest/utils/app"/> - <pathelement location="dest/utils/test"/> + <path refid="path.class.utils.test"/> + <path refid="path.lib.japi-util"/> + <path refid="path.lib.junit"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> Modified: trunk/crossfire.iml =================================================================== --- trunk/crossfire.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/crossfire.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -12,6 +12,7 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> + <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> @@ -25,7 +26,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -34,7 +35,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-core-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -43,7 +44,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-util-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -52,7 +53,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-core-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -61,7 +62,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-util-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -70,7 +71,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -79,7 +80,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -88,7 +89,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -97,7 +98,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/java-getopt-1.0.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -106,7 +107,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -115,17 +116,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/java-getopt-1.0.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="model" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/daimonin.iml =================================================================== --- trunk/daimonin.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/daimonin.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -11,6 +11,7 @@ <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> + <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> @@ -24,7 +25,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -33,7 +34,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -42,7 +43,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -51,7 +52,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-misc-trunk-1398.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -60,7 +61,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-prefs-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -69,7 +70,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -78,17 +79,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="model" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-commands-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/gridarta.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -18,9 +18,10 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="model" /> + <orderEntry type="module" module-name="preferences" /> + <orderEntry type="module" module-name="textedit" /> <orderEntry type="module" module-name="utils" /> - <orderEntry type="module" module-name="textedit" /> - <orderEntry type="module" module-name="preferences" /> <orderEntry type="module-library"> <library> <CLASSES> @@ -33,7 +34,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-core-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -42,7 +43,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/bsh-util-2.0b4.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -51,7 +52,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/java-getopt-1.0.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -60,7 +61,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-core-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-lang-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -69,7 +70,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/bsh-util-2.0b4.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-about-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -78,16 +79,18 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> - <SOURCES /> + <SOURCES> + <root url="file://$MODULE_DIR$/../../japi/libs/swing-action/trunk/src/prj" /> + </SOURCES> </library> </orderEntry> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-about-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-extlib-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -114,7 +117,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-xml-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-tod-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -123,18 +126,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> - <SOURCES> - <root url="file://$MODULE_DIR$/../../japi/libs/swing-action/trunk/src/prj" /> - </SOURCES> + <SOURCES /> </library> </orderEntry> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/java-getopt-1.0.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-xml-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -143,17 +144,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="model" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-lang-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -162,7 +162,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-extlib-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/model.iml =================================================================== --- trunk/model.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/model.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -39,7 +39,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -48,7 +48,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-xml-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -66,7 +66,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-xml-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -75,7 +75,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/preferences.iml =================================================================== --- trunk/preferences.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/preferences.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -19,7 +19,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -28,7 +28,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/textedit.iml =================================================================== --- trunk/textedit.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/textedit.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -7,10 +7,11 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/annotations.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -19,17 +20,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/annotations.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> Modified: trunk/utils.iml =================================================================== --- trunk/utils.iml 2010-11-10 18:08:54 UTC (rev 8781) +++ trunk/utils.iml 2010-11-13 17:32:50 UTC (rev 8782) @@ -19,7 +19,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -28,7 +28,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-swing-action-0.1.0.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -46,7 +46,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-13 18:39:21
|
Revision: 8787 http://gridarta.svn.sourceforge.net/gridarta/?rev=8787&view=rev Author: akirschbaum Date: 2010-11-13 18:39:15 +0000 (Sat, 13 Nov 2010) Log Message: ----------- Remove InsertionModeSet.init(). Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionModeSet.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionModeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionModeSet.java 2010-11-13 18:30:20 UTC (rev 8786) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionModeSet.java 2010-11-13 18:39:15 UTC (rev 8787) @@ -36,7 +36,7 @@ * The "auto" insertion mode. */ @NotNull - private InsertionMode<G, A, R> autoInsertionMode; + private final InsertionMode<G, A, R> autoInsertionMode; /** * The "topmost" insertion mode. @@ -48,13 +48,13 @@ * The "above floor" insertion mode. */ @NotNull - private InsertionMode<G, A, R> aboveFloorInsertionMode; + private final InsertionMode<G, A, R> aboveFloorInsertionMode; /** * The "below floor" insertion mode. */ @NotNull - private InsertionMode<G, A, R> belowFloorInsertionMode; + private final InsertionMode<G, A, R> belowFloorInsertionMode; /** * The "bottommost" insertion mode. @@ -65,13 +65,6 @@ /** * Creates a new instance. * @param topmostInsertionMode the "topmost" insertion mode - */ - public InsertionModeSet(@NotNull final InsertionMode<G, A, R> topmostInsertionMode) { - this.topmostInsertionMode = topmostInsertionMode; - } - - /** - * Creates a new instance. * @param floorGameObjectMatcher the game object matcher for selecting floor * game objects * @param wallGameObjectMatcher the game object matcher for selecting wall @@ -79,8 +72,8 @@ * @param belowFloorGameObjectMatcher the game object matcher for selecting * below floor game objects */ - @Deprecated - public void init(@Nullable final GameObjectMatcher floorGameObjectMatcher, @NotNull final GameObjectMatcher wallGameObjectMatcher, @NotNull final GameObjectMatcher belowFloorGameObjectMatcher) { + public InsertionModeSet(@NotNull final InsertionMode<G, A, R> topmostInsertionMode, @Nullable final GameObjectMatcher floorGameObjectMatcher, @NotNull final GameObjectMatcher wallGameObjectMatcher, @NotNull final GameObjectMatcher belowFloorGameObjectMatcher) { + this.topmostInsertionMode = topmostInsertionMode; autoInsertionMode = new AutoInsertionMode<G, A, R>(floorGameObjectMatcher, wallGameObjectMatcher, belowFloorGameObjectMatcher); aboveFloorInsertionMode = new AboveFloorInsertionMode<G, A, R>(floorGameObjectMatcher); belowFloorInsertionMode = new BelowFloorInsertionMode<G, A, R>(floorGameObjectMatcher); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-11-13 18:30:20 UTC (rev 8786) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2010-11-13 18:39:15 UTC (rev 8787) @@ -146,8 +146,7 @@ archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); topmostInsertionMode = new TopmostInsertionMode<TestGameObject, TestMapArchObject, TestArchetype>(); - insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode); - insertionModeSet.init(new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); + insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode, new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-11-13 18:30:20 UTC (rev 8786) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-11-13 18:39:15 UTC (rev 8787) @@ -462,7 +462,11 @@ final SelectedSquareActions<G, A, R> selectedSquareActions = new SelectedSquareActions<G, A, R>(selectedSquareModel); final SelectedSquareView<G, A, R> selectedSquareView = new SelectedSquareView<G, A, R>(selectedSquareModel, selectedSquareActions, mapManager, mapViewManager, mapViewSettings, compassIcon, faceObjectProviders, unknownSquareIcon); final SelectedSquareControl<G, A, R> selectedSquareControl = new SelectedSquareControl<G, A, R>(selectedSquareModel, gameObjectAttributesDialogFactory, objectChooser, selectedSquareView); - final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode); + final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); + final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("system_wall", "wall"); + final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, new File(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml")); + final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_below_floor", "below_floor"); + final InsertionModeSet<G, A, R> insertionModeSet = new InsertionModeSet<G, A, R>(topmostInsertionMode, floorMatcher, wallMatcher, belowFloorMatcher); final CopyBuffer<G, A, R> copyBuffer = new CopyBuffer<G, A, R>(mapViewSettings, gameObjectFactory, mapArchObjectFactory, mapModelFactory, insertionModeSet); final ReplaceDialogManager<G, A, R> replaceDialogManager = new ReplaceDialogManager<G, A, R>(mainViewFrame, copyBuffer, objectChooser, mapViewManager, faceObjectProviders, insertionModeSet); exiter = new DefaultExiter(mainViewFrame); @@ -475,13 +479,8 @@ fileControl = new DefaultFileControl<G, A, R>(globalSettings, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); - final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); - final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("system_wall", "wall"); - final ErrorViewCollector gameObjectMatchersErrorViewCollector = new ErrorViewCollector(errorView, new File(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml")); final GameObjectMatcher monsterMatcherTmp = gameObjectMatchers.getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_monster", "monster"); final GameObjectMatcher monsterMatcher = monsterMatcherTmp == null ? new TypeNrsGameObjectMatcher() : monsterMatcherTmp; - final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_below_floor", "below_floor"); - insertionModeSet.init(floorMatcher, wallMatcher, belowFloorMatcher); final GameObjectMatcher exitGameObjectMatcherTmp = gameObjectMatchers.getMatcherWarn(gameObjectMatchersErrorViewCollector, "system_exit", "exit"); final GameObjectMatcher exitGameObjectMatcher = exitGameObjectMatcherTmp == null ? new TypeNrsGameObjectMatcher() : exitGameObjectMatcherTmp; final ExitMatcher<G, A, R> exitMatcher = new ExitMatcher<G, A, R>(exitGameObjectMatcher); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-13 21:46:51
|
Revision: 8791 http://gridarta.svn.sourceforge.net/gridarta/?rev=8791&view=rev Author: akirschbaum Date: 2010-11-13 21:46:44 +0000 (Sat, 13 Nov 2010) Log Message: ----------- Extract plugin script related code into separate module 'script'. Modified Paths: -------------- trunk/atrinik.iml trunk/build.xml trunk/crossfire.iml trunk/daimonin.iml trunk/gridarta.iml trunk/gridarta.ipr Added Paths: ----------- trunk/script/ trunk/script/src/ trunk/script/src/app/ trunk/script/src/app/net/ trunk/script/src/app/net/sf/ trunk/script/src/app/net/sf/gridarta/ trunk/script/src/app/net/sf/gridarta/script/ trunk/script/src/test/ trunk/script.iml Removed Paths: ------------- trunk/src/app/net/sf/gridarta/script/ Modified: trunk/atrinik.iml =================================================================== --- trunk/atrinik.iml 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/atrinik.iml 2010-11-13 21:46:44 UTC (rev 8791) @@ -12,6 +12,7 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> + <orderEntry type="module" module-name="script" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/build.xml 2010-11-13 21:46:44 UTC (rev 8791) @@ -106,6 +106,14 @@ <pathelement location="${build.dir}/preferences/test"/> </path> + <path id="path.class.script.app"> + <pathelement location="${build.dir}/script/app"/> + </path> + <path id="path.class.script.test"> + <path refid="path.class.script.app"/> + <pathelement location="${build.dir}/script/test"/> + </path> + <path id="path.class.textedit.app"> <pathelement location="${build.dir}/textedit/app"/> </path> @@ -183,6 +191,7 @@ <fileset dir="${build.dir}/gridarta/app"/> <fileset dir="${build.dir}/model/app"/> <fileset dir="${build.dir}/preferences/app"/> + <fileset dir="${build.dir}/script/app"/> <fileset dir="${build.dir}/textedit/app"/> <fileset dir="${build.dir}/utils/app"/> <fileset dir="${build.dir}" includes="build.properties"/> @@ -220,6 +229,7 @@ <fileset dir="${build.dir}/gridarta/app"/> <fileset dir="${build.dir}/model/app"/> <fileset dir="${build.dir}/preferences/app"/> + <fileset dir="${build.dir}/script/app"/> <fileset dir="${build.dir}/textedit/app"/> <fileset dir="${build.dir}/utils/app"/> <fileset dir="${build.dir}" includes="build.properties"/> @@ -257,6 +267,7 @@ <fileset dir="${build.dir}/gridarta/app"/> <fileset dir="${build.dir}/model/app"/> <fileset dir="${build.dir}/preferences/app"/> + <fileset dir="${build.dir}/script/app"/> <fileset dir="${build.dir}/textedit/app"/> <fileset dir="${build.dir}/utils/app"/> <fileset dir="${build.dir}" includes="build.properties"/> @@ -304,12 +315,13 @@ </echoproperties> </target> - <target name="compile-atrinik" description="Compiles the atrinik module." depends="compile-gridarta,compile-model,compile-preferences,compile-utils"> + <target name="compile-atrinik" description="Compiles the atrinik module." depends="compile-gridarta,compile-model,compile-preferences,compile-script,compile-utils"> <mkdir dir="${build.dir}/atrinik/app"/> <javac srcdir="atrinik/src/app" destdir="${build.dir}/atrinik/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> + <path refid="path.class.script.app"/> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> @@ -337,12 +349,13 @@ </copy> </target> - <target name="compile-crossfire" description="Compiles the crossfire module." depends="compile-gridarta,compile-model,compile-preferences,compile-utils"> + <target name="compile-crossfire" description="Compiles the crossfire module." depends="compile-gridarta,compile-model,compile-preferences,compile-script,compile-utils"> <mkdir dir="${build.dir}/crossfire/app"/> <javac srcdir="crossfire/src/app" destdir="${build.dir}/crossfire/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> + <path refid="path.class.script.app"/> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> @@ -370,12 +383,13 @@ </copy> </target> - <target name="compile-daimonin" description="Compiles the daimonin module." depends="compile-gridarta,compile-model,compile-utils"> + <target name="compile-daimonin" description="Compiles the daimonin module." depends="compile-gridarta,compile-model,compile-script,compile-utils"> <mkdir dir="${build.dir}/daimonin/app"/> <javac srcdir="daimonin/src/app" destdir="${build.dir}/daimonin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.gridarta.app"/> <path refid="path.class.model.app"/> + <path refid="path.class.script.app"/> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> <path refid="path.lib.japi-swing-action"/> @@ -401,12 +415,13 @@ </copy> </target> - <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-preferences,compile-textedit,compile-utils"> + <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-preferences,compile-script,compile-textedit,compile-utils"> <mkdir dir="${build.dir}/gridarta/app"/> <javac srcdir="src/app" destdir="${build.dir}/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <path refid="path.class.model.app"/> <path refid="path.class.preferences.app"/> + <path refid="path.class.script.app"/> <path refid="path.class.textedit.app"/> <path refid="path.class.utils.app"/> <path refid="path.lib.annotations"/> @@ -496,6 +511,32 @@ </copy> </target> + <target name="compile-script" description="Compiles the script module." depends="compile-model,compile-utils"> + <mkdir dir="${build.dir}/script/app"/> + <javac srcdir="script/src/app" destdir="${build.dir}/script/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <path refid="path.class.model.app"/> + <path refid="path.class.utils.app"/> + <path refid="path.lib.annotations"/> + <path refid="path.lib.bsh-core"/> + <path refid="path.lib.bsh-util"/> + <path refid="path.lib.jdom"/> + <path refid="path.lib.log4j"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="${build.dir}/script/test"/> + <javac srcdir="script/src/test" destdir="${build.dir}/script/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <path refid="path.class.script.app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="${build.dir}/script/app"> + <fileset dir="script/src/app" includes="**/*.properties"/> + </copy> + </target> + <target name="compile-textedit" description="Compiles the textedit module." depends="compile-utils"> <mkdir dir="${build.dir}/textedit/app"/> <javac srcdir="textedit/src/app" destdir="${build.dir}/textedit/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> @@ -605,6 +646,7 @@ <path refid="path.class.gridarta.test"/> <path refid="path.class.model.test"/> <path refid="path.class.preferences.test"/> + <path refid="path.class.script.test"/> <path refid="path.class.textedit.test"/> <path refid="path.class.utils.test"/> </sourcepath> @@ -620,6 +662,8 @@ <packageset dir="model/src/test" defaultexcludes="yes"/> <packageset dir="preferences/src/app" defaultexcludes="yes"/> <packageset dir="preferences/src/test" defaultexcludes="yes"/> + <packageset dir="script/src/app" defaultexcludes="yes"/> + <packageset dir="script/src/test" defaultexcludes="yes"/> <packageset dir="textedit/src/app" defaultexcludes="yes"/> <packageset dir="textedit/src/test" defaultexcludes="yes"/> <packageset dir="utils/src/app" defaultexcludes="yes"/> @@ -805,6 +849,8 @@ <fileset dir="model/src/test" includes="**/*.java"/> <fileset dir="preferences/src/app" includes="**/*.java"/> <fileset dir="preferences/src/test" includes="**/*.java"/> + <fileset dir="script/src/app" includes="**/*.java"/> + <fileset dir="script/src/test" includes="**/*.java"/> <fileset dir="textedit/src/app" includes="**/*.java"/> <fileset dir="textedit/src/test" includes="**/*.java"/> <fileset dir="utils/src/app" includes="**/*.java"/> @@ -843,6 +889,7 @@ <path refid="path.class.gridarta.test"/> <path refid="path.class.model.test"/> <path refid="path.class.preferences.test"/> + <path refid="path.class.script.test"/> <path refid="path.class.textedit.test"/> <path refid="path.class.utils.test"/> </sourcepath> @@ -858,6 +905,8 @@ <packageset dir="model/src/test" defaultexcludes="yes"/> <packageset dir="preferences/src/app" defaultexcludes="yes"/> <packageset dir="preferences/src/test" defaultexcludes="yes"/> + <packageset dir="script/src/app" defaultexcludes="yes"/> + <packageset dir="script/src/test" defaultexcludes="yes"/> <packageset dir="textedit/src/app" defaultexcludes="yes"/> <packageset dir="textedit/src/test" defaultexcludes="yes"/> <packageset dir="utils/src/app" defaultexcludes="yes"/> @@ -892,7 +941,7 @@ <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire,test-mapvalidator-daimonin"/> - <target name="test-junit" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-textedit,test-utils"> + <target name="test-junit" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-script,test-textedit,test-utils"> <junitreport todir="${docs.dir}/test"> <fileset dir="${docs.dir}/test"> <include name="TEST-*.xml"/> @@ -1038,6 +1087,24 @@ </junit> </target> + <target name="test-script" depends="compile-script"> + <mkdir dir="${docs.dir}/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <path refid="path.class.script.test"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="${docs.dir}/test"> + <fileset dir="${build.dir}/script/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> + </fileset> + </batchtest> + </junit> + </target> + <target name="test-textedit" depends="compile-textedit"> <mkdir dir="${docs.dir}/test"/> <junit printsummary="no" haltonfailure="yes"> Modified: trunk/crossfire.iml =================================================================== --- trunk/crossfire.iml 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/crossfire.iml 2010-11-13 21:46:44 UTC (rev 8791) @@ -13,6 +13,7 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> + <orderEntry type="module" module-name="script" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> Modified: trunk/daimonin.iml =================================================================== --- trunk/daimonin.iml 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/daimonin.iml 2010-11-13 21:46:44 UTC (rev 8791) @@ -12,6 +12,7 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="gridarta" /> <orderEntry type="module" module-name="model" /> + <orderEntry type="module" module-name="script" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> <library> Modified: trunk/gridarta.iml =================================================================== --- trunk/gridarta.iml 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/gridarta.iml 2010-11-13 21:46:44 UTC (rev 8791) @@ -20,6 +20,7 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="module" module-name="model" /> <orderEntry type="module" module-name="preferences" /> + <orderEntry type="module" module-name="script" /> <orderEntry type="module" module-name="textedit" /> <orderEntry type="module" module-name="utils" /> <orderEntry type="module-library"> Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-11-13 20:18:58 UTC (rev 8790) +++ trunk/gridarta.ipr 2010-11-13 21:46:44 UTC (rev 8791) @@ -1416,6 +1416,7 @@ <module fileurl="file://$PROJECT_DIR$/gridarta.iml" filepath="$PROJECT_DIR$/gridarta.iml" /> <module fileurl="file://$PROJECT_DIR$/model.iml" filepath="$PROJECT_DIR$/model.iml" /> <module fileurl="file://$PROJECT_DIR$/preferences.iml" filepath="$PROJECT_DIR$/preferences.iml" /> + <module fileurl="file://$PROJECT_DIR$/script.iml" filepath="$PROJECT_DIR$/script.iml" /> <module fileurl="file://$PROJECT_DIR$/textedit.iml" filepath="$PROJECT_DIR$/textedit.iml" /> <module fileurl="file://$PROJECT_DIR$/utils.iml" filepath="$PROJECT_DIR$/utils.iml" /> </modules> Added: trunk/script.iml =================================================================== --- trunk/script.iml (rev 0) +++ trunk/script.iml 2010-11-13 21:46:44 UTC (rev 8791) @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$/script"> + <sourceFolder url="file://$MODULE_DIR$/script/src/app" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/script/src/test" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="model" /> + <orderEntry type="module" module-name="utils" /> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/annotations.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/bsh-core-2.0b4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/bsh-util-2.0b4.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + </component> +</module> + Property changes on: trunk/script.iml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-13 22:22:57
|
Revision: 8794 http://gridarta.svn.sourceforge.net/gridarta/?rev=8794&view=rev Author: akirschbaum Date: 2010-11-13 22:22:50 +0000 (Sat, 13 Nov 2010) Log Message: ----------- Remove empty directories. Removed Paths: ------------- trunk/model/src/app/net/sf/gridarta/model/map/ trunk/model/src/test/net/sf/gridarta/model/scripts/ trunk/src/app/net/sf/gridarta/gui/io/ trunk/src/app/net/sf/gridarta/validation/ trunk/src/test/net/sf/gridarta/gui/filter/ trunk/src/test/net/sf/gridarta/gui/mapcursor/ trunk/src/test/net/sf/gridarta/gui/scripts/ trunk/src/test/net/sf/gridarta/model/ trunk/src/test/net/sf/gridarta/validation/ trunk/src/test/net/sf/gridarta/var/ trunk/utils/src/test/net/sf/gridarta/gui/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-15 20:12:10
|
Revision: 8795 http://gridarta.svn.sourceforge.net/gridarta/?rev=8795&view=rev Author: akirschbaum Date: 2010-11-15 20:12:04 +0000 (Mon, 15 Nov 2010) Log Message: ----------- Add 'preparePublish' build target. Modified Paths: -------------- trunk/INSTALL trunk/build.xml Property Changed: ---------------- trunk/ trunk/atrinik/ trunk/crossfire/ trunk/daimonin/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - classes dest developer.properties docs gridarta.iws out AtrinikEditor.jar CrossfireEditor.jar DaimoninEditor.jar + classes dest developer.properties dist docs gridarta.iws out AtrinikEditor.jar CrossfireEditor.jar DaimoninEditor.jar Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-11-13 22:22:50 UTC (rev 8794) +++ trunk/INSTALL 2010-11-15 20:12:04 UTC (rev 8795) @@ -39,3 +39,41 @@ --------------------------------------- Change to the main directory and run "ant javadoc". The documentation will be placed in dest/doc/dev/api/. + + +How to Publish a Build +---------------------- +Gridarta supports updating itself through the GUI (Help|Update...). Gridarta +first checks whether an update is available, then downloads the update. + +To check whether an update is available, Gridarta downloads a file specified in +"update.url=" in atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties, +crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties, or +daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties. This file +contains the following entries: + - update.url=Download URL to AtrinikEditor.jar, CrossfireEditor.jar, or + DaimoninEditor.jar. + - update.number=the Gridarta version number corresponding to update.url + - update.tstamp=the timestamp corresponding to update.url + - update.developer=the name of the developer providing the build + +If update.tstamp is newer than the timestamp of the currently running editor, an +update is available from update.url. The other entries are displayed to the +user. + +To provide a build, edit the value of "update.url" in +*/src/app/net/sf/gridarta/var/*/action.properties for the editor variant. Then +create or edit the file "developer.properties" in the project's root directory. +Add the following entries: + - build.developer=Name of the developer providing the build. + - user.update.url.atrinik=Download URL to AtrinikEditor.jar. + - user.update.url.crossfire=Download URL to CrossfireEditor.jar. + - user.update.url.daimonin=Download URL to DaimoninEditor.jar. +The definitions of user.update.url.* are optional for editor variants not +provided. + +Run "ant preparePublish". This compiles the editors and creates the file +"update.properties" for the editor variants to publish. The result is in +dist/atrinik, dist/crossfire, and dist/daimonin. + +Upload the contents of dist/atrinik, dist/crossfire, and dist/daimonin. Property changes on: trunk/atrinik ___________________________________________________________________ Deleted: svn:ignore - developer.properties update.properties Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-11-13 22:22:50 UTC (rev 8794) +++ trunk/build.xml 2010-11-15 20:12:04 UTC (rev 8795) @@ -1157,4 +1157,39 @@ </java> </target> + <target name="preparePublish" description="Prepare files to publish." depends="preparePublish-atrinik,preparePublish-crossfire,preparePublish-daimonin"/> + + <target name="preparePublish-atrinik" description="Prepare files to publish AtrinikEditor.jar." depends="jar" if="user.update.url.atrinik"> + <mkdir dir="${dist.dir}/atrinik"/> + <echo file="${dist.dir}/atrinik/update.properties"> +update.number=${build.number} +update.tstamp=${build.tstamp} +update.developer=${build.developer} +update.url=${user.update.url.atrinik} + </echo> + <copy file="AtrinikEditor.jar" tofile="${dist.dir}/atrinik/AtrinikEditor.jar"/> + </target> + + <target name="preparePublish-crossfire" description="Prepare files to publish CrossfireEditor.jar." depends="jar" if="user.update.url.crossfire"> + <mkdir dir="${dist.dir}/crossfire"/> + <echo file="${dist.dir}/crossfire/update.properties"> +update.number=${build.number} +update.tstamp=${build.tstamp} +update.developer=${build.developer} +update.url=${user.update.url.crossfire} + </echo> + <copy file="CrossfireEditor.jar" tofile="${dist.dir}/crossfire/CrossfireEditor.jar"/> + </target> + + <target name="preparePublish-daimonin" description="Prepare files to publish DaimoninEditor.jar." depends="jar" if="user.update.url.daimonin"> + <mkdir dir="${dist.dir}/daimonin"/> + <echo file="${dist.dir}/daimonin/update.properties"> +update.number=${build.number} +update.tstamp=${build.tstamp} +update.developer=${build.developer} +update.url=${user.update.url.daimonin} + </echo> + <copy file="DaimoninEditor.jar" tofile="${dist.dir}/daimonin/DaimoninEditor.jar"/> + </target> + </project> Property changes on: trunk/crossfire ___________________________________________________________________ Deleted: svn:ignore - developer.properties Property changes on: trunk/daimonin ___________________________________________________________________ Deleted: svn:ignore - developer.properties update.properties This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |