From: <aki...@us...> - 2011-12-16 19:26:17
|
Revision: 9121 http://gridarta.svn.sourceforge.net/gridarta/?rev=9121&view=rev Author: akirschbaum Date: 2011-12-16 19:26:09 +0000 (Fri, 16 Dec 2011) Log Message: ----------- Move classes to correct packages. Modified Paths: -------------- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/validation/checks/ValidatorFactoryTest.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/validation/ trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java trunk/model/src/test/net/sf/gridarta/model/validation/checks/ trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.java Removed Paths: ------------- trunk/model/src/test/net/sf/gridarta/validation/ Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/validation/checks/ValidatorFactoryTest.java 2011-12-16 19:18:31 UTC (rev 9120) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/validation/checks/ValidatorFactoryTest.java 2011-12-16 19:26:09 UTC (rev 9121) @@ -20,7 +20,7 @@ package net.sf.gridarta.var.crossfire.model.validation.checks; import net.sf.gridarta.model.validation.NoSuchValidatorException; -import net.sf.gridarta.validation.ValidationUtils; +import net.sf.gridarta.model.validation.ValidationUtils; import org.junit.Test; /** Copied: trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java (from rev 9120, trunk/model/src/test/net/sf/gridarta/validation/AbstractValidatorTest.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java 2011-12-16 19:26:09 UTC (rev 9121) @@ -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.validation; + +import junit.framework.TestCase; +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.utils.TestActionBuilder; +import org.jetbrains.annotations.Nullable; + +/** + * Test for {@link AbstractValidator}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class AbstractValidatorTest extends TestCase { + + /** + * Object Under Test: A AbstractValidator. + */ + @Nullable + private Validator<?, ?, ?> oUT; + + /** + * {@inheritDoc} + * @noinspection ProhibitedExceptionDeclared + */ + @Override + public void setUp() throws Exception { + super.setUp(); + TestActionBuilder.initialize(); + final ValidatorPreferences validatorPreferences = new TestValidatorPreferences(); + //noinspection EmptyClass + oUT = new AbstractValidator<TestGameObject, TestMapArchObject, TestArchetype>(validatorPreferences, DelegatingMapValidator.DEFAULT_KEY) { + + }; + } + + /** + * {@inheritDoc} + * @noinspection ProhibitedExceptionDeclared + */ + @Override + public void tearDown() throws Exception { + super.tearDown(); + oUT = null; + } + + /** + * Test case for {@link AbstractValidator#setEnabled(boolean)}. + */ + public void testEnabled() { + assert oUT != null; + oUT.setEnabled(false); + assert oUT != null; + assertFalse(oUT.isEnabled()); + assert oUT != null; + oUT.setEnabled(true); + assert oUT != null; + assertTrue(oUT.isEnabled()); + } + +} // class AbstractValidatorTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java (from rev 9120, trunk/model/src/test/net/sf/gridarta/validation/TestValidatorPreferences.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java 2011-12-16 19:26:09 UTC (rev 9121) @@ -0,0 +1,47 @@ +/* + * 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; + +import org.jetbrains.annotations.NotNull; + +/** + * {@link ValidatorPreferences} implementation for regression tests. The + * settings are not stored or restored. + * @author Andreas Kirschbaum + */ +public class TestValidatorPreferences implements ValidatorPreferences { + + /** + * {@inheritDoc} + */ + @Override + public boolean loadEnabled(@NotNull final String key, final boolean defaultEnabled) { + return defaultEnabled; + } + + /** + * {@inheritDoc} + */ + @Override + public void saveEnabled(@NotNull final String key, final boolean enabled) { + // ignore + } + +} // class TestValidatorPreferences Property changes on: trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java (from rev 9120, trunk/model/src/test/net/sf/gridarta/validation/ValidationUtils.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java 2011-12-16 19:26:09 UTC (rev 9121) @@ -0,0 +1,68 @@ +/* + * 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; + +import net.sf.gridarta.model.archetype.TestArchetype; +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.MapWriter; +import net.sf.gridarta.model.io.TestMapArchObjectParserFactory; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapmodel.TestMapModelCreator; +import net.sf.gridarta.model.match.GameObjectMatchers; +import net.sf.gridarta.model.match.NamedGameObjectMatcher; +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.model.validation.checks.ValidatorFactory; +import org.jetbrains.annotations.NotNull; + +/** + * Utility class for helper functions needed be regression tests. + * @author Andreas Kirschbaum + */ +public class ValidationUtils { + + /** + * Private constructor to prevent instantiation. + */ + private ValidationUtils() { + } + + /** + * Creates a new {@link ValidatorFactory} instance. + * @return the new instance + */ + @NotNull + public static ValidatorFactory<TestGameObject, TestMapArchObject, TestArchetype> newValidatorFactory() { + final ValidatorPreferences validatorPreferences = new TestValidatorPreferences(); + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + final GameObjectMatchers gameObjectMatchers = mapModelCreator.getGameObjectMatchers(); + gameObjectMatchers.addGameObjectMatcher(new NamedGameObjectMatcher(0, "matcher", "name", false, null, new TypeNrsGameObjectMatcher(1))); + final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser = mapModelCreator.newGameObjectParser(); + final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); + final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); + final GlobalSettings globalSettings = new TestGlobalSettings(); + return new ValidatorFactory<TestGameObject, TestMapArchObject, TestArchetype>(validatorPreferences, gameObjectMatchers, globalSettings, mapWriter); + } + +} // class ValidationUtils Property changes on: trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.java (from rev 9120, trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.java 2011-12-16 19:26:09 UTC (rev 9121) @@ -0,0 +1,302 @@ +/* + * 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.checks; + +import net.sf.gridarta.model.validation.NoSuchValidatorException; +import net.sf.gridarta.model.validation.ValidationUtils; +import net.sf.gridarta.utils.TestActionBuilder; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Regression tests for {@link net.sf.gridarta.model.validation.checks.ValidatorFactory} + * to create validators. + * @author Andreas Kirschbaum + */ +public class ValidatorFactoryTest { + + /** + * Checks that creating an undefined validator results in an exception. + * @throws NoSuchValidatorException if the test succeeds + */ + @Test(expected = NoSuchValidatorException.class) + public void testNewUndefinedChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("abc"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.AttributeRangeChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewAttributeRangeChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.AttributeRangeChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.BlockedMobOrSpawnPointChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewBlockedMobOrSpawnPointChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.BlockedMobOrSpawnPointChecker 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.BlockedSpawnPointChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewBlockedSpawnPointChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.BlockedSpawnPointChecker 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.ConnectedInsideContainerChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewConnectedInsideContainerChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ConnectedInsideContainerChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.ConnectedPickableChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewConnectedPickableChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ConnectedPickableChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.ConnectionChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewConnectionChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ConnectionChecker matcher matcher matcher"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.CustomTypeChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewCustomTypeChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.CustomTypeChecker 1,2 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.DoubleLayerChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewDoubleLayerChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.DoubleLayerChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.DoubleTypeChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewDoubleTypeChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.DoubleTypeChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewEmptySpawnPointChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.EnvironmentChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewEnvironmentChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.EnvironmentChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.ExitChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewExitChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ExitChecker 1"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.MapDifficultyChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewMapDifficultyChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 2"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewMobOutsideSpawnPointChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.PaidItemShopSquareChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewPaidItemShopSquareChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.PaidItemShopSquareChecker matcher matcher"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.ShopSquareChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewShopSquareChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ShopSquareChecker matcher matcher matcher"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.SlayingChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewSlayingChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.SlayingChecker pattern matcher,pattern"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.SquareWithoutFloorChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewSquareWithoutFloorChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.SquareWithoutFloorChecker 1,2,3"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.SysObjectNotOnLayerZeroChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewSysObjectNotOnLayerZeroChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.SysObjectNotOnLayerZeroChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.TilePathsChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewTilePathsChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.TilePathsChecker 4"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewUndefinedArchetypeChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.UndefinedFaceChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewUndefinedFaceChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.UndefinedFaceChecker"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.UnsetSlayingChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewUnsetSlayingChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.UnsetSlayingChecker 1,2,3 player"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test(expected = NoSuchValidatorException.class) + public void testNewMapCheckerScriptChecker1() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker a b c"); + } + + /** + * Checks that {@link net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewMapCheckerScriptChecker2() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapCheckerScriptChecker a ${MAP} c"); + } + + /** + * Initializes the action builder. + */ + @BeforeClass + public static void setUp() { + TestActionBuilder.initialize(); + } + +} // class ValidatorFactoryTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.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...> - 2011-12-17 06:08:34
|
Revision: 9122 http://gridarta.svn.sourceforge.net/gridarta/?rev=9122&view=rev Author: akirschbaum Date: 2011-12-17 06:08:25 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Split off AnimationObjectsCollectable from DefaultAnimationObjects. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.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 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -488,7 +488,7 @@ @NotNull @Override public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); } } // class DefaultEditorFactory Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; +import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -142,7 +143,7 @@ protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); - collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(faceObjects); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -144,7 +144,7 @@ final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animtree"); + final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); 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 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -400,7 +400,7 @@ @NotNull @Override public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); } } // class DefaultEditorFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -26,6 +26,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -35,6 +36,7 @@ import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.resource.CollectedResourcesWriter; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; @@ -147,7 +149,7 @@ protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); - collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(faceObjects); collectedResourcesWriter.addCollectable(smoothFaces); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -102,7 +102,7 @@ final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animtree"); + final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); archetypeSet = new ArchetypeSet("images", archetypeFactory, faceObjectProviders); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -65,7 +65,7 @@ final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); - animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>("animTreeFile"); + animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); archetype = new DefaultArchetype("arch", faceObjectProviders, animationObjects); } 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 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -488,7 +488,7 @@ @NotNull @Override public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(IGUIConstants.ANIMTREE_FILE); + return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); } } // class DefaultEditorFactory Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; +import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -142,7 +143,7 @@ protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); - collectedResourcesWriter.addCollectable(animationObjects); + collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(faceObjects); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -20,7 +20,6 @@ package net.sf.gridarta.model.anim; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.data.NamedObjects; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; @@ -31,7 +30,7 @@ * AnimationObjects}. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface AnimationObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Collectable<G, A, R>, NamedObjects<AnimationObject> { +public interface AnimationObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends NamedObjects<AnimationObject> { /** * Add an animation object. Modified: trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -19,22 +19,12 @@ 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}. @@ -53,76 +43,10 @@ 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) { + public DefaultAnimationObjects() { 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 the 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 the 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 Added: trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -0,0 +1,128 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.collectable; + +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.anim.AnimationObject; +import net.sf.gridarta.model.anim.AnimationObjects; +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; + +public class AnimationObjectsCollectable<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link AnimationObjects} being collected. + */ + @NotNull + private final AnimationObjects<G, A, R> animationObjects; + + /** + * The collected animation tree file. + */ + @NotNull + private final String animTreeFile; + + /** + * Creates a new instance. + * @param animationObjects the animation objects to be collected + * @param animTreeFile the collected animation tree file + */ + public AnimationObjectsCollectable(@NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final String animTreeFile) { + this.animationObjects = animationObjects; + 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 the 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"), animationObjects.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 : animationObjects) { + 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(animationObjects.size()); + } + + /** + * Collects the animation data into the file "animations". + * @param progress the 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"), animationObjects.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 : animationObjects) { + animtree.append(anim.getPath()).append('\n'); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animtree.close(); + } + progress.setValue(animationObjects.size()); + } + + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java 2011-12-16 19:26:09 UTC (rev 9121) +++ trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java 2011-12-17 06:08:25 UTC (rev 9122) @@ -19,14 +19,9 @@ package net.sf.gridarta.model.anim; -import java.io.File; -import java.io.IOException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.gameobject.TestGameObject; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.TestMapArchObject; -import net.sf.japi.swing.misc.Progress; -import org.jetbrains.annotations.NotNull; /** * An {@link AnimationObjects} for regression tests. @@ -46,12 +41,4 @@ super("anim"); } - /** - * {@inheritDoc} - */ - @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser) throws IOException { - throw new AssertionError(); - } - } // class TestAnimationObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 06:15:29
|
Revision: 9123 http://gridarta.svn.sourceforge.net/gridarta/?rev=9123&view=rev Author: akirschbaum Date: 2011-12-17 06:15:21 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove EditorFactory.newAnimationObjects(). 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/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.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 2011-12-17 06:08:25 UTC (rev 9122) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 06:15:21 UTC (rev 9123) @@ -45,7 +45,6 @@ import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; @@ -482,13 +481,4 @@ return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @NotNull - @Override - public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); - } - } // class DefaultEditorFactory 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 2011-12-17 06:08:25 UTC (rev 9122) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 06:15:21 UTC (rev 9123) @@ -43,7 +43,6 @@ import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; @@ -394,13 +393,4 @@ return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, smoothFaces, archFaceProvider, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @NotNull - @Override - public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); - } - } // class DefaultEditorFactory 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 2011-12-17 06:08:25 UTC (rev 9122) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 06:15:21 UTC (rev 9123) @@ -45,7 +45,6 @@ import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; @@ -482,13 +481,4 @@ return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @NotNull - @Override - public AnimationObjects<GameObject, MapArchObject, Archetype> newAnimationObjects() { - return new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); - } - } // class DefaultEditorFactory Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 06:08:25 UTC (rev 9122) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 06:15:21 UTC (rev 9123) @@ -390,11 +390,4 @@ @NotNull AbstractResources<G, A, R> newResources(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final AnimationObjects<G, A, R> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders); - /** - * Creates a new {@link AnimationObjects} instance. - * @return the new instance - */ - @NotNull - AnimationObjects<G, A, R> newAnimationObjects(); - } // class EditorFactory Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 06:08:25 UTC (rev 9122) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 06:15:21 UTC (rev 9123) @@ -45,6 +45,7 @@ import net.sf.gridarta.gui.scripts.ScriptedEventEditor; import net.sf.gridarta.mainactions.DefaultExiter; import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeFactory; @@ -244,7 +245,7 @@ final int doubleFaceOffset = editorFactory.getDoubleFaceOffset(); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(doubleFaceOffset, faceObjects, systemIcons); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); - final AnimationObjects<G, A, R> animationObjects = editorFactory.newAnimationObjects(); + final AnimationObjects<G, A, R> animationObjects = new DefaultAnimationObjects<G, A, R>(); final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, faceObjectProviders); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 06:31:14
|
Revision: 9124 http://gridarta.svn.sourceforge.net/gridarta/?rev=9124&view=rev Author: akirschbaum Date: 2011-12-17 06:31:05 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Split off FaceObjectsCollectable from DefaultFaceObjects. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.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 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -267,7 +267,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -28,6 +28,7 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; +import net.sf.gridarta.model.collectable.FaceObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -144,7 +145,7 @@ final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); - collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -28,7 +28,6 @@ import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; @@ -139,8 +138,7 @@ @NotNull @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { - final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); 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 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -238,7 +238,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(false); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -27,6 +27,7 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; +import net.sf.gridarta.model.collectable.FaceObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -150,7 +151,7 @@ final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); - collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.addCollectable(smoothFaces); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; @@ -97,8 +96,7 @@ @NotNull @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { - final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(false); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; @@ -60,8 +59,7 @@ * Creates a new instance. */ public GameObjectCreator() { - final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(false); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); 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 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -267,7 +267,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -28,6 +28,7 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; +import net.sf.gridarta.model.collectable.FaceObjectsCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -144,7 +145,7 @@ final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); collectedResourcesWriter.addCollectable(archetypeSet); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); - collectedResourcesWriter.addCollectable(faceObjects); + collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); } Added: trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -0,0 +1,201 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.collectable; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.nio.charset.Charset; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.FaceObject; +import net.sf.gridarta.model.face.FaceObjects; +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.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.misc.Progress; +import org.jetbrains.annotations.NotNull; + +public class FaceObjectsCollectable<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link FaceObjects} being collected. + */ + @NotNull + private final FaceObjects<G, A, R> faceObjects; + + /** + * The {@link ArchFaceProvider} to use for collection. + */ + @NotNull + private final ArchFaceProvider archFaceProvider; + + /** + * Creates a new instance. + * @param faceObjects the face objects to collect + * @param archFaceProvider the arch face provider to use + */ + public FaceObjectsCollectable(@NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final ArchFaceProvider archFaceProvider) { + this.faceObjects = faceObjects; + 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 the 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 int numOfFaceObjects = faceObjects.size(); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectImages"), numOfFaceObjects); + final ByteBuffer byteBuffer = ByteBuffer.allocate(1024); + final Charset charset = Charset.forName("ISO-8859-1"); + int i = 0; + for (final FaceObject faceObject : faceObjects) { + 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(); + byteBuffer.clear(); + byteBuffer.put(("IMAGE " + (faceObjects.isIncludeFaceNumbers() ? i + " " : "") + imageSize + " " + face + "\n").getBytes(charset)); + byteBuffer.flip(); + outChannel.write(byteBuffer); + 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(faceObjects.size()); // finished + } finally { + outChannel.close(); + } + } finally { + fos.close(); + } + } + + /** + * Creates the tree file. + * @param progress the 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 the 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 = faceObjects.size(); + progress.setLabel(label, numOfFaceObjects); + int i = 0; + for (final FaceObject faceObject : faceObjects) { + 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(); + } + } + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -20,21 +20,15 @@ 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.Reader; import java.net.URL; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.nio.charset.Charset; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sf.gridarta.model.archetype.Archetype; @@ -42,14 +36,12 @@ 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; @@ -81,154 +73,19 @@ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); /** - * The {@link ArchFaceProvider} to use for collection. - */ - @NotNull - private final ArchFaceProvider archFaceProvider; - - /** * Whether the face file contains face numbers. */ private final boolean includeFaceNumbers; /** * Creates a new instance. - * @param archFaceProvider the arch face provider to use for collection * @param includeFaceNumbers whether the face file contains face numbers */ - public DefaultFaceObjects(@NotNull final ArchFaceProvider archFaceProvider, final boolean includeFaceNumbers) { + public DefaultFaceObjects(final boolean includeFaceNumbers) { super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfFaceObject")); - this.archFaceProvider = archFaceProvider; this.includeFaceNumbers = includeFaceNumbers; } - /** - * {@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 the 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 int numOfFaceObjects = size(); - progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectImages"), numOfFaceObjects); - final ByteBuffer byteBuffer = ByteBuffer.allocate(1024); - final Charset charset = Charset.forName("ISO-8859-1"); - 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(); - byteBuffer.clear(); - byteBuffer.put(("IMAGE " + (includeFaceNumbers ? i + " " : "") + imageSize + " " + face + "\n").getBytes(charset)); - byteBuffer.flip(); - outChannel.write(byteBuffer); - 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 { - outChannel.close(); - } - } finally { - fos.close(); - } - } - - /** - * Creates the tree file. - * @param progress the 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 the 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) { @@ -373,4 +230,13 @@ return bufOut.toByteArray(); } + /** + * Returns whether the images file contains face numbers. + * @return whether the images file contains face numbers + */ + @Override + public boolean isIncludeFaceNumbers() { + return includeFaceNumbers; + } + } // class DefaultFaceObjects Modified: trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -21,7 +21,6 @@ import java.io.File; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.data.NamedObjects; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.gameobject.GameObject; @@ -32,7 +31,7 @@ * FaceObjects is a container for {@link FaceObject FaceObjects}. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface FaceObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Collectable<G, A, R>, NamedObjects<FaceObject> { +public interface FaceObjects<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends NamedObjects<FaceObject> { /** * Loads all faces from a png collection file. @@ -57,4 +56,10 @@ */ void addFaceObject(String faceName, String originalFilename, int offset, int size) throws DuplicateFaceException, IllegalFaceException; + /** + * Returns whether the images file contains face numbers. + * @return whether the images file contains face numbers + */ + boolean isIncludeFaceNumbers(); + } // interface FaceObjects Modified: trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java 2011-12-17 06:15:21 UTC (rev 9123) +++ trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java 2011-12-17 06:31:05 UTC (rev 9124) @@ -20,13 +20,10 @@ package net.sf.gridarta.model.face; import java.io.File; -import java.io.IOException; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.gameobject.TestGameObject; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.TestMapArchObject; -import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; /** @@ -60,8 +57,8 @@ * {@inheritDoc} */ @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser) throws IOException { - throw new AssertionError(); + public boolean isIncludeFaceNumbers() { + return false; } } // class TestFaceObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 06:48:38
|
Revision: 9125 http://gridarta.svn.sourceforge.net/gridarta/?rev=9125&view=rev Author: akirschbaum Date: 2011-12-17 06:48:30 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Move SmoothFaces into model module. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/model/src/app/net/sf/gridarta/model/smoothface/DuplicateSmoothFaceException.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFace.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFacesLoader.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/smoothface/ Removed Paths: ------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -31,7 +31,7 @@ import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; /** @@ -57,7 +57,7 @@ * The {@link SmoothFaces} to use. */ @NotNull - private final SmoothFaces smoothFaces; + private final SmoothFaces<?, ?, ?> smoothFaces; /** * The {@link GridMapSquarePainter} to use. @@ -95,7 +95,7 @@ * faces * @param systemIcons the system icons for creating icons */ - public DefaultRendererFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final SmoothFaces smoothFaces, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { + public DefaultRendererFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { this.mapViewSettings = mapViewSettings; this.filterControl = filterControl; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -30,7 +30,7 @@ import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; /** @@ -68,7 +68,7 @@ * The {@link SmoothFaces} to use. */ @NotNull - private final SmoothFaces smoothFaces; + private final SmoothFaces<?, ?, ?> smoothFaces; /** * The {@link FaceObjectProviders} for looking up faces. @@ -92,7 +92,7 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - protected SmoothingRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final SmoothFaces smoothFaces, @NotNull final FaceObjectProviders faceObjectProviders) { + protected SmoothingRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final FaceObjectProviders faceObjectProviders) { this.mapModel = mapModel; this.smoothFaces = smoothFaces; this.faceObjectProviders = faceObjectProviders; 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 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -113,7 +113,7 @@ import net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory; import net.sf.gridarta.var.crossfire.model.scripts.DefaultScriptedEventFactory; import net.sf.gridarta.var.crossfire.model.settings.DefaultGlobalSettings; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.resource.DefaultResources; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; @@ -141,7 +141,7 @@ * The {@link SmoothFaces} instance. */ @Nullable - private SmoothFaces smoothFaces = null; + private SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces = null; /** * {@inheritDoc} @@ -249,7 +249,7 @@ if (smoothFaces != null) { throw new IllegalStateException(); } - smoothFaces = new SmoothFaces(faceObjects); + smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects, IGUIConstants.SMOOTH_FILE); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -32,9 +32,9 @@ import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.DuplicateSmoothFaceException; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFace; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.DuplicateSmoothFaceException; +import net.sf.gridarta.model.smoothface.SmoothFace; +import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -81,7 +81,7 @@ * The {@link SmoothFaces} instance to update. */ @NotNull - private final SmoothFaces smoothFaces; + private final SmoothFaces<?, ?, ?> smoothFaces; /** * Creates an ArchetypeParser. @@ -91,7 +91,7 @@ * @param gameObjectFactory the factory for creating game objects * @param smoothFaces the smooth faces instance to update */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces<?, ?, ?> smoothFaces) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -36,8 +36,8 @@ import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFacesLoader; +import net.sf.gridarta.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFacesLoader; import org.jetbrains.annotations.NotNull; /** @@ -56,7 +56,7 @@ * The smooth faces to update. */ @NotNull - private final SmoothFaces smoothFaces; + private final SmoothFaces<?, ?, ?> smoothFaces; /** * Creates a new instance. @@ -68,7 +68,7 @@ * @param animationObjects the animation objects instance * @param smoothFaces the smooth faces to update */ - public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces smoothFaces) { + public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces<?, ?, ?> smoothFaces) { super(collectedDirectory, archetypeSet.getImageSet(), archetypeSet, archetypeParser, animationObjects, faceObjects, IGUIConstants.ANIMTREE_FILE, IGUIConstants.ARCH_FILE); this.configurationDirectory = configurationDirectory; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -41,7 +41,7 @@ import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; @@ -85,7 +85,7 @@ * The {@link SmoothFaces} instance. */ @NotNull - private final SmoothFaces smoothFaces; + private final SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces; /** * The {@link ArchFaceProvider} to use. @@ -112,7 +112,7 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces smoothFaces, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { super(gameObjectParser, archetypeSet, mapViewSettings); this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -31,13 +31,14 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; +import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.io.DefaultGameObjectParser; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.var.crossfire.model.smoothface.SmoothFaces; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import org.jetbrains.annotations.NotNull; @@ -108,7 +109,7 @@ assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); assert archetypeSet != null; - final SmoothFaces smoothFaces = new SmoothFaces(faceObjects); + final SmoothFaces<?, ?, ?> smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects, IGUIConstants.SMOOTH_FILE); assert archetypeSet != null; return new ArchetypeParser(gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, smoothFaces); } Modified: trunk/model/src/app/net/sf/gridarta/model/smoothface/DuplicateSmoothFaceException.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/DuplicateSmoothFaceException.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/model/src/app/net/sf/gridarta/model/smoothface/DuplicateSmoothFaceException.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.var.crossfire.model.smoothface; +package net.sf.gridarta.model.smoothface; import org.jetbrains.annotations.NotNull; Modified: trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFace.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFace.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFace.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.var.crossfire.model.smoothface; +package net.sf.gridarta.model.smoothface; import org.jetbrains.annotations.NotNull; Modified: trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFaces.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.var.crossfire.model.smoothface; +package net.sf.gridarta.model.smoothface; import java.io.BufferedWriter; import java.io.File; @@ -26,15 +26,14 @@ import java.io.OutputStreamWriter; import java.util.Map; import java.util.TreeMap; +import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.face.FaceObject; import net.sf.gridarta.model.face.FaceObjects; +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.IOUtils; -import net.sf.gridarta.var.crossfire.IGUIConstants; -import net.sf.gridarta.var.crossfire.model.archetype.Archetype; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -43,7 +42,7 @@ * Collection of all smoothing information. * @author Andreas Kirschbaum */ -public class SmoothFaces implements Collectable<GameObject, MapArchObject, Archetype> { +public class SmoothFaces<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { /** * The defined {@link SmoothFaces}. @@ -55,22 +54,26 @@ * The {@link FaceObjects} for looking up faces. */ @NotNull - private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; + private final FaceObjects<G, A, R> faceObjects; + @NotNull + private final String smoothFile; + /** * Creates a new instance. * @param faceObjects the face objects for looking up faces */ - public SmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { + public SmoothFaces(@NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final String smoothFile) { this.faceObjects = faceObjects; + this.smoothFile = smoothFile; } /** * {@inheritDoc} */ @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - final FileOutputStream fos = new FileOutputStream(new File(collectedDirectory, IGUIConstants.SMOOTH_FILE)); + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + final FileOutputStream fos = new FileOutputStream(new File(collectedDirectory, smoothFile)); try { final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); try { @@ -117,7 +120,7 @@ * attached smooth face */ @Nullable - public FaceObject getSmoothFace(@NotNull final net.sf.gridarta.model.gameobject.GameObject<?, ?, ?> gameObject) { + public FaceObject getSmoothFace(@NotNull final GameObject<?, ?, ?> gameObject) { String faceName = gameObject.getFaceName(); if (faceName == null) { faceName = gameObject.getArchetype().getFaceName(); Modified: trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFacesLoader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/SmoothFacesLoader.java 2011-12-17 06:31:05 UTC (rev 9124) +++ trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFacesLoader.java 2011-12-17 06:48:30 UTC (rev 9125) @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -package net.sf.gridarta.var.crossfire.model.smoothface; +package net.sf.gridarta.model.smoothface; import java.io.BufferedReader; import java.io.IOException; @@ -30,7 +30,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.utils.IOUtils; -import net.sf.gridarta.var.crossfire.IGUIConstants; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -59,7 +58,7 @@ * @param smoothFaces the smooth faces to update * @param errorView the error view for reporting errors */ - public static void load(@NotNull final URL url, @NotNull final SmoothFaces smoothFaces, @NotNull final ErrorView errorView) { + public static void load(@NotNull final URL url, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final ErrorView errorView) { final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, url); try { final InputStream inputStream = url.openStream(); @@ -91,7 +90,7 @@ * @param errorViewCollector the error view collector for reporting errors * @throws IOException if loadings fails */ - private static void load(@NotNull final String readerName, @NotNull final Reader reader, @NotNull final SmoothFaces smoothFaces, @NotNull final ErrorViewCollector errorViewCollector) throws IOException { + private static void load(@NotNull final String readerName, @NotNull final Reader reader, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final ErrorViewCollector errorViewCollector) throws IOException { int smoothEntries = 0; final BufferedReader bufferedReader = new BufferedReader(reader); try { @@ -102,7 +101,7 @@ } final String[] elements = pattern.split(line); if (elements.length != 2) { - log.warn("Error reading " + IGUIConstants.SMOOTH_FILE + ": " + line); + errorViewCollector.addWarning(ErrorViewCategory.SMOOTH_FILE_INVALID, "syntax error in line " + line); return; } final SmoothFace smoothFace = new SmoothFace(elements[0], elements[1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 07:20:01
|
Revision: 9126 http://gridarta.svn.sourceforge.net/gridarta/?rev=9126&view=rev Author: akirschbaum Date: 2011-12-17 07:19:53 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Split off ArchetypeSetCollectable from ArchetypeSet. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java Added Paths: ----------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -19,13 +19,9 @@ package net.sf.gridarta.var.atrinik.model.archetype; -import java.io.IOException; -import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -45,77 +41,12 @@ * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); + super(archetypeFactory, faceObjectProviders); } /** * {@inheritDoc} */ - @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - writeArchetype(out, archetype, true, gameObjectParser); - - // process the multi-part tails: - int result = 1; - for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - result++; - - out.append("More\n"); - writeArchetype(out, tail, false, gameObjectParser); - } - - return result; - } - - /** - * Writes an {@link Archetype}. - * @param writer the writer to write to - * @param archetype the archetype to write - * @param isHeadPart whether this part is the head part - * @param gameObjectParser the game object parser for writing the inventory - * @throws IOException if an I/O error occurs - */ - private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> archetype, final boolean isHeadPart, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); - - if (archetype.getMultiShapeID() > 0) { - writer.append("mpart_id ").append(Integer.toString(archetype.getMultiShapeID())).append('\n'); - } - if (archetype.getMultiPartNr() > 0) { - writer.append("mpart_nr ").append(Integer.toString(archetype.getMultiPartNr())).append('\n'); - } - - if (archetype.getMsgText() != null) { - writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); - } - - if (isHeadPart) { - // special: add a string-attribute with the display-category - writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); - } - - writer.append(archetype.getObjectText()); - - if (isHeadPart) { - for (final GameObject inv : archetype) { - gameObjectParser.save(writer, inv); - } - } else { - // position of multi relative to head - if (archetype.getMultiX() != 0) { - writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); - } - if (archetype.getMultiY() != 0) { - writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); - } - } - - writer.append("end\n"); - } - - /** - * {@inheritDoc} - */ @Nullable @Override public String getImageSet() { Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -0,0 +1,108 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.var.atrinik.model.collectable; + +import java.io.IOException; +import java.io.Writer; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.var.atrinik.IGUIConstants; +import net.sf.gridarta.var.atrinik.model.archetype.Archetype; +import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; +import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +public class AtrinikArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { + + /** + * Creates a new instance. + * @param archetypeSet the archetype set to collect + */ + public AtrinikArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(archetypeSet, IGUIConstants.ARCH_FILE); + } + + /** + * {@inheritDoc} + */ + @Override + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + writeArchetype(out, archetype, true, gameObjectParser); + + // process the multi-part tails: + int result = 1; + for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + result++; + + out.append("More\n"); + writeArchetype(out, tail, false, gameObjectParser); + } + + return result; + } + + /** + * Writes an {@link Archetype}. + * @param writer the writer to write to + * @param archetype the archetype to write + * @param isHeadPart whether this part is the head part + * @param gameObjectParser the game object parser for writing the inventory + * @throws IOException if an I/O error occurs + */ + private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> archetype, final boolean isHeadPart, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); + + if (archetype.getMultiShapeID() > 0) { + writer.append("mpart_id ").append(Integer.toString(archetype.getMultiShapeID())).append('\n'); + } + if (archetype.getMultiPartNr() > 0) { + writer.append("mpart_nr ").append(Integer.toString(archetype.getMultiPartNr())).append('\n'); + } + + if (archetype.getMsgText() != null) { + writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); + } + + if (isHeadPart) { + // special: add a string-attribute with the display-category + writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); + } + + writer.append(archetype.getObjectText()); + + if (isHeadPart) { + for (final GameObject inv : archetype) { + gameObjectParser.save(writer, inv); + } + } else { + // position of multi relative to head + if (archetype.getMultiX() != 0) { + writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); + } + if (archetype.getMultiY() != 0) { + writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); + } + } + + writer.append("end\n"); + } + +} Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -40,6 +40,7 @@ import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; +import net.sf.gridarta.var.atrinik.model.collectable.AtrinikArchetypeSetCollectable; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import net.sf.japi.swing.misc.Progress; @@ -143,7 +144,7 @@ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(new AtrinikArchetypeSetCollectable(archetypeSet)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -19,13 +19,9 @@ package net.sf.gridarta.var.crossfire.model.archetype; -import java.io.IOException; -import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -52,71 +48,13 @@ * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); + super(archetypeFactory, faceObjectProviders); this.imageSet = imageSet.equals("none") ? null : imageSet; } /** * {@inheritDoc} */ - @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - writeArchetype(out, archetype, true, gameObjectParser); - - // process the multi-part tails: - int result = 1; - for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - result++; - - out.append("More\n"); - writeArchetype(out, tail, false, gameObjectParser); - } - - return result; - } - - /** - * Writes an {@link Archetype}. - * @param writer the writer to write to - * @param archetype the archetype to write - * @param isHeadPart whether this part is the head part - * @param gameObjectParser the game object parser for writing the inventory - * @throws IOException if an I/O error occurs - */ - private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, ?, ?> archetype, final boolean isHeadPart, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); - - if (isHeadPart) { - // special: add a string-attribute with the display-category - writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); - - // add message text - if (archetype.getMsgText() != null) { - writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); - } - } - - writer.append(archetype.getObjectText()); - if (isHeadPart) { - for (final GameObject inv : archetype) { - gameObjectParser.save(writer, inv); - } - } else { - // position of multi relative to head - if (archetype.getMultiX() != 0) { - writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); - } - if (archetype.getMultiY() != 0) { - writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); - } - } - - writer.append("end\n"); - } - - /** - * {@inheritDoc} - */ @Nullable @Override public String getImageSet() { Added: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java (rev 0) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -0,0 +1,101 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.var.crossfire.model.collectable; + +import java.io.IOException; +import java.io.Writer; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.var.crossfire.IGUIConstants; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; +import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +public class CrossfireArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { + + /** + * Creates a new instance. + * @param archetypeSet the archetype set to collect + */ + public CrossfireArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(archetypeSet, IGUIConstants.ARCH_FILE); + } + + /** + * {@inheritDoc} + */ + @Override + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + writeArchetype(out, archetype, true, gameObjectParser); + + // process the multi-part tails: + int result = 1; + for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + result++; + + out.append("More\n"); + writeArchetype(out, tail, false, gameObjectParser); + } + + return result; + } + + /** + * Writes an {@link Archetype}. + * @param writer the writer to write to + * @param archetype the archetype to write + * @param isHeadPart whether this part is the head part + * @param gameObjectParser the game object parser for writing the inventory + * @throws IOException if an I/O error occurs + */ + private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, ?, ?> archetype, final boolean isHeadPart, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); + + if (isHeadPart) { + // special: add a string-attribute with the display-category + writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); + + // add message text + if (archetype.getMsgText() != null) { + writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); + } + } + + writer.append(archetype.getObjectText()); + if (isHeadPart) { + for (final GameObject inv : archetype) { + gameObjectParser.save(writer, inv); + } + } else { + // position of multi relative to head + if (archetype.getMultiX() != 0) { + writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); + } + if (archetype.getMultiY() != 0) { + writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); + } + } + + writer.append("end\n"); + } + +} Property changes on: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -37,11 +37,12 @@ import net.sf.gridarta.model.resource.AbstractResources; import net.sf.gridarta.model.resource.CollectedResourcesWriter; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.collectable.CrossfireArchetypeSetCollectable; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; @@ -149,7 +150,7 @@ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(new CrossfireArchetypeSetCollectable(archetypeSet)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.addCollectable(smoothFaces); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -19,13 +19,9 @@ package net.sf.gridarta.var.daimonin.model.archetype; -import java.io.IOException; -import java.io.Writer; import net.sf.gridarta.model.archetype.AbstractArchetypeSet; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -45,72 +41,12 @@ * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, IGUIConstants.ARCH_FILE, faceObjectProviders); + super(archetypeFactory, faceObjectProviders); } /** * {@inheritDoc} */ - @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { - writeArchetype(out, archetype, true); - - // process the multi-part tails: - int result = 1; - for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - result++; - - out.append("More\n"); - writeArchetype(out, tail, false); - } - - return result; - } - - /** - * Writes an {@link Archetype}. - * @param writer the writer to write to - * @param archetype the archetype to write - * @param isHeadPart whether this part is the head part - * @throws IOException if an I/O error occurs - */ - private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> archetype, final boolean isHeadPart) throws IOException { - writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); - - if (archetype.getMultiShapeID() > 0) { - writer.append("mpart_id ").append(Integer.toString(archetype.getMultiShapeID())).append('\n'); - } - if (archetype.getMultiPartNr() > 0) { - writer.append("mpart_nr ").append(Integer.toString(archetype.getMultiPartNr())).append('\n'); - } - - if (archetype.getMsgText() != null) { - writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); - } - - if (isHeadPart) { - // special: add a string-attribute with the display-category - writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); - } - - writer.append(archetype.getObjectText()); - - if (!isHeadPart) { - // position of multi relative to head - if (archetype.getMultiX() != 0) { - writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); - } - if (archetype.getMultiY() != 0) { - writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); - } - } - - writer.append("end\n"); - } - - /** - * {@inheritDoc} - */ @Nullable @Override public String getImageSet() { Added: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java (rev 0) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -0,0 +1,103 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.var.daimonin.model.collectable; + +import java.io.IOException; +import java.io.Writer; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.var.daimonin.IGUIConstants; +import net.sf.gridarta.var.daimonin.model.archetype.Archetype; +import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; +import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; + +public class DaimoninArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { + + /** + * Creates a new instance. + * @param archetypeSet the archetype set to collect + */ + public DaimoninArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(archetypeSet, IGUIConstants.ARCH_FILE); + } + + /** + * {@inheritDoc} + */ + @Override + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + writeArchetype(out, archetype, true); + + // process the multi-part tails: + int result = 1; + for (Archetype tail = archetype.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + result++; + + out.append("More\n"); + writeArchetype(out, tail, false); + } + + return result; + } + + /** + * Writes an {@link Archetype}. + * @param writer the writer to write to + * @param archetype the archetype to write + * @param isHeadPart whether this part is the head part + * @throws IOException if an I/O error occurs + */ + private static void writeArchetype(@NotNull final Writer writer, @NotNull final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> archetype, final boolean isHeadPart) throws IOException { + writer.append("Object ").append(archetype.getArchetypeName()).append('\n'); + + if (archetype.getMultiShapeID() > 0) { + writer.append("mpart_id ").append(Integer.toString(archetype.getMultiShapeID())).append('\n'); + } + if (archetype.getMultiPartNr() > 0) { + writer.append("mpart_nr ").append(Integer.toString(archetype.getMultiPartNr())).append('\n'); + } + + if (archetype.getMsgText() != null) { + writer.append("msg\n").append(archetype.getMsgText()).append("endmsg\n"); + } + + if (isHeadPart) { + // special: add a string-attribute with the display-category + writer.append("editor_folder ").append(archetype.getEditorFolder()).append('\n'); + } + + writer.append(archetype.getObjectText()); + + if (!isHeadPart) { + // position of multi relative to head + if (archetype.getMultiX() != 0) { + writer.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); + } + if (archetype.getMultiY() != 0) { + writer.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); + } + } + + writer.append("end\n"); + } + +} Property changes on: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -40,6 +40,7 @@ import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; +import net.sf.gridarta.var.daimonin.model.collectable.DaimoninArchetypeSetCollectable; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; import net.sf.japi.swing.misc.Progress; @@ -143,7 +144,7 @@ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(archetypeSet); + collectedResourcesWriter.addCollectable(new DaimoninArchetypeSetCollectable(archetypeSet)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -19,12 +19,6 @@ package net.sf.gridarta.model.archetype; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collection; @@ -36,14 +30,8 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjectProvidersListener; 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.EventListenerList2; -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; /** @@ -53,23 +41,12 @@ public abstract class AbstractArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements ArchetypeSet<G, A, R> { /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The archetype factory to use. */ @NotNull private final ArchetypeFactory<G, A, R> archetypeFactory; /** - * The collected archetype file name. - */ - @NotNull - private final String archFile; - - /** * The defined Archetypes mapped by name. */ private final Map<String, R> archetypeMap = new TreeMap<String, R>(); @@ -105,12 +82,10 @@ /** * Create an AbstractArchetypeSet. * @param archetypeFactory the archetype factory to use - * @param archFile the collected archetypes file name * @param faceObjectProviders the face object providers */ - protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @NotNull final String archFile, @NotNull final FaceObjectProviders faceObjectProviders) { + protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { this.archetypeFactory = archetypeFactory; - this.archFile = archFile; final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { @@ -250,99 +225,4 @@ } } - /** - * {@inheritDoc} Collects the Archetypes. - */ - @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { - final File file = new File(collectedDirectory, archFile); - final FileOutputStream fos = new FileOutputStream(file); - try { - final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); - try { - final BufferedWriter out = new BufferedWriter(osw); - try { - collect(progress, out, gameObjectParser); - } finally { - out.close(); - } - } finally { - osw.close(); - } - } finally { - fos.close(); - } - } - - /** - * Collects the archetypes. - * @param progress the progress to report progress to - * @param writer the writer to write the archetypes to - * @param gameObjectParser the game object parser for writing inventory game - * objects - * @throws IOException in case of I/O problems during collection - */ - private void collect(@NotNull final Progress progress, @NotNull final Writer writer, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { - progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectArches"), archetypes.size()); - int artifactCount = 0; - int count = 0; - for (final R archetype : archetypes) { - if (archetype.isArtifact()) { - artifactCount++; - continue; - } - if (archetype.isUndefinedArchetype()) { - continue; - } - - if (archetype.isTail()) { - continue; - } - - if (archetype.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { - collectStartArch(archetype, writer); - count++; - } else { - count += collectArchetype(archetype, writer, gameObjectParser); - } - - if (count % 100 == 0) { - progress.setValue(count); - } - } - - if ((count + artifactCount) - getArchetypeCount() != 0) { - ACTION_BUILDER.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count - artifactCount); - } - progress.setValue(archetypes.size()); - } - - /** - * Processes the special archetype {@link ArchetypeParser#START_ARCH_NAME}. - * @param archetype the archetype - * @param out the writer collecting into - * @throws IOException if an I/O error occurs - */ - private static void collectStartArch(@NotNull final Archetype<?, ?, ?> archetype, @NotNull final Writer out) throws IOException { - out.append("Object ").append(archetype.getArchetypeName()).append('\n'); - - if (archetype.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { - out.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); - out.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); - } - - out.append(archetype.getObjectText()); - - out.append("end\n"); - } - - /** - * Collects an {@link Archetype}: writes its definition into a writer. - * @param archetype the archetype - * @param out the writer - * @return the number of archetype parts written - * @throws IOException if an I/O error occurs - */ - protected abstract int collectArchetype(@NotNull final R archetype, @NotNull final Writer out, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException; - } // class AbstractArchetypeSet Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -20,7 +20,6 @@ package net.sf.gridarta.model.archetype; import java.util.Collection; -import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -31,7 +30,7 @@ * implementations. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface ArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends Collectable<G, A, R> { +public interface ArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** * Returns whether the Archetypes in this ArchetypeSet were loaded from an Added: trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -0,0 +1,167 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.collectable; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.Collection; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetype.ArchetypeParser; +import net.sf.gridarta.model.archetype.ArchetypeSet; +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; + +public abstract class AbstractArchetypeSetCollectable<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link ArchetypeSet} being collected. + */ + @NotNull + private final ArchetypeSet<G, A, R> archetypeSet; + + /** + * The collected archetype file name. + */ + @NotNull + private final String archFile; + + /** + * Creates a new instance. + * @param archetypeSet the archetype set to collect + * @param archFile the collected archetypes file name + */ + protected AbstractArchetypeSetCollectable(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final String archFile) { + this.archetypeSet = archetypeSet; + this.archFile = archFile; + } + + /** + * {@inheritDoc} Collects the Archetypes. + */ + @Override + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + final File file = new File(collectedDirectory, archFile); + final FileOutputStream fos = new FileOutputStream(file); + try { + final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); + try { + final BufferedWriter out = new BufferedWriter(osw); + try { + collect(progress, out, gameObjectParser); + } finally { + out.close(); + } + } finally { + osw.close(); + } + } finally { + fos.close(); + } + } + + /** + * Collects the archetypes. + * @param progress the progress to report progress to + * @param writer the writer to write the archetypes to + * @param gameObjectParser the game object parser for writing inventory game + * objects + * @throws IOException in case of I/O problems during collection + */ + private void collect(@NotNull final Progress progress, @NotNull final Writer writer, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + final Collection<R> archetypes = archetypeSet.getArchetypes(); + progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectArches"), archetypes.size()); + int artifactCount = 0; + int count = 0; + for (final R archetype : archetypes) { + if (archetype.isArtifact()) { + artifactCount++; + continue; + } + if (archetype.isUndefinedArchetype()) { + continue; + } + + if (archetype.isTail()) { + continue; + } + + if (archetype.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { + collectStartArch(archetype, writer); + count++; + } else { + count += collectArchetype(archetype, writer, gameObjectParser); + } + + if (count % 100 == 0) { + progress.setValue(count); + } + } + + if ((count + artifactCount) - archetypeSet.getArchetypeCount() != 0) { + ACTION_BUILDER.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", archetypeSet.getArchetypeCount() - count - artifactCount); + } + progress.setValue(archetypes.size()); + } + + /** + * Processes the special archetype {@link ArchetypeParser#START_ARCH_NAME}. + * @param archetype the archetype + * @param out the writer collecting into + * @throws IOException if an I/O error occurs + */ + private static void collectStartArch(@NotNull final Archetype<?, ?, ?> archetype, @NotNull final Writer out) throws IOException { + out.append("Object ").append(archetype.getArchetypeName()).append('\n'); + + if (archetype.getArchetypeName().equals(ArchetypeParser.START_ARCH_NAME)) { + out.append("x ").append(Integer.toString(archetype.getMultiX())).append('\n'); + out.append("y ").append(Integer.toString(archetype.getMultiY())).append('\n'); + } + + out.append(archetype.getObjectText()); + + out.append("end\n"); + } + + /** + * Collects an {@link Archetype}: writes its definition into a writer. + * @param archetype the archetype + * @param out the writer + * @return the number of archetype parts written + * @throws IOException if an I/O error occurs + */ + protected abstract int collectArchetype(@NotNull final R archetype, @NotNull final Writer out, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException; + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -194,7 +194,7 @@ final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final TestArchetypeFactory archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); + archetypeSet = new TestArchetypeSet(archetypeFactory, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; return new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -19,11 +19,8 @@ package net.sf.gridarta.model.archetype; -import java.io.IOException; -import java.io.Writer; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.TestGameObject; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -37,24 +34,15 @@ /** * Create an AbstractArchetypeSet. * @param archetypeFactory the archetype factory to use - * @param archFile the collected archetypes file name * @param faceObjectProviders the face object providers */ - public TestArchetypeSet(@NotNull final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory, @NotNull final String archFile, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, archFile, faceObjectProviders); + public TestArchetypeSet(@NotNull final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + super(archetypeFactory, faceObjectProviders); } /** * {@inheritDoc} */ - @Override - protected int collectArchetype(@NotNull final TestArchetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser) throws IOException { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ @Nullable @Override public String getImageSet() { Modified: trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -105,7 +105,7 @@ final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new TestFaceObjects(); faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); - archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); + archetypeSet = new TestArchetypeSet(archetypeFactory, faceObjectProviders); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, TestArchetypeBuilder> archetypeParser = new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); final List<TestGameObject> invObjects = new ArrayList<TestGameObject>(); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -143,7 +143,7 @@ final FaceObjects<TestGameObject, TestMapArchObject, TestArchetype> faceObjects = new TestFaceObjects(); faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes", faceObjectProviders); + archetypeSet = new TestArchetypeSet(archetypeFactory, faceObjectProviders); gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); topmostInsertionMode = new TopmostInsertionMode<TestGameObject, TestMapArchObject, TestArchetype>(); insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode, new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); Modified: trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java 2011-12-17 06:48:30 UTC (rev 9125) +++ trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java 2011-12-17 07:19:53 UTC (rev 9126) @@ -167,7 +167,7 @@ final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); - final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new TestArchetypeSet(archetypeFactory, new File(collectedDirectory, "archetypes").getPath(), faceObjectProviders); + final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new TestArchetypeSet(archetypeFactory, faceObjectProviders); final AnimationObjects<TestGameObject, TestMapArchObject, TestArchetype> animationObjects = new TestAnimationObjects(); final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 07:26:07
|
Revision: 9127 http://gridarta.svn.sourceforge.net/gridarta/?rev=9127&view=rev Author: akirschbaum Date: 2011-12-17 07:26:00 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) @@ -25,7 +25,6 @@ import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -41,16 +40,7 @@ * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, faceObjectProviders); + super(archetypeFactory, null, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getImageSet() { - return null; - } - } // class ArchetypeSet Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) @@ -25,7 +25,6 @@ import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -36,29 +35,13 @@ public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { /** - * The image set to use. - */ - @Nullable - private final String imageSet; - - /** * Create the ArchetypeSet. * @param imageSet the image set to use * @param archetypeFactory the archetype factory to use * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, faceObjectProviders); - this.imageSet = imageSet.equals("none") ? null : imageSet; + super(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getImageSet() { - return imageSet; - } - } // class ArchetypeSet Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) @@ -25,7 +25,6 @@ import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * The <code>ArchetypeSet</code> contains all the Archetypes. @@ -41,16 +40,7 @@ * @param faceObjectProviders the face object providers */ public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, faceObjectProviders); + super(archetypeFactory, null, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getImageSet() { - return null; - } - } // class ArchetypeSet Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) @@ -33,6 +33,7 @@ import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.utils.EventListenerList2; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Base implementation of ArchetypeSet. @@ -47,6 +48,12 @@ private final ArchetypeFactory<G, A, R> archetypeFactory; /** + * The image set to use. + */ + @Nullable + private final String imageSet; + + /** * The defined Archetypes mapped by name. */ private final Map<String, R> archetypeMap = new TreeMap<String, R>(); @@ -82,10 +89,12 @@ /** * Create an AbstractArchetypeSet. * @param archetypeFactory the archetype factory to use + * @param imageSet the image set to use * @param faceObjectProviders the face object providers */ - protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + protected AbstractArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @Nullable final String imageSet, @NotNull final FaceObjectProviders faceObjectProviders) { this.archetypeFactory = archetypeFactory; + this.imageSet = imageSet; final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { @@ -101,7 +110,16 @@ /** * {@inheritDoc} */ + @Nullable @Override + public String getImageSet() { + return imageSet; + } + + /** + * {@inheritDoc} + */ + @Override public boolean isLoadedFromArchive() { return loadedFromArchive; } Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2011-12-17 07:19:53 UTC (rev 9126) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * An {@link ArchetypeSet} implementation for testing purposes. @@ -37,16 +36,7 @@ * @param faceObjectProviders the face object providers */ public TestArchetypeSet(@NotNull final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, faceObjectProviders); + super(archetypeFactory, null, faceObjectProviders); } - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getImageSet() { - return null; - } - } // class TestArchetypeSet This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 07:43:49
|
Revision: 9128 http://gridarta.svn.sourceforge.net/gridarta/?rev=9128&view=rev Author: akirschbaum Date: 2011-12-17 07:43:37 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove unneeded code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.java Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.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 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -47,6 +47,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -107,7 +109,6 @@ import net.sf.gridarta.var.atrinik.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.atrinik.model.archetype.ArchetypeSet; import net.sf.gridarta.var.atrinik.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; @@ -177,7 +178,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -221,7 +222,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -248,8 +249,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); } /** @@ -363,7 +364,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -387,7 +388,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "sub_type", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -468,7 +469,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -477,7 +478,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -1,46 +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.var.atrinik.model.archetype; - -import net.sf.gridarta.model.archetype.AbstractArchetypeSet; -import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; -import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>ArchetypeSet</code> contains all the Archetypes. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { - - /** - * Create the ArchetypeSet. - * @param archetypeFactory the archetype factory instance to use - * @param faceObjectProviders the face object providers - */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, null, faceObjectProviders); - } - -} // class ArchetypeSet Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -25,6 +25,8 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; @@ -58,7 +60,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; /** * Checks that mpart_id fields are parsed correctly. @@ -146,7 +148,7 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); @@ -163,7 +165,7 @@ @NotNull @Override @SuppressWarnings("NullableProblems") - protected ArchetypeSet getArchetypeSet() { + protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { if (archetypeSet == null) { throw new IllegalStateException(); } 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 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -45,6 +45,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -81,6 +83,7 @@ import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; @@ -102,7 +105,6 @@ import net.sf.gridarta.var.crossfire.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.crossfire.model.archetype.ArchetypeSet; import net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; @@ -113,7 +115,6 @@ import net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory; import net.sf.gridarta.var.crossfire.model.scripts.DefaultScriptedEventFactory; import net.sf.gridarta.var.crossfire.model.settings.DefaultGlobalSettings; -import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.resource.DefaultResources; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; @@ -148,7 +149,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -192,7 +193,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -219,8 +220,9 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + final String imageSet = globalSettings.getImageSet(); + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); } /** @@ -271,7 +273,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -292,7 +294,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "subtype", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -377,7 +379,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapModelFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -386,7 +388,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { if (smoothFaces == null) { throw new IllegalStateException(); } Deleted: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -1,47 +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.var.crossfire.model.archetype; - -import net.sf.gridarta.model.archetype.AbstractArchetypeSet; -import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>ArchetypeSet</code> contains all the Archetypes. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { - - /** - * Create the ArchetypeSet. - * @param imageSet the image set to use - * @param archetypeFactory the archetype factory to use - * @param faceObjectProviders the face object providers - */ - public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); - } - -} // class ArchetypeSet Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -25,6 +25,8 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.DefaultFaceObjects; @@ -57,7 +59,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; /** * Checks that inventory game objects are recognized. @@ -104,7 +106,7 @@ final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new ArchetypeSet("images", archetypeFactory, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, "images", faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); @@ -120,7 +122,7 @@ @NotNull @Override @SuppressWarnings("NullableProblems") - protected ArchetypeSet getArchetypeSet() { + protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { if (archetypeSet == null) { throw new IllegalStateException(); } 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 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -47,6 +47,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -107,7 +109,6 @@ import net.sf.gridarta.var.daimonin.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.daimonin.model.archetype.ArchetypeSet; import net.sf.gridarta.var.daimonin.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.daimonin.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -177,7 +178,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -221,7 +222,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -248,8 +249,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); } /** @@ -363,7 +364,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -387,7 +388,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "sub_type", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -468,7 +469,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, ... [truncated message content] |
From: <aki...@us...> - 2011-12-17 07:49:30
|
Revision: 9129 http://gridarta.svn.sourceforge.net/gridarta/?rev=9129&view=rev Author: akirschbaum Date: 2011-12-17 07:49:23 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Simplify 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/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.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 2011-12-17 07:43:37 UTC (rev 9128) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 07:49:23 UTC (rev 9129) @@ -60,7 +60,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.exitconnector.ExitConnectorModel; import net.sf.gridarta.model.face.ArchFaceProvider; -import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObjectFactory; @@ -265,10 +264,9 @@ /** * {@inheritDoc} */ - @NotNull @Override - public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); + public boolean getIncludeFaceNumbers() { + return true; } /** 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 2011-12-17 07:43:37 UTC (rev 9128) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 07:49:23 UTC (rev 9129) @@ -57,7 +57,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.exitconnector.ExitConnectorModel; import net.sf.gridarta.model.face.ArchFaceProvider; -import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObjectFactory; @@ -237,10 +236,9 @@ /** * {@inheritDoc} */ - @NotNull @Override - public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(false); + public boolean getIncludeFaceNumbers() { + return false; } /** 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 2011-12-17 07:43:37 UTC (rev 9128) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 07:49:23 UTC (rev 9129) @@ -60,7 +60,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.exitconnector.ExitConnectorModel; import net.sf.gridarta.model.face.ArchFaceProvider; -import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObjectFactory; @@ -265,10 +264,9 @@ /** * {@inheritDoc} */ - @NotNull @Override - public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); + public boolean getIncludeFaceNumbers() { + return true; } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 07:49:23 UTC (rev 9129) @@ -198,12 +198,10 @@ MapControlFactory<G, A, R> newMapControlFactory(@NotNull MapWriter<G, A, R> mapWriter, @NotNull GlobalSettings globalSettings, @NotNull MapModelFactory<G, A, R> mapModelFactory); /** - * Creates a new {@link FaceObjects} instance. - * @param archFaceProvider the arch face provider to use - * @return the new instance + * Returns whether the face file contains face numbers. + * @return whether the face file contains face numbers */ - @NotNull - FaceObjects<G, A, R> createFaceObjects(@NotNull ArchFaceProvider archFaceProvider); + boolean getIncludeFaceNumbers(); /** * Initializes smoothing information. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 07:43:37 UTC (rev 9128) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 07:49:23 UTC (rev 9129) @@ -57,6 +57,7 @@ import net.sf.gridarta.model.configsource.DefaultConfigSourceFactory; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.filter.NamedFilter; @@ -240,7 +241,7 @@ final PathManager pathManager = new PathManager(globalSettings); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<G, A, R> faceObjects = editorFactory.createFaceObjects(archFaceProvider); + final FaceObjects<G, A, R> faceObjects = new DefaultFaceObjects<G, A, R>(editorFactory.getIncludeFaceNumbers()); editorFactory.initSmoothFaces(faceObjects); final int doubleFaceOffset = editorFactory.getDoubleFaceOffset(); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(doubleFaceOffset, faceObjects, systemIcons); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 08:10:50
|
Revision: 9131 http://gridarta.svn.sourceforge.net/gridarta/?rev=9131&view=rev Author: akirschbaum Date: 2011-12-17 08:10:43 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Split off SmoothFacesCollectable from SmoothFaces. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 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 2011-12-17 07:49:59 UTC (rev 9130) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 08:10:43 UTC (rev 9131) @@ -249,7 +249,7 @@ if (smoothFaces != null) { throw new IllegalStateException(); } - smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects, IGUIConstants.SMOOTH_FILE); + smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 07:49:59 UTC (rev 9130) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 08:10:43 UTC (rev 9131) @@ -28,6 +28,7 @@ import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.collectable.FaceObjectsCollectable; +import net.sf.gridarta.model.collectable.SmoothFacesCollectable; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -153,7 +154,7 @@ collectedResourcesWriter.addCollectable(new CrossfireArchetypeSetCollectable(archetypeSet)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); - collectedResourcesWriter.addCollectable(smoothFaces); + collectedResourcesWriter.addCollectable(new SmoothFacesCollectable<GameObject, MapArchObject, Archetype>(smoothFaces, IGUIConstants.SMOOTH_FILE)); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 07:49:59 UTC (rev 9130) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 08:10:43 UTC (rev 9131) @@ -36,7 +36,6 @@ import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; -import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.io.DefaultGameObjectParser; @@ -111,7 +110,7 @@ assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); assert archetypeSet != null; - final SmoothFaces<?, ?, ?> smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects, IGUIConstants.SMOOTH_FILE); + final SmoothFaces<?, ?, ?> smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects); assert archetypeSet != null; return new ArchetypeParser(gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, smoothFaces); } Added: trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) @@ -0,0 +1,89 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.collectable; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.util.Map; +import net.sf.gridarta.model.archetype.Archetype; +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.model.smoothface.SmoothFace; +import net.sf.gridarta.model.smoothface.SmoothFaces; +import net.sf.gridarta.utils.IOUtils; +import net.sf.japi.swing.misc.Progress; +import org.jetbrains.annotations.NotNull; + +public class SmoothFacesCollectable<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { + + /** + * The {@link SmoothFaces} being collected. + */ + @NotNull + private final SmoothFaces<G, A, R> smoothFaces; + + /** + * The smooth file to write to. + */ + @NotNull + private final String smoothFile; + + /** + * Creates a new instance. + * @param smoothFaces the smooth faces to collect + * @param smoothFile the smooth file to write to + */ + public SmoothFacesCollectable(@NotNull final SmoothFaces<G, A, R> smoothFaces, @NotNull final String smoothFile) { + this.smoothFaces = smoothFaces; + this.smoothFile = smoothFile; + } + + /** + * {@inheritDoc} + */ + @Override + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + final FileOutputStream fos = new FileOutputStream(new File(collectedDirectory, smoothFile)); + try { + final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); + try { + final BufferedWriter out = new BufferedWriter(osw); + try { + out.append("default_smoothed.111 sdefault.001\n"); + for (final Map.Entry<String, SmoothFace> e : smoothFaces) { + final SmoothFace smoothFace = e.getValue(); + out.append(smoothFace.getFace()).append(' ').append(smoothFace.getValue()).append('\n'); + } + } finally { + out.close(); + } + } finally { + osw.close(); + } + } finally { + fos.close(); + } + } + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java 2011-12-17 07:49:59 UTC (rev 9130) +++ trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java 2011-12-17 08:10:43 UTC (rev 9131) @@ -19,22 +19,15 @@ package net.sf.gridarta.model.smoothface; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; +import java.util.Collections; +import java.util.Iterator; import java.util.Map; import java.util.TreeMap; import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.face.FaceObject; import net.sf.gridarta.model.face.FaceObjects; 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.IOUtils; -import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -42,7 +35,7 @@ * Collection of all smoothing information. * @author Andreas Kirschbaum */ -public class SmoothFaces<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable<G, A, R> { +public class SmoothFaces<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Iterable<Map.Entry<String, SmoothFace>> { /** * The defined {@link SmoothFaces}. @@ -56,46 +49,15 @@ @NotNull private final FaceObjects<G, A, R> faceObjects; - @NotNull - private final String smoothFile; - /** * Creates a new instance. * @param faceObjects the face objects for looking up faces */ - public SmoothFaces(@NotNull final FaceObjects<G, A, R> faceObjects, @NotNull final String smoothFile) { + public SmoothFaces(@NotNull final FaceObjects<G, A, R> faceObjects) { this.faceObjects = faceObjects; - this.smoothFile = smoothFile; } /** - * {@inheritDoc} - */ - @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { - final FileOutputStream fos = new FileOutputStream(new File(collectedDirectory, smoothFile)); - try { - final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); - try { - final BufferedWriter out = new BufferedWriter(osw); - try { - out.append("default_smoothed.111 sdefault.001\n"); - for (final Map.Entry<String, SmoothFace> e : smoothFaces.entrySet()) { - final SmoothFace smoothFace = e.getValue(); - out.append(smoothFace.getFace()).append(' ').append(smoothFace.getValue()).append('\n'); - } - } finally { - out.close(); - } - } finally { - osw.close(); - } - } finally { - fos.close(); - } - } - - /** * Adds a {@link SmoothFace} instance. * @param smoothFace the smooth face instance * @throws DuplicateSmoothFaceException if the smooth face is not unique @@ -135,4 +97,13 @@ return faceObjects.get(smoothFace.getValue()); } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public Iterator<Map.Entry<String, SmoothFace>> iterator() { + return Collections.unmodifiableMap(smoothFaces).entrySet().iterator(); + } + } // class SmoothFaces This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 08:18:37
|
Revision: 9132 http://gridarta.svn.sourceforge.net/gridarta/?rev=9132&view=rev Author: akirschbaum Date: 2011-12-17 08:18:29 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove dependency Collectable -> GameObjectParser. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -35,9 +35,11 @@ /** * Creates a new instance. * @param archetypeSet the archetype set to collect + * @param gameObjectParser the game object parser for writing inventory game + * objects */ - public AtrinikArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(archetypeSet, IGUIConstants.ARCH_FILE); + public AtrinikArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { + super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -143,8 +143,8 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(new AtrinikArchetypeSetCollectable(archetypeSet)); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(); + collectedResourcesWriter.addCollectable(new AtrinikArchetypeSetCollectable(archetypeSet, gameObjectParser)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -35,9 +35,11 @@ /** * Creates a new instance. * @param archetypeSet the archetype set to collect + * @param gameObjectParser the game object parser for writing inventory game + * objects */ - public CrossfireArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(archetypeSet, IGUIConstants.ARCH_FILE); + public CrossfireArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { + super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -150,8 +150,8 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(new CrossfireArchetypeSetCollectable(archetypeSet)); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(); + collectedResourcesWriter.addCollectable(new CrossfireArchetypeSetCollectable(archetypeSet, gameObjectParser)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.addCollectable(new SmoothFacesCollectable<GameObject, MapArchObject, Archetype>(smoothFaces, IGUIConstants.SMOOTH_FILE)); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -35,9 +35,11 @@ /** * Creates a new instance. * @param archetypeSet the archetype set to collect + * @param gameObjectParser the game object parser for writing inventory game + * objects */ - public DaimoninArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - super(archetypeSet, IGUIConstants.ARCH_FILE); + public DaimoninArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { + super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -143,8 +143,8 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(gameObjectParser); - collectedResourcesWriter.addCollectable(new DaimoninArchetypeSetCollectable(archetypeSet)); + final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(); + collectedResourcesWriter.addCollectable(new DaimoninArchetypeSetCollectable(archetypeSet, gameObjectParser)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -59,20 +59,29 @@ private final String archFile; /** + * The {@link GameObjectParser} for writing inventory game objects. + */ + @NotNull + private final GameObjectParser<G, A, R> gameObjectParser; + + /** * Creates a new instance. * @param archetypeSet the archetype set to collect * @param archFile the collected archetypes file name + * @param gameObjectParser the game object parser for writing inventory game + * objects */ - protected AbstractArchetypeSetCollectable(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final String archFile) { + protected AbstractArchetypeSetCollectable(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final String archFile, @NotNull final GameObjectParser<G, A, R> gameObjectParser) { this.archetypeSet = archetypeSet; this.archFile = archFile; + this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} Collects the Archetypes. */ @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final File file = new File(collectedDirectory, archFile); final FileOutputStream fos = new FileOutputStream(file); try { Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -29,7 +29,6 @@ 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; @@ -73,7 +72,7 @@ * "animtree". */ @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { collectAnimations(progress, collectedDirectory); collectAnimTree(progress, collectedDirectory); } Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -23,7 +23,6 @@ import java.io.IOException; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; @@ -40,10 +39,8 @@ * Collect information. * @param progress Progress to report progress to. * @param collectedDirectory the destination directory to collect data to - * @param gameObjectParser the game object parser for writing inventory game - * objects * @throws IOException in case of I/O problems during collection */ - void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException; + void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException; } // interface Collectable Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -34,7 +34,6 @@ import net.sf.gridarta.model.face.FaceObject; import net.sf.gridarta.model.face.FaceObjects; 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.japi.swing.action.ActionBuilder; @@ -80,7 +79,7 @@ * 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 { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { collectTreeFile(progress, collectedDirectory); collectBmapsFile(progress, collectedDirectory); collectImageFile(progress, collectedDirectory); Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -27,7 +27,6 @@ import java.util.Map; import net.sf.gridarta.model.archetype.Archetype; 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.model.smoothface.SmoothFace; import net.sf.gridarta.model.smoothface.SmoothFaces; @@ -63,7 +62,7 @@ * {@inheritDoc} */ @Override - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final FileOutputStream fos = new FileOutputStream(new File(collectedDirectory, smoothFile)); try { final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); Modified: trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2011-12-17 08:10:43 UTC (rev 9131) +++ trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java 2011-12-17 08:18:29 UTC (rev 9132) @@ -26,7 +26,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.collectable.Collectable; import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; @@ -44,21 +43,6 @@ private final Collection<Collectable<G, A, R>> collectables = new ArrayList<Collectable<G, A, R>>(); /** - * The {@link GameObjectParser} for writing inventory game objects. - */ - @NotNull - private final GameObjectParser<G, A, R> gameObjectParser; - - /** - * Creates a new instance. - * @param gameObjectParser the game object parser for writing inventory game - * objects - */ - public CollectedResourcesWriter(@NotNull final GameObjectParser<G, A, R> gameObjectParser) { - this.gameObjectParser = gameObjectParser; - } - - /** * Adds a {@link Collectable} resource. * @param collectable the collectable resource */ @@ -74,7 +58,7 @@ */ public void write(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { for (final Collectable<G, A, R> collectable : collectables) { - collectable.collect(progress, collectedDirectory, gameObjectParser); + collectable.collect(progress, collectedDirectory); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 10:47:03
|
Revision: 9133 http://gridarta.svn.sourceforge.net/gridarta/?rev=9133&view=rev Author: akirschbaum Date: 2011-12-17 10:46:51 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove unneeded type parameters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetypeFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/anim/AbstractAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationValidator.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java trunk/model/src/app/net/sf/gridarta/model/face/AbstractFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractCollectedResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFacesLoader.java trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java trunk/model/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/FaceTab.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.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 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 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -212,7 +212,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); } @@ -239,7 +239,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -273,7 +273,7 @@ * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { } /** @@ -362,7 +362,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -467,7 +467,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -476,7 +476,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -78,7 +78,7 @@ * @param multiPositionData the multi position data to query for multi-part * objects */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.multiPositionData = multiPositionData; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); setEditorFolder(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -46,7 +46,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * The {@link ArchetypeTypeSet} for looking up archetype types. @@ -61,7 +61,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; this.archetypeTypeSet = archetypeTypeSet; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -63,7 +63,7 @@ * @param archetypeTypeSet the archetype type set for looking up archetype * types */ - public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { super(archetype, faceObjectProviders, animationObjects); this.archetypeTypeSet = archetypeTypeSet; } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -48,7 +48,7 @@ * @param faceObjects the face objects instance * @param animationObjects the animation objects instance */ - public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { super(collectedDirectory, null, archetypeSet, archetypeParser, animationObjects, faceObjects, IGUIConstants.ANIMTREE_FILE, IGUIConstants.ARCH_FILE); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -74,13 +74,13 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; + private final FaceObjects faceObjects; /** * The {@link AnimationObjects} instance. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * The {@link ArchFaceProvider} to use. @@ -106,7 +106,7 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { super(gameObjectParser, archetypeSet, mapViewSettings); this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; @@ -143,10 +143,10 @@ */ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final CollectedResourcesWriter<GameObject, MapArchObject, Archetype> collectedResourcesWriter = new CollectedResourcesWriter<GameObject, MapArchObject, Archetype>(); + final CollectedResourcesWriter collectedResourcesWriter = new CollectedResourcesWriter(); collectedResourcesWriter.addCollectable(new AtrinikArchetypeSetCollectable(archetypeSet, gameObjectParser)); - collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable<GameObject, MapArchObject, Archetype>(animationObjects, IGUIConstants.ANIMTREE_FILE)); - collectedResourcesWriter.addCollectable(new FaceObjectsCollectable<GameObject, MapArchObject, Archetype>(faceObjects, archFaceProvider)); + collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable(animationObjects, IGUIConstants.ANIMTREE_FILE)); + collectedResourcesWriter.addCollectable(new FaceObjectsCollectable(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -62,7 +62,7 @@ * @param animationObjects the animation objects instance * @param archFaceProvider the arch face provider to use */ - public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { + public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archFaceProvider = archFaceProvider; Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -140,11 +140,11 @@ @NotNull @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(true); + final FaceObjects faceObjects = new DefaultFaceObjects(true); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); + final AnimationObjects animationObjects = new DefaultAnimationObjects(); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -57,7 +57,7 @@ * The {@link SmoothFaces} to use. */ @NotNull - private final SmoothFaces<?, ?, ?> smoothFaces; + private final SmoothFaces smoothFaces; /** * The {@link GridMapSquarePainter} to use. @@ -95,7 +95,7 @@ * faces * @param systemIcons the system icons for creating icons */ - public DefaultRendererFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { + public DefaultRendererFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final SmoothFaces smoothFaces, @NotNull final GridMapSquarePainter gridMapSquarePainter, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final SystemIcons systemIcons) { this.mapViewSettings = mapViewSettings; this.filterControl = filterControl; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -68,7 +68,7 @@ * The {@link SmoothFaces} to use. */ @NotNull - private final SmoothFaces<?, ?, ?> smoothFaces; + private final SmoothFaces smoothFaces; /** * The {@link FaceObjectProviders} for looking up faces. @@ -92,7 +92,7 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - protected SmoothingRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final SmoothFaces<?, ?, ?> smoothFaces, @NotNull final FaceObjectProviders faceObjectProviders) { + protected SmoothingRenderer(@NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, @NotNull final SmoothFaces smoothFaces, @NotNull final FaceObjectProviders faceObjectProviders) { this.mapModel = mapModel; this.smoothFaces = smoothFaces; this.faceObjectProviders = faceObjectProviders; 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 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -141,7 +141,7 @@ * The {@link SmoothFaces} instance. */ @Nullable - private SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces = null; + private SmoothFaces smoothFaces = null; /** * {@inheritDoc} @@ -183,7 +183,7 @@ */ @NotNull @Override - public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { + public GameObjectFactory<GameObject, MapArchObject, Archetype> newGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeTypeSet archetypeTypeSet) { return new DefaultGameObjectFactory(faceObjectProviders, animationObjects); } @@ -210,7 +210,7 @@ */ @NotNull @Override - public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public ArchetypeFactory<GameObject, MapArchObject, Archetype> newArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { return new DefaultArchetypeFactory(faceObjectProviders, animationObjects); } @@ -245,11 +245,11 @@ * {@inheritDoc} */ @Override - public void initSmoothFaces(@NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects) { + public void initSmoothFaces(@NotNull final FaceObjects faceObjects) { if (smoothFaces != null) { throw new IllegalStateException(); } - smoothFaces = new SmoothFaces<GameObject, MapArchObject, Archetype>(faceObjects); + smoothFaces = new SmoothFaces(faceObjects); } /** @@ -271,7 +271,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -377,7 +377,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapModelFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -386,7 +386,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { if (smoothFaces == null) { throw new IllegalStateException(); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -81,7 +81,7 @@ * The {@link SmoothFaces} instance to update. */ @NotNull - private final SmoothFaces<?, ?, ?> smoothFaces; + private final SmoothFaces smoothFaces; /** * Creates an ArchetypeParser. @@ -91,7 +91,7 @@ * @param gameObjectFactory the factory for creating game objects * @param smoothFaces the smooth faces instance to update */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces<?, ?, ?> smoothFaces) { + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); this.gameObjectParser = gameObjectParser; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -44,7 +44,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public DefaultArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -42,7 +42,7 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * Creates a new instance. @@ -50,7 +50,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public DefaultArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -45,7 +45,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public UndefinedArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(archetypeName, faceObjectProviders, animationObjects); setEditorFolder(net.sf.gridarta.model.gameobject.GameObject.EDITOR_FOLDER_INTERN); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -45,14 +45,14 @@ * The {@link AnimationObjects} for looking up animations. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * Creates a new instance. * @param faceObjectProviders the face object providers to use * @param animationObjects the animation objects for looking up animations */ - public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public DefaultGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -72,7 +72,7 @@ * faces * @param animationObjects the animation objects for looking up animations */ - public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects) { + public GameObject(@NotNull final Archetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { super(archetype, faceObjectProviders, animationObjects); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -56,7 +56,7 @@ * The smooth faces to update. */ @NotNull - private final SmoothFaces<?, ?, ?> smoothFaces; + private final SmoothFaces smoothFaces; /** * Creates a new instance. @@ -68,7 +68,7 @@ * @param animationObjects the animation objects instance * @param smoothFaces the smooth faces to update */ - public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces<?, ?, ?> smoothFaces) { + public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final SmoothFaces smoothFaces) { super(collectedDirectory, archetypeSet.getImageSet(), archetypeSet, archetypeParser, animationObjects, faceObjects, IGUIConstants.ANIMTREE_FILE, IGUIConstants.ARCH_FILE); this.configurationDirectory = configurationDirectory; this.smoothFaces = smoothFaces; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 08:18:29 UTC (rev 9132) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 10:46:51 UTC (rev 9133) @@ -75,19 +75,19 @@ * The {@link FaceObjects} instance. */ @NotNull - private final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects; + private final FaceObjects faceObjects; /** * The {@link AnimationObjects} instance. */ @NotNull - private final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects; + private final AnimationObjects animationObjects; /** * The {@link SmoothFaces} instance. */ @NotNull - private final SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces; + private final SmoothFaces smoothFaces; /** * The {@link ArchFaceProvider} to use. @@ -114,7 +114,7 @@ * @param faceObjectProviders the face object providers for looking up * faces */ - public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final SmoothFaces<GameObject, MapArchObject, Archetype> smoothFaces, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectPars... [truncated message content] |
From: <aki...@us...> - 2011-12-17 12:11:52
|
Revision: 9134 http://gridarta.svn.sourceforge.net/gridarta/?rev=9134&view=rev Author: akirschbaum Date: 2011-12-17 12:11:44 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove dependency GlobalSettings -> ConfigSource. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.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/GridartaEditor.java trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.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 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -230,8 +230,8 @@ */ @NotNull @Override - public GlobalSettings newGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - return new DefaultGlobalSettings(configSourceFactory); + public GlobalSettings newGlobalSettings() { + return new DefaultGlobalSettings(); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -20,7 +20,6 @@ package net.sf.gridarta.var.atrinik.model.settings; import java.io.File; -import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.var.atrinik.IGUIConstants; import org.jetbrains.annotations.NotNull; @@ -31,14 +30,6 @@ public class DefaultGlobalSettings extends net.sf.gridarta.model.settings.DefaultGlobalSettings { /** - * Creates a new instance. - * @param configSourceFactory the config source factory to use - */ - public DefaultGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - super(configSourceFactory); - } - - /** * {@inheritDoc} */ @NotNull 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 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -201,8 +201,8 @@ */ @NotNull @Override - public GlobalSettings newGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - return new DefaultGlobalSettings(configSourceFactory); + public GlobalSettings newGlobalSettings() { + return new DefaultGlobalSettings(); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -20,7 +20,6 @@ package net.sf.gridarta.var.crossfire.model.settings; import java.io.File; -import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.var.crossfire.IGUIConstants; import org.jetbrains.annotations.NotNull; @@ -31,14 +30,6 @@ public class DefaultGlobalSettings extends net.sf.gridarta.model.settings.DefaultGlobalSettings { /** - * Creates a new instance. - * @param configSourceFactory the config source factory to use - */ - public DefaultGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - super(configSourceFactory); - } - - /** * {@inheritDoc} */ @NotNull 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 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -230,8 +230,8 @@ */ @NotNull @Override - public GlobalSettings newGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - return new DefaultGlobalSettings(configSourceFactory); + public GlobalSettings newGlobalSettings() { + return new DefaultGlobalSettings(); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -20,7 +20,6 @@ package net.sf.gridarta.var.daimonin.model.settings; import java.io.File; -import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.var.daimonin.IGUIConstants; import org.jetbrains.annotations.NotNull; @@ -31,14 +30,6 @@ public class DefaultGlobalSettings extends net.sf.gridarta.model.settings.DefaultGlobalSettings { /** - * Creates a new instance. - * @param configSourceFactory the configuration source factory to use - */ - public DefaultGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { - super(configSourceFactory); - } - - /** * {@inheritDoc} */ @NotNull Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -24,8 +24,6 @@ import java.util.prefs.PreferenceChangeListener; import java.util.prefs.Preferences; import net.sf.gridarta.MainControl; -import net.sf.gridarta.model.configsource.ConfigSource; -import net.sf.gridarta.model.configsource.ConfigSourceFactory; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; @@ -172,7 +170,7 @@ * Do we load arches from the collected archives. */ @NotNull - private ConfigSource configSource; + private String configSourceName; /** * Time for an automated documentation popup. @@ -187,9 +185,8 @@ /** * Creates a new instance. - * @param configSourceFactory the configuration source factory to use */ - protected DefaultGlobalSettings(@NotNull final ConfigSourceFactory configSourceFactory) { + protected DefaultGlobalSettings() { archDirectoryDefault = ActionBuilderUtils.getString(ACTION_BUILDER, "archDirectoryDefault", ""); mapsDirectoryDefault = ActionBuilderUtils.getString(ACTION_BUILDER, "mapsDirectoryDefault", ""); hasMediaDefaultDirectory = ActionBuilderUtils.getBoolean(ACTION_BUILDER, "mediaDirectory"); @@ -213,7 +210,7 @@ } else if (evt.getKey().equals(IMAGE_SET_KEY)) { imageSet = preferences.get(IMAGE_SET_KEY, imageSetDefault); } else if (evt.getKey().equals(CONFIG_SOURCE_KEY)) { - configSource = configSourceFactory.getConfigSource(preferences.get(CONFIG_SOURCE_KEY, "")); + configSourceName = preferences.get(CONFIG_SOURCE_KEY, ""); } } @@ -225,7 +222,7 @@ mediaDirectory = new File(preferences.get(MEDIA_DIRECTORY_KEY, mediaDirectoryDefault)); imageSet = preferences.get(IMAGE_SET_KEY, imageSetDefault); imageDirectory = mapsDirectory; - configSource = configSourceFactory.getConfigSource(preferences.get(CONFIG_SOURCE_KEY, "")); + configSourceName = preferences.get(CONFIG_SOURCE_KEY, ""); final int documentationVersion = ActionBuilderUtils.getInt(ACTION_BUILDER, "docuVersion", 0); if (documentationVersion > 0 && preferences.getInt(DOCUMENTATION_VERSION_KEY, 0) < documentationVersion) { // remember to open documentation @@ -417,21 +414,21 @@ */ @NotNull @Override - public ConfigSource getConfigSource() { - return configSource; + public String getConfigSourceName() { + return configSourceName; } /** * {@inheritDoc} */ @Override - public void setConfigSource(@NotNull final ConfigSource configSource) { - if (this.configSource == configSource) { + public void setConfigSourceName(@NotNull final String configSourceName) { + if (this.configSourceName.equals(configSourceName)) { return; } - this.configSource = configSource; - preferences.put(CONFIG_SOURCE_KEY, configSource.getName()); + this.configSourceName = configSourceName; + preferences.put(CONFIG_SOURCE_KEY, configSourceName); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -20,7 +20,6 @@ package net.sf.gridarta.model.settings; import java.io.File; -import net.sf.gridarta.model.configsource.ConfigSource; import org.jetbrains.annotations.NotNull; /** @@ -88,17 +87,17 @@ File getImageDirectory(); /** - * Returns the configuration source. - * @return the configuration source + * Returns the name of the configuration source. + * @return the name of the configuration source */ @NotNull - ConfigSource getConfigSource(); + String getConfigSourceName(); /** - * Sets the configuration source. - * @param configSource the configuration source + * Sets the name of the configuration source. + * @param configSourceName the name */ - void setConfigSource(@NotNull ConfigSource configSource); + void setConfigSourceName(@NotNull String configSourceName); /** * Returns the default directory for saving maps. Modified: trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -20,7 +20,6 @@ package net.sf.gridarta.model.settings; import java.io.File; -import net.sf.gridarta.model.configsource.ConfigSource; import org.jetbrains.annotations.NotNull; /** @@ -114,7 +113,7 @@ */ @NotNull @Override - public ConfigSource getConfigSource() { + public String getConfigSourceName() { throw new AssertionError(); } @@ -122,7 +121,7 @@ * {@inheritDoc} */ @Override - public void setConfigSource(@NotNull final ConfigSource configSource) { + public void setConfigSourceName(@NotNull final String configSourceName) { throw new AssertionError(); } Modified: trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -170,7 +170,7 @@ assert mediaField != null; globalSettings.setMediaDirectory(new File(PathManager.getAbsolutePath(mediaField.getText()))); } - globalSettings.setConfigSource((ConfigSource) configSourceComboBox.getSelectedItem()); + globalSettings.setConfigSourceName(((ConfigSource) configSourceComboBox.getSelectedItem()).getName()); if (globalSettings.hasImageSet()) { assert imageSetBox != null; @@ -193,7 +193,7 @@ assert mediaField != null; mediaField.setText(text); } - configSourceComboBox.setSelectedItem(globalSettings.getConfigSource()); + configSourceComboBox.setSelectedItem(configSourceFactory.getConfigSource(globalSettings.getConfigSourceName())); if (globalSettings.hasImageSet()) { final String imageSet = getCurrentImageSet(); assert imageSets != null; @@ -247,7 +247,7 @@ } } - return !(imageSet.equals(getCurrentImageSet()) && configSourceComboBox.getSelectedItem() == globalSettings.getConfigSource()); + return !(imageSet.equals(getCurrentImageSet()) && ((ConfigSource) configSourceComboBox.getSelectedItem()).getName().equals(globalSettings.getConfigSourceName())); } /** @@ -277,7 +277,7 @@ panel.setBorder(createTitledBorder("optionsGlobal")); configSourceComboBox = new JComboBox(configSourceFactory.getConfigSources()); - final ConfigSource configSource = globalSettings.getConfigSource(); + final ConfigSource configSource = configSourceFactory.getConfigSource(globalSettings.getConfigSourceName()); configSourceComboBox.setSelectedItem(configSource); configSourceComboBox.addItemListener(itemListener); preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsConfigSource.text")); Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -257,7 +257,7 @@ errorView.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, "TreasureLists.xml: " + ex.getMessage()); specialTreasureLists = Collections.emptyMap(); } - final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : globalSettings.getConfigSource(); + final ConfigSource configSource = forceReadFromFiles ? configSourceFactory.getFilesConfigSource() : configSourceFactory.getConfigSource(globalSettings.getConfigSourceName()); treasureTree = TreasureLoader.parseTreasures(errorView, specialTreasureLists, configSource, globalSettings); final ArchetypeAttributeFactory archetypeAttributeFactory = new DefaultArchetypeAttributeFactory(); final ArchetypeAttributeParser archetypeAttributeParser = new ArchetypeAttributeParser(archetypeAttributeFactory); Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -161,11 +161,10 @@ /** * Creates a new {@link GlobalSettings} instance. - * @param configSourceFactory the config source factory to use * @return the new instance */ @NotNull - GlobalSettings newGlobalSettings(@NotNull ConfigSourceFactory configSourceFactory); + GlobalSettings newGlobalSettings(); /** * Creates a new {@link ArchetypeFactory} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -237,7 +237,7 @@ final SystemIcons systemIcons = new SystemIcons(guiUtils); final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); final MapViewSettings mapViewSettings = new DefaultMapViewSettings(); - final GlobalSettings globalSettings = editorFactory.newGlobalSettings(configSourceFactory); + final GlobalSettings globalSettings = editorFactory.newGlobalSettings(); final PathManager pathManager = new PathManager(globalSettings); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); final FaceObjects faceObjects = new DefaultFaceObjects(editorFactory.getIncludeFaceNumbers()); Modified: trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2011-12-17 10:46:51 UTC (rev 9133) +++ trunk/src/app/net/sf/gridarta/maincontrol/ImageCreatorFactory.java 2011-12-17 12:11:44 UTC (rev 9134) @@ -31,8 +31,6 @@ import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.autojoin.AutojoinLists; -import net.sf.gridarta.model.configsource.ConfigSourceFactory; -import net.sf.gridarta.model.configsource.DefaultConfigSourceFactory; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObject; @@ -90,8 +88,7 @@ */ @NotNull public ImageCreator<G, A, R> newImageCreator(@NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<G, A, R> archetypeSet) { - final ConfigSourceFactory configSourceFactory = new DefaultConfigSourceFactory(); - final GlobalSettings globalSettings = editorFactory.newGlobalSettings(configSourceFactory); + final GlobalSettings globalSettings = editorFactory.newGlobalSettings(); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); final MapArchObjectParserFactory<A> mapArchObjectParserFactory = editorFactory.newMapArchObjectParserFactory(); final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 12:26:07
|
Revision: 9135 http://gridarta.svn.sourceforge.net/gridarta/?rev=9135&view=rev Author: akirschbaum Date: 2011-12-17 12:25:59 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Update comments. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/collectable/package.html Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -30,6 +30,12 @@ import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; +/** + * A {@link net.sf.gridarta.model.collectable.Collectable} that creates the + * Atrinik specific "archetypes" file. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public class AtrinikArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -30,6 +30,12 @@ import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; +/** + * A {@link net.sf.gridarta.model.collectable.Collectable} that creates the + * Crossfire specific "archetypes" file. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public class CrossfireArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -30,6 +30,12 @@ import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; +/** + * A {@link net.sf.gridarta.model.collectable.Collectable} that creates the + * Daimonin specific "archetypes" file. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public class DaimoninArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { /** Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -39,10 +39,16 @@ import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; +/** + * Abstract base class for {@link Collectable Collectables} that create the + * "archetypes" file. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public abstract class AbstractArchetypeSetCollectable<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements Collectable { /** - * Action Builder. + * The {@link ActionBuilder} instance. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); @@ -78,7 +84,7 @@ } /** - * {@inheritDoc} Collects the Archetypes. + * {@inheritDoc} */ @Override public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AnimationObjectsCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -34,10 +34,16 @@ import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; +/** + * a {@link Collectable} that creates the "animations" file. It also creates the + * editor helper file "animtree". + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public class AnimationObjectsCollectable implements Collectable { /** - * Action Builder. + * The {@link ActionBuilder} instance. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -27,14 +27,14 @@ /** * A Collectable has information that can be collected. This is used during the * "collection" process to gather information into files suitable for the - * server. + * game servers. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface Collectable { /** - * Collect information. - * @param progress Progress to report progress to. + * Collects information. + * @param progress the progress to report progress to * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/FaceObjectsCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -38,10 +38,17 @@ import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; +/** + * A {@link Collectable} that creates the atrinik.0/crossfire.0/daimonin.0 files + * which contains all defined faces. It also creates index or editor helper + * files such as bmaps or bmaps.paths. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author Andreas Kirschbaum + */ public class FaceObjectsCollectable implements Collectable { /** - * Action Builder. + * The {@link ActionBuilder} instance. */ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 2011-12-17 12:11:44 UTC (rev 9134) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/SmoothFacesCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) @@ -31,6 +31,12 @@ import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; +/** + * A {@link Collectable} that creates the Crossfire specific smooth faces file. + * This file contains information needed for smoothing faces between adjacent + * map squares. + * @author Andreas Kirschbaum + */ public class SmoothFacesCollectable implements Collectable { /** Added: trunk/model/src/app/net/sf/gridarta/model/collectable/package.html =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/package.html (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/package.html 2011-12-17 12:25:59 UTC (rev 9135) @@ -0,0 +1,26 @@ +<!-- + ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + ~ Copyright (C) 2000-2011 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +<p>Implements the collection process that combines individual files into + collected files which are read by the game servers at runtime.</p> +</body> +</html> Property changes on: trunk/model/src/app/net/sf/gridarta/model/collectable/package.html ___________________________________________________________________ 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...> - 2011-12-17 12:31:28
|
Revision: 9136 http://gridarta.svn.sourceforge.net/gridarta/?rev=9136&view=rev Author: akirschbaum Date: 2011-12-17 12:31:21 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) @@ -39,20 +39,27 @@ public class AtrinikArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { /** + * The {@link GameObjectParser} for writing inventory game objects. + */ + @NotNull + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** * Creates a new instance. * @param archetypeSet the archetype set to collect * @param gameObjectParser the game object parser for writing inventory game * objects */ public AtrinikArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); + super(archetypeSet, IGUIConstants.ARCH_FILE); + this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out) throws IOException { writeArchetype(out, archetype, true, gameObjectParser); // process the multi-part tails: Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) @@ -39,20 +39,27 @@ public class CrossfireArchetypeSetCollectable extends AbstractArchetypeSetCollectable<GameObject, MapArchObject, Archetype> { /** + * The {@link GameObjectParser} for writing inventory game objects. + */ + @NotNull + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** * Creates a new instance. * @param archetypeSet the archetype set to collect * @param gameObjectParser the game object parser for writing inventory game * objects */ public CrossfireArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); + super(archetypeSet, IGUIConstants.ARCH_FILE); + this.gameObjectParser = gameObjectParser; } /** * {@inheritDoc} */ @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out) throws IOException { writeArchetype(out, archetype, true, gameObjectParser); // process the multi-part tails: Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) @@ -23,7 +23,6 @@ import java.io.Writer; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; -import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -41,18 +40,16 @@ /** * Creates a new instance. * @param archetypeSet the archetype set to collect - * @param gameObjectParser the game object parser for writing inventory game - * objects */ - public DaimoninArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) { - super(archetypeSet, IGUIConstants.ARCH_FILE, gameObjectParser); + public DaimoninArchetypeSetCollectable(@NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + super(archetypeSet, IGUIConstants.ARCH_FILE); } /** * {@inheritDoc} */ @Override - protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser) throws IOException { + protected int collectArchetype(@NotNull final Archetype archetype, @NotNull final Writer out) throws IOException { writeArchetype(out, archetype, true); // process the multi-part tails: Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 12:25:59 UTC (rev 9135) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 12:31:21 UTC (rev 9136) @@ -53,12 +53,6 @@ public class DefaultResources extends AbstractResources<GameObject, MapArchObject, Archetype> { /** - * The {@link GameObjectParser} to use. - */ - @NotNull - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** * The {@link ArchetypeSet} to update. */ @NotNull @@ -108,7 +102,6 @@ */ public DefaultResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { super(gameObjectParser, archetypeSet, mapViewSettings); - this.gameObjectParser = gameObjectParser; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.faceObjects = faceObjects; @@ -144,7 +137,7 @@ @Override protected void writeCollectedInt(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { final CollectedResourcesWriter collectedResourcesWriter = new CollectedResourcesWriter(); - collectedResourcesWriter.addCollectable(new DaimoninArchetypeSetCollectable(archetypeSet, gameObjectParser)); + collectedResourcesWriter.addCollectable(new DaimoninArchetypeSetCollectable(archetypeSet)); collectedResourcesWriter.addCollectable(new AnimationObjectsCollectable(animationObjects, IGUIConstants.ANIMTREE_FILE)); collectedResourcesWriter.addCollectable(new FaceObjectsCollectable(faceObjects, archFaceProvider)); collectedResourcesWriter.write(progress, collectedDirectory); Modified: trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 12:25:59 UTC (rev 9135) +++ trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) @@ -30,7 +30,6 @@ import net.sf.gridarta.model.archetype.ArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; 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; @@ -65,22 +64,13 @@ private final String archFile; /** - * The {@link GameObjectParser} for writing inventory game objects. - */ - @NotNull - private final GameObjectParser<G, A, R> gameObjectParser; - - /** * Creates a new instance. * @param archetypeSet the archetype set to collect * @param archFile the collected archetypes file name - * @param gameObjectParser the game object parser for writing inventory game - * objects */ - protected AbstractArchetypeSetCollectable(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final String archFile, @NotNull final GameObjectParser<G, A, R> gameObjectParser) { + protected AbstractArchetypeSetCollectable(@NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final String archFile) { this.archetypeSet = archetypeSet; this.archFile = archFile; - this.gameObjectParser = gameObjectParser; } /** @@ -95,7 +85,7 @@ try { final BufferedWriter out = new BufferedWriter(osw); try { - collect(progress, out, gameObjectParser); + collect(progress, out); } finally { out.close(); } @@ -111,11 +101,9 @@ * Collects the archetypes. * @param progress the progress to report progress to * @param writer the writer to write the archetypes to - * @param gameObjectParser the game object parser for writing inventory game - * objects * @throws IOException in case of I/O problems during collection */ - private void collect(@NotNull final Progress progress, @NotNull final Writer writer, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException { + private void collect(@NotNull final Progress progress, @NotNull final Writer writer) throws IOException { final Collection<R> archetypes = archetypeSet.getArchetypes(); progress.setLabel(ActionBuilderUtils.getString(ACTION_BUILDER, "archCollectArches"), archetypes.size()); int artifactCount = 0; @@ -137,7 +125,7 @@ collectStartArch(archetype, writer); count++; } else { - count += collectArchetype(archetype, writer, gameObjectParser); + count += collectArchetype(archetype, writer); } if (count % 100 == 0) { @@ -177,6 +165,6 @@ * @return the number of archetype parts written * @throws IOException if an I/O error occurs */ - protected abstract int collectArchetype(@NotNull final R archetype, @NotNull final Writer out, @NotNull final GameObjectParser<G, A, R> gameObjectParser) throws IOException; + protected abstract int collectArchetype(@NotNull final R archetype, @NotNull final Writer out) throws IOException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 13:09:21
|
Revision: 9137 http://gridarta.svn.sourceforge.net/gridarta/?rev=9137&view=rev Author: akirschbaum Date: 2011-12-17 13:09:09 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Move ArchetypeSet and related classes to separate package. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractCollectedResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java trunk/model/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java trunk/model/src/app/net/sf/gridarta/model/spells/ArchetypeSetSpellLoader.java trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBox.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.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 Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/archetypeset/ trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java Removed Paths: ------------- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.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 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -47,9 +47,9 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.autojoin.AutojoinLists; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -24,7 +24,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObjectFactory; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/collectable/AtrinikArchetypeSetCollectable.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.Writer; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.var.atrinik.IGUIConstants; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -21,7 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -19,7 +19,7 @@ package net.sf.gridarta.var.atrinik.model.io; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -20,7 +20,7 @@ package net.sf.gridarta.var.atrinik.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.scripts.AbstractScriptedEventFactory; import net.sf.gridarta.model.scripts.ScriptArchUtils; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,7 +25,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.collectable.FaceObjectsCollectable; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,9 +25,9 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.DefaultFaceObjects; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -27,11 +27,11 @@ import net.sf.gridarta.model.mapgrid.MapGrid; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -26,11 +26,11 @@ import net.sf.gridarta.model.face.FaceObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; /** 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 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -45,9 +45,9 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.autojoin.AutojoinLists; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -24,17 +24,17 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.smoothface.DuplicateSmoothFaceException; +import net.sf.gridarta.model.smoothface.SmoothFace; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.smoothface.DuplicateSmoothFaceException; -import net.sf.gridarta.model.smoothface.SmoothFace; -import net.sf.gridarta.model.smoothface.SmoothFaces; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/collectable/CrossfireArchetypeSetCollectable.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.Writer; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.var.crossfire.IGUIConstants; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.Map; import java.util.TreeMap; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -19,7 +19,7 @@ package net.sf.gridarta.var.crossfire.model.io; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -20,7 +20,7 @@ package net.sf.gridarta.var.crossfire.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.scripts.AbstractScriptedEventFactory; import net.sf.gridarta.model.scripts.ScriptArchUtils; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,19 +25,19 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.resource.AbstractCollectedResourcesReader; +import net.sf.gridarta.model.smoothface.SmoothFaces; +import net.sf.gridarta.model.smoothface.SmoothFacesLoader; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.smoothface.SmoothFaces; -import net.sf.gridarta.model.smoothface.SmoothFacesLoader; import org.jetbrains.annotations.NotNull; /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,7 +25,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.collectable.FaceObjectsCollectable; import net.sf.gridarta.model.collectable.SmoothFacesCollectable; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -22,7 +22,7 @@ import java.io.File; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.resource.AbstractFilesResourcesReader; Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,9 +25,9 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; 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 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -47,9 +47,9 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.autojoin.AutojoinLists; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObjectFactory; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/collectable/DaimoninArchetypeSetCollectable.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.Writer; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.collectable.AbstractArchetypeSetCollectable; import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -21,7 +21,7 @@ import java.util.LinkedHashMap; import java.util.Map; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.AbstractGameObjectParser; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -19,7 +19,7 @@ package net.sf.gridarta.var.daimonin.model.io; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -20,7 +20,7 @@ package net.sf.gridarta.var.daimonin.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.scripts.AbstractScriptedEventFactory; import net.sf.gridarta.model.scripts.ScriptArchUtils; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,7 +25,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; import net.sf.gridarta.model.collectable.FaceObjectsCollectable; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -23,7 +23,7 @@ import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -25,6 +25,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DuplicateAnimationException; import net.sf.gridarta.model.anim.IllegalAnimationException; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObject; Deleted: trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -1,115 +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.model.archetype; - -import java.util.Collection; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Interface that captures similarities between different ArchetypeSet - * implementations. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public interface ArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { - - /** - * Returns whether the Archetypes in this ArchetypeSet were loaded from an - * archive. - * @return <code>true</code> if loaded from an archive, otherwise - * <code>false</code> - */ - boolean isLoadedFromArchive(); - - /** - * Returns the number of Archetypes available. - * @return the number of Archetypes available - */ - int getArchetypeCount(); - - /** - * Returns an Archetype by its name. - * @param archetypeName the name of the Archetype to get - * @return the archetype - * @throws UndefinedArchetypeException if the no such archetype exists - * @see #getOrCreateArchetype(String) for a similar method that creates - * undefined archetypes - */ - @NotNull - R getArchetype(@NotNull String archetypeName) throws UndefinedArchetypeException; - - /** - * Returns an archetype by its name. If this archetype does not exist, - * return an {@link Archetype} which has {@link Archetype#isUndefinedArchetype()} - * set. - * @param archetypeName the archetype name - * @return the archetype - * @see #getArchetype(String) - */ - R getOrCreateArchetype(@NotNull final String archetypeName); - - /** - * Adds an Archetype to this Set. - * @param archetype the archetype to add - * @throws DuplicateArchetypeException if the archetype name is not unique - * @throws IllegalArgumentException in case the added GameObject is not an - * Archetype - */ - void addArchetype(@NotNull R archetype) throws DuplicateArchetypeException, IllegalArgumentException; - - /** - * Registers an {@link ArchetypeSetListener}. - * @param listener the listener to register - */ - void addArchetypeSetListener(@NotNull ArchetypeSetListener<G, A, R> listener); - - /** - * Removes an {@link ArchetypeSetListener}. - * @param listener the listener to remove - */ - void removeArchetypeSetListener(@NotNull ArchetypeSetListener<G, A, R> listener); - - /** - * Returns a read-only collection of all {@link Archetype Archetypes}. - * @return a read-only collection of all archetypes - */ - @NotNull - Collection<R> getArchetypes(); - - void connectFaces(); - - /** - * Sets whether Archetypes were loaded from an archive. - * @param loadedFromArchive <code>true</code> when loaded from archive, - * otherwise <code>false</code> - * @see #isLoadedFromArchive() - */ - void setLoadedFromArchive(boolean loadedFromArchive); - - /** - * Returns the image set. - * @return the image set or <code>null</code> - */ - @Nullable - String getImageSet(); - -} // interface ArchetypeSet Deleted: trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -1,99 +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.model.archetype; - -import net.sf.gridarta.model.anim.AnimationObject; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.errorview.ErrorView; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.face.FaceObject; -import net.sf.gridarta.model.face.FaceObjects; -import org.jetbrains.annotations.NotNull; - -/** - * Utility class for validating {@link ArchetypeSet} instances. - * @author Andreas Kirschbaum - */ -public class ArchetypeValidator { - - /** - * The {@link AnimationObjects} instance for looking up animation names. - */ - @NotNull - private final AnimationObjects animationObjects; - - /** - * The {@link FaceObjects} instance for looking up face names. - */ - @NotNull - private final FaceObjects faceObjects; - - /** - * The {@link ErrorView} for reporting errors. - */ - @NotNull - private final ErrorView errorView; - - /** - * Creates a new instance. - * @param animationObjects the animation objects instance for looking up - * animation names - * @param faceObjects the face objects instance for looking up face names - * @param errorView the error view for reporting errors - */ - public ArchetypeValidator(@NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects, final ErrorView errorView) { - this.animationObjects = animationObjects; - this.faceObjects = faceObjects; - this.errorView = errorView; - } - - /** - * Validates an {@link ArchetypeSet} instance. - * @param archetypeSet the archetype set instance to validate - */ - public void validate(@NotNull final ArchetypeSet<?, ?, ?> archetypeSet) { - for (final Archetype<?, ?, ?> archetype : archetypeSet.getArchetypes()) { - validateArchetype(archetype); - } - } - - /** - * Validates an {@link Archetype} instance. - * @param archetype the archetype instance to validate - */ - private void validateArchetype(@NotNull final Archetype<?, ?, ?> archetype) { - final String animName = archetype.getAnimName(); - if (animName != null && !animName.equals("NONE")) { - final AnimationObject animation = animationObjects.get(animName); - if (animation == null) { - errorView.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetype.getArchetypeName() + " references undefined animation '" + animName + "'"); - } - } - - final String faceName = archetype.getFaceName(); - if (faceName != null) { - final FaceObject face = faceObjects.get(faceName); - if (face == null) { - errorView.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetype.getArchetypeName() + " references undefined face '" + faceName + "'"); - } - } - } - -} // class ArchetypeValidator Deleted: trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.java 2011-12-17 12:31:21 UTC (rev 9136) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -1,246 +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.model.archetype; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; -import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.face.FaceObjectProvidersListener; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.utils.EventListenerList2; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Base implementation of ArchetypeSet. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class DefaultArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements ArchetypeSet<G, A, R> { - - /** - * The archetype factory to use. - */ - @NotNull - private final ArchetypeFactory<G, A, R> archetypeFactory; - - /** - * The image set to use. - */ - @Nullable - private final String imageSet; - - /** - * The defined Archetypes mapped by name. - */ - private final Map<String, R> archetypeMap = new TreeMap<String, R>(); - - /** - * The defined Archetypes sorted by load order. Collecting them must retain - * the load order. When they are loaded from the collection, the - * editor_folders must not be mixed. - * @todo solve this issue - */ - private final Collection<R> archetypes = new ArrayList<R>(); - - /** - * Whether Archetypes were loaded form an archive. - * @val <code>true</code> when Archetypes were loaded from the big collected - * archive files, - * @val <code>false</code> when Archetypes were loaded from individual - * .arc-files - */ - private boolean loadedFromArchive = false; - - /** - * The archetypes used for game objects which reference undefined - * archetypes. It maps archetype name to archetype. - */ - private final Map<String, WeakReference<R>> undefinedArchetypes = new HashMap<String, WeakReference<R>>(); - - /** - * The ArchetypeSetListeners to inform of changes. - */ - private final EventListenerList2<ArchetypeSetListener<G, A, R>> listenerList = new EventListenerList2<ArchetypeSetListener<G, A, R>>(ArchetypeSetListener.class); - - /** - * Create an DefaultArchetypeSet. - * @param archetypeFactory the archetype factory to use - * @param imageSet the image set to use - * @param faceObjectProviders the face object providers - */ - public DefaultArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @Nullable final String imageSet, @NotNull final FaceObjectProviders faceObjectProviders) { - this.archetypeFactory = archetypeFactory; - this.imageSet = imageSet; - - final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { - - @Override - public void facesReloaded() { - connectFaces(); - } - - }; - faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getImageSet() { - return imageSet; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isLoadedFromArchive() { - return loadedFromArchive; - } - - /** - * {@inheritDoc} - */ - @Override - public int getArchetypeCount() { - return archetypeMap.size(); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public R getArchetype(@NotNull final String archetypeName) throws UndefinedArchetypeException { - final R archetype = archetypeMap.get(archetypeName); - if (archetype == null) { - throw new UndefinedArchetypeException(archetypeName); - } - - return archetype; - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public R getOrCreateArchetype(@NotNull final String archetypeName) { - try { - return getArchetype(archetypeName); - } catch (final UndefinedArchetypeException ignored) { - synchronized (undefinedArchetypes) { - final WeakReference<R> existingUndefinedArchetypeRef = undefinedArchetypes.get(archetypeName); - if (existingUndefinedArchetypeRef != null) { - final R existingUndefinedArchetype = existingUndefinedArchetypeRef.get(); - if (existingUndefinedArchetype != null) { - return existingUndefinedArchetype; - } - } - - final R newArchetype = archetypeFactory.newUndefinedArchetype(archetypeName); - undefinedArchetypes.put(archetypeName, new WeakReference<R>(newArchetype)); - return newArchetype; - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public void addArchetype(@NotNull final R archetype) throws DuplicateArchetypeException { - final String name = archetype.getArchetypeName(); - if (archetypeMap.containsKey(name)) { - throw new DuplicateArchetypeException(name); - } - - archetypeMap.put(name, archetype); - archetypes.add(archetype); - } - - /** - * {@inheritDoc} - */ - @Override - public void setLoadedFromArchive(final boolean loadedFromArchive) { - if (this.loadedFromArchive == loadedFromArchive) { - return; - } - - this.loadedFromArchive = loadedFromArchive; - fireLoadedFromArchiveChangedEvent(); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - public Collection<R> getArchetypes() { - return Collections.unmodifiableCollection(archetypes); - } - - /** - * Register an ArchetypeSetListener. - * @param listener ArchetypeSetListener to register - */ - @Override - public void addArchetypeSetListener(@NotNull final ArchetypeSetListener<G, A, R> listener) { - listenerList.add(listener); - } - - /** - * {@inheritDoc} - */ - @Override - public void removeArchetypeSetListener(@NotNull final ArchetypeSetListener<G, A, R> listener) { - listenerList.remove(listener); - } - - /** - * Notifies all listeners that {@link #isLoadedFromArchive()} has changed. - */ - private void fireLoadedFromArchiveChangedEvent() { - for (final ArchetypeSetListener<G, A, R> listener : listenerList.getListeners()) { - listener.loadedFromArchiveChanged(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void connectFaces() { - for (final BaseObject<G, A, R, ?> archetype : getArchetypes()) { - archetype.setObjectFace(); - } - } - -} // class DefaultArchetypeSet Copied: trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java (from rev 9126, trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSet.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -0,0 +1,119 @@ +/* + * 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.archetypeset; + +import java.util.Collection; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetype.ArchetypeSetListener; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.UndefinedArchetypeException; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Interface that captures similarities between different ArchetypeSet + * implementations. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface ArchetypeSet<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * Returns whether the Archetypes in this ArchetypeSet were loaded from an + * archive. + * @return <code>true</code> if loaded from an archive, otherwise + * <code>false</code> + */ + boolean isLoadedFromArchive(); + + /** + * Returns the number of Archetypes available. + * @return the number of Archetypes available + */ + int getArchetypeCount(); + + /** + * Returns an Archetype by its name. + * @param archetypeName the name of the Archetype to get + * @return the archetype + * @throws UndefinedArchetypeException if the no such archetype exists + * @see #getOrCreateArchetype(String) for a similar method that creates + * undefined archetypes + */ + @NotNull + R getArchetype(@NotNull String archetypeName) throws UndefinedArchetypeException; + + /** + * Returns an archetype by its name. If this archetype does not exist, + * return an {@link Archetype} which has {@link Archetype#isUndefinedArchetype()} + * set. + * @param archetypeName the archetype name + * @return the archetype + * @see #getArchetype(String) + */ + R getOrCreateArchetype(@NotNull final String archetypeName); + + /** + * Adds an Archetype to this Set. + * @param archetype the archetype to add + * @throws DuplicateArchetypeException if the archetype name is not unique + * @throws IllegalArgumentException in case the added GameObject is not an + * Archetype + */ + void addArchetype(@NotNull R archetype) throws DuplicateArchetypeException, IllegalArgumentException; + + /** + * Registers an {@link ArchetypeSetListener}. + * @param listener the listener to register + */ + void addArchetypeSetListener(@NotNull ArchetypeSetListener<G, A, R> listener); + + /** + * Removes an {@link ArchetypeSetListener}. + * @param listener the listener to remove + */ + void removeArchetypeSetListener(@NotNull ArchetypeSetListener<G, A, R> listener); + + /** + * Returns a read-only collection of all {@link Archetype Archetypes}. + * @return a read-only collection of all archetypes + */ + @NotNull + Collection<R> getArchetypes(); + + void connectFaces(); + + /** + * Sets whether Archetypes were loaded from an archive. + * @param loadedFromArchive <code>true</code> when loaded from archive, + * otherwise <code>false</code> + * @see #isLoadedFromArchive() + */ + void setLoadedFromArchive(boolean loadedFromArchive); + + /** + * Returns the image set. + * @return the image set or <code>null</code> + */ + @Nullable + String getImageSet(); + +} // interface ArchetypeSet Property changes on: trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeValidator.java (from rev 9133, trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeValidator.java) =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeValidator.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeValidator.java 2011-12-17 13:09:09 UTC (rev 9137) @@ -0,0 +1,100 @@ +/* + * 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.archetypeset; + +import net.sf.gridarta.model.anim.Anima... [truncated message content] |
From: <aki...@us...> - 2011-12-17 13:20:27
|
Revision: 9138 http://gridarta.svn.sourceforge.net/gridarta/?rev=9138&view=rev Author: akirschbaum Date: 2011-12-17 13:20:19 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove dependency DefaultArchetypeSet -> FaceObjectProviders. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.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 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -248,8 +248,8 @@ */ @NotNull @Override - public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); } /** Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -148,7 +148,7 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); 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 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -219,9 +219,9 @@ */ @NotNull @Override - public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { final String imageSet = globalSettings.getImageSet(); - return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, imageSet.equals("none") ? null : imageSet); } /** Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -105,7 +105,7 @@ final AnimationObjects animationObjects = new DefaultAnimationObjects(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, "images", faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, "images"); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); 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 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -248,8 +248,8 @@ */ @NotNull @Override - public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -32,8 +32,6 @@ import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.face.FaceObjectProvidersListener; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.utils.EventListenerList2; @@ -95,21 +93,10 @@ * Create an DefaultArchetypeSet. * @param archetypeFactory the archetype factory to use * @param imageSet the image set to use - * @param faceObjectProviders the face object providers */ - public DefaultArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @Nullable final String imageSet, @NotNull final FaceObjectProviders faceObjectProviders) { + public DefaultArchetypeSet(@NotNull final ArchetypeFactory<G, A, R> archetypeFactory, @Nullable final String imageSet) { this.archetypeFactory = archetypeFactory; this.imageSet = imageSet; - - final FaceObjectProvidersListener faceObjectProvidersListener = new FaceObjectProvidersListener() { - - @Override - public void facesReloaded() { - connectFaces(); - } - - }; - faceObjectProviders.addFaceObjectProvidersListener(faceObjectProvidersListener); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -196,7 +196,7 @@ final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final TestArchetypeFactory archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; return new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); Modified: trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -106,7 +106,7 @@ final FaceObjects faceObjects = new TestFaceObjects(); faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); - archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, TestArchetypeBuilder> archetypeParser = new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); final List<TestGameObject> invObjects = new ArrayList<TestGameObject>(); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -143,7 +143,7 @@ final FaceObjects faceObjects = new TestFaceObjects(); faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory = new TestArchetypeFactory(); - archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null); gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); topmostInsertionMode = new TopmostInsertionMode<TestGameObject, TestMapArchObject, TestArchetype>(); insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode, new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); Modified: trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -167,7 +167,7 @@ final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); - final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null, faceObjectProviders); + final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null); final AnimationObjects animationObjects = new TestAnimationObjects(); final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -180,11 +180,10 @@ * Creates a new {@link ArchetypeSet} instance. * @param globalSettings the global settings to use * @param archetypeFactory the archetype factory to use - * @param faceObjectProviders the face object providers to use * @return the new instance */ @NotNull - ArchetypeSet<G, A, R> newArchetypeSet(@NotNull GlobalSettings globalSettings, @NotNull ArchetypeFactory<G, A, R> archetypeFactory, @NotNull FaceObjectProviders faceObjectProviders); + ArchetypeSet<G, A, R> newArchetypeSet(@NotNull GlobalSettings globalSettings, @NotNull ArchetypeFactory<G, A, R> archetypeFactory); /** * Creates a new {@link MapControlFactory} instance. Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 13:09:09 UTC (rev 9137) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2011-12-17 13:20:19 UTC (rev 9138) @@ -59,6 +59,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjectProvidersListener; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.filter.NamedFilter; import net.sf.gridarta.model.gameobject.GameObject; @@ -248,7 +249,15 @@ final AnimationObjects animationObjects = new DefaultAnimationObjects(); final GameObjectFactory<G, A, R> gameObjectFactory = editorFactory.newGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final ArchetypeFactory<G, A, R> archetypeFactory = editorFactory.newArchetypeFactory(faceObjectProviders, animationObjects); - final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory, faceObjectProviders); + final ArchetypeSet<G, A, R> archetypeSet = editorFactory.newArchetypeSet(globalSettings, archetypeFactory); + faceObjectProviders.addFaceObjectProvidersListener(new FaceObjectProvidersListener() { + + @Override + public void facesReloaded() { + archetypeSet.connectFaces(); + } + + }); final GameObjectParserFactory<G, A, R> gameObjectParserFactory = editorFactory.newGameObjectParserFactory(gameObjectFactory, archetypeSet); final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); final MapArchObjectFactory<A> mapArchObjectFactory = editorFactory.newMapArchObjectFactory(globalSettings); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-12-17 13:27:26
|
Revision: 9139 http://gridarta.svn.sourceforge.net/gridarta/?rev=9139&view=rev Author: akirschbaum Date: 2011-12-17 13:27:16 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Move ArchetypeParser and related classes into separate package. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/model/src/app/net/sf/gridarta/model/collectable/AbstractArchetypeSetCollectable.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractCollectedResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Added Paths: ----------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/ArchetypeParser.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/io/ArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/io/TestArchetypeParser.java Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.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 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -45,7 +45,6 @@ import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypeset.ArchetypeSet; @@ -65,6 +64,7 @@ import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; import net.sf.gridarta.model.gameobject.MultiPositionData; +import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.GameObjectParserFactory; @@ -107,10 +107,10 @@ import net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.DefaultMapPropertiesDialogFactory; import net.sf.gridarta.var.atrinik.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; -import net.sf.gridarta.var.atrinik.model.archetype.ArchetypeParser; import net.sf.gridarta.var.atrinik.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; +import net.sf.gridarta.var.atrinik.model.io.ArchetypeParser; import net.sf.gridarta.var.atrinik.model.io.DefaultGameObjectParserFactory; import net.sf.gridarta.var.atrinik.model.io.DefaultMapArchObjectParserFactory; import net.sf.gridarta.var.atrinik.model.maparchobject.DefaultMapArchObjectFactory; Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -1,199 +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.var.atrinik.model.archetype; - -import java.io.BufferedReader; -import java.io.IOException; -import java.util.List; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetypeset.ArchetypeSet; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; -import net.sf.gridarta.model.gameobject.GameObjectFactory; -import net.sf.gridarta.model.gameobject.MultiPositionData; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; -import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * The <code>ArchetypeParser</code> class handles the parsing of arches. It is a - * class separated from ArchetypeSet because it is also involved in loading - * arches in map files. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype, DefaultArchetypeBuilder> { - - /** - * Action Builder. - */ - @NotNull - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** - * The game object parser instance. - */ - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** - * The {@link MultiPositionData} instance to query for multi-part objects. - */ - @NotNull - private final MultiPositionData multiPositionData; - - /** - * The multi-shape ID of the currently parsed archetype. - */ - private int multiShapeID = 0; - - /** - * Creates an ArchetypeParser. - * @param gameObjectParser the game object parser instance to use - * @param animationObjects the animation objects instance to use - * @param archetypeSet the archetype set - * @param gameObjectFactory the factory for creating game objects - * @param multiPositionData the multi position data to query for multi-part - * objects - */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { - super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); - this.gameObjectParser = gameObjectParser; - this.multiPositionData = multiPositionData; - } - - /** - * {@inheritDoc} - */ - @Override - protected void initParseArchetype() { - multiShapeID = 0; - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean isStartLine(@NotNull final String line) { - return line.startsWith("Object ") || line.equals("Object"); - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean processLine(@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final DefaultArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List<GameObject> invObjects) throws IOException { - if (line.startsWith("arch ")) { - final GameObject invObject = gameObjectParser.load(in, line, invObjects); - assert invObject != null; - archetypeBuilder.addLast(invObject); - return true; - } - - if (line.startsWith("mpart_id ")) { - // shape ID for multi-parts - try { - multiShapeID = Integer.parseInt(line.substring(9).trim()); - - if (multiShapeID <= 0 || multiShapeID >= MultiPositionData.Y_DIM) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " mpart_id number is '" + line.substring(9) + '\''); - } - } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_id (" + line.substring(9) + ')'); - archetypeBuilder.addObjectText(line); - } - return true; - } - - if (line.startsWith("mpart_nr ")) { - // part nr for multi-parts - try { - final int i = Integer.parseInt(line.substring(9).trim()); - archetypeBuilder.setMultiPartNr(i); - } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_nr (" + line.substring(9) + ')'); - archetypeBuilder.addObjectText(line); - } - return true; - } - - return false; - } - - /** - * {@inheritDoc} - */ - @Override - protected void finishParseArchetypePart(@Nullable final Archetype firstArch, @NotNull final Archetype archetype, @NotNull final ErrorViewCollector errorViewCollector) { - // set or check mpart_id - archetype.setMultiShapeID(multiShapeID); - if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected void finishParseArchetype(@NotNull final Archetype archetype) { - if (archetype.isMulti()) { - calculateLowestMulti(archetype); - } - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean addToPanel(final boolean isInternPath, @NotNull final String editorFolder, @NotNull final Archetype archetype) { - return true; - } - - /** - * Calculate the lowest part of this multi-arch. This lowest part is needed - * because in ISO view, the big image is drawn for it's lowest part, in - * order to get the overlapping correct. <p/> - * @param arch last tail part of this multi - */ - private void calculateLowestMulti(final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> arch) { - final Archetype head = arch.getHead(); - int minYOffset = multiPositionData.getYOffset(head.getMultiShapeID(), head.getMultiPartNr()); - - // 1.step: find the maximal y-offset - for (net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> tail = head.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - final int t = multiPositionData.getYOffset(tail.getMultiShapeID(), tail.getMultiPartNr()); - if (t < minYOffset) { - minYOffset = t; - } - } - - // 2.step: set 'lowestPart' flag for all squares with maximum offset - for (net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> part = head; part != null; part = part.getMultiNext()) { - part.setLowestPart(multiPositionData.getYOffset(part.getMultiShapeID(), part.getMultiPartNr()) <= minYOffset); - } - } - -} // class ArchetypeParser Copied: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java (from rev 9137, trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java) =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -0,0 +1,201 @@ +/* + * 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.var.atrinik.model.io; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.List; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.gameobject.MultiPositionData; +import net.sf.gridarta.model.io.AbstractArchetypeParser; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.var.atrinik.model.archetype.Archetype; +import net.sf.gridarta.var.atrinik.model.archetype.DefaultArchetypeBuilder; +import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; +import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The <code>ArchetypeParser</code> class handles the parsing of arches. It is a + * class separated from ArchetypeSet because it is also involved in loading + * arches in map files. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype, DefaultArchetypeBuilder> { + + /** + * Action Builder. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The game object parser instance. + */ + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** + * The {@link MultiPositionData} instance to query for multi-part objects. + */ + @NotNull + private final MultiPositionData multiPositionData; + + /** + * The multi-shape ID of the currently parsed archetype. + */ + private int multiShapeID = 0; + + /** + * Creates an ArchetypeParser. + * @param gameObjectParser the game object parser instance to use + * @param animationObjects the animation objects instance to use + * @param archetypeSet the archetype set + * @param gameObjectFactory the factory for creating game objects + * @param multiPositionData the multi position data to query for multi-part + * objects + */ + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final MultiPositionData multiPositionData) { + super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); + this.gameObjectParser = gameObjectParser; + this.multiPositionData = multiPositionData; + } + + /** + * {@inheritDoc} + */ + @Override + protected void initParseArchetype() { + multiShapeID = 0; + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean isStartLine(@NotNull final String line) { + return line.startsWith("Object ") || line.equals("Object"); + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean processLine(@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final DefaultArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List<GameObject> invObjects) throws IOException { + if (line.startsWith("arch ")) { + final GameObject invObject = gameObjectParser.load(in, line, invObjects); + assert invObject != null; + archetypeBuilder.addLast(invObject); + return true; + } + + if (line.startsWith("mpart_id ")) { + // shape ID for multi-parts + try { + multiShapeID = Integer.parseInt(line.substring(9).trim()); + + if (multiShapeID <= 0 || multiShapeID >= MultiPositionData.Y_DIM) { + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " mpart_id number is '" + line.substring(9) + '\''); + } + } catch (final NumberFormatException ignored) { + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_id (" + line.substring(9) + ')'); + archetypeBuilder.addObjectText(line); + } + return true; + } + + if (line.startsWith("mpart_nr ")) { + // part nr for multi-parts + try { + final int i = Integer.parseInt(line.substring(9).trim()); + archetypeBuilder.setMultiPartNr(i); + } catch (final NumberFormatException ignored) { + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, "Arch " + archetypeBuilder.getArchetypeName() + " has a invalid mpart_nr (" + line.substring(9) + ')'); + archetypeBuilder.addObjectText(line); + } + return true; + } + + return false; + } + + /** + * {@inheritDoc} + */ + @Override + protected void finishParseArchetypePart(@Nullable final Archetype firstArch, @NotNull final Archetype archetype, @NotNull final ErrorViewCollector errorViewCollector) { + // set or check mpart_id + archetype.setMultiShapeID(multiShapeID); + if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + protected void finishParseArchetype(@NotNull final Archetype archetype) { + if (archetype.isMulti()) { + calculateLowestMulti(archetype); + } + } + + /** + * {@inheritDoc} + */ + @Override + protected boolean addToPanel(final boolean isInternPath, @NotNull final String editorFolder, @NotNull final Archetype archetype) { + return true; + } + + /** + * Calculate the lowest part of this multi-arch. This lowest part is needed + * because in ISO view, the big image is drawn for it's lowest part, in + * order to get the overlapping correct. <p/> + * @param arch last tail part of this multi + */ + private void calculateLowestMulti(final net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> arch) { + final Archetype head = arch.getHead(); + int minYOffset = multiPositionData.getYOffset(head.getMultiShapeID(), head.getMultiPartNr()); + + // 1.step: find the maximal y-offset + for (net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> tail = head.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + final int t = multiPositionData.getYOffset(tail.getMultiShapeID(), tail.getMultiPartNr()); + if (t < minYOffset) { + minYOffset = t; + } + } + + // 2.step: set 'lowestPart' flag for all squares with maximum offset + for (net.sf.gridarta.model.archetype.Archetype<GameObject, MapArchObject, Archetype> part = head; part != null; part = part.getMultiNext()) { + part.setLowestPart(multiPositionData.getYOffset(part.getMultiShapeID(), part.getMultiPartNr()) <= minYOffset); + } + } + +} // class ArchetypeParser Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -22,11 +22,11 @@ import java.io.File; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.resource.AbstractCollectedResourcesReader; import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.artifact.ArtifactParser; import net.sf.gridarta.model.collectable.AnimationObjectsCollectable; @@ -33,6 +32,7 @@ import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.resource.AbstractResources; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -22,12 +22,12 @@ import java.io.File; import java.util.List; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.resource.AbstractFilesResourcesReader; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; Deleted: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -1,175 +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.var.atrinik.model.archetype; - -import java.io.IOException; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; -import net.sf.gridarta.model.archetype.UndefinedArchetypeException; -import net.sf.gridarta.model.archetypeset.ArchetypeSet; -import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; -import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; -import net.sf.gridarta.model.face.DefaultFaceObjects; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; -import net.sf.gridarta.model.gameobject.MultiPositionData; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.utils.GUIUtils; -import net.sf.gridarta.utils.SystemIcons; -import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; -import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; -import net.sf.gridarta.var.atrinik.model.io.DefaultGameObjectParser; -import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Regression tests for {@link ArchetypeParser}. - * @author Andreas Kirschbaum - */ -public class ArchetypeParserTest extends AbstractArchetypeParserTest<GameObject, MapArchObject, Archetype> { - - /** - * The loaded archetypes. - */ - @Nullable - private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; - - /** - * Checks that mpart_id fields are parsed correctly. - * @throws IOException if the test fails - * @throws UndefinedArchetypeException if the test fails - */ - @Test - public void testMpartIdOk() throws IOException, UndefinedArchetypeException { - final StringBuilder input = new StringBuilder(); - input.append("Object head\n"); - input.append("mpart_id 1\n"); - input.append("end\n"); - input.append("More\n"); - input.append("Object tail\n"); - input.append("mpart_id 1\n"); - input.append("end\n"); - check(input.toString(), false, false, 2); - Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); - Assert.assertEquals(1, getArchetypeSet().getArchetype("tail").getMultiShapeID()); - } - - /** - * Checks that mpart_id fields are parsed correctly. - * @throws IOException if the test fails - * @throws UndefinedArchetypeException if the test fails - */ - @Test - public void testMpartIdInconsistent() throws IOException, UndefinedArchetypeException { - final StringBuilder input = new StringBuilder(); - input.append("Object head\n"); - input.append("mpart_id 1\n"); - input.append("end\n"); - input.append("More\n"); - input.append("Object tail\n"); - input.append("mpart_id 2\n"); - input.append("end\n"); - check(input.toString(), false, true, 2); - Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); - Assert.assertEquals(2, getArchetypeSet().getArchetype("tail").getMultiShapeID()); - } - - /** - * Checks that inventory game objects are recognized. - * @throws IOException if the test fails - * @throws UndefinedArchetypeException if the test fails - */ - @Test - public void testInventoryGameObjects() throws IOException, UndefinedArchetypeException { - final StringBuilder input = new StringBuilder(); - input.append("Object arch1\n"); - input.append("end\n"); - input.append("Object arch2\n"); - input.append("arch arch1\n"); - input.append("name name1\n"); - input.append("end\n"); - input.append("end\n"); - check(input.toString(), false, false, 2); - final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); - Assert.assertEquals(1, arch2.countInvObjects()); - final GameObject inv = arch2.iterator().next(); - Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); - Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); - } - - /** - * Initializes the test. - */ - @BeforeClass - public static void setUp() { - final ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - actionBuilder.addParent(ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta.var.atrinik")); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { - final FaceObjects faceObjects = new DefaultFaceObjects(true); - final GUIUtils guiUtils = new GUIUtils(); - final SystemIcons systemIcons = new SystemIcons(guiUtils); - final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); - final AnimationObjects animationObjects = new DefaultAnimationObjects(); - final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); - final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); - final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); - archetypeSet.setLoadedFromArchive(true); - assert archetypeSet != null; - final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); - assert archetypeSet != null; - final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); - final MultiPositionData multiPositionData = new MultiPositionData(isoMapSquareInfo); - assert archetypeSet != null; - return new ArchetypeParser(gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, multiPositionData); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - @SuppressWarnings("NullableProblems") - protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { - if (archetypeSet == null) { - throw new IllegalStateException(); - } - return archetypeSet; - } - -} // class ArchetypeParserTest Copied: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java (from rev 9138, trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java) =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java (rev 0) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -0,0 +1,176 @@ +/* + * 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.var.atrinik.model.io; + +import java.io.IOException; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; +import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; +import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.archetype.UndefinedArchetypeException; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; +import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.DefaultFaceObjects; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.gameobject.IsoMapSquareInfo; +import net.sf.gridarta.model.gameobject.MultiPositionData; +import net.sf.gridarta.model.io.AbstractArchetypeParser; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import net.sf.gridarta.var.atrinik.model.archetype.Archetype; +import net.sf.gridarta.var.atrinik.model.archetype.DefaultArchetypeFactory; +import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; +import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; +import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Regression tests for {@link ArchetypeParser}. + * @author Andreas Kirschbaum + */ +public class ArchetypeParserTest extends AbstractArchetypeParserTest<GameObject, MapArchObject, Archetype> { + + /** + * The loaded archetypes. + */ + @Nullable + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; + + /** + * Checks that mpart_id fields are parsed correctly. + * @throws IOException if the test fails + * @throws UndefinedArchetypeException if the test fails + */ + @Test + public void testMpartIdOk() throws IOException, UndefinedArchetypeException { + final StringBuilder input = new StringBuilder(); + input.append("Object head\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + input.append("More\n"); + input.append("Object tail\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + check(input.toString(), false, false, 2); + Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); + Assert.assertEquals(1, getArchetypeSet().getArchetype("tail").getMultiShapeID()); + } + + /** + * Checks that mpart_id fields are parsed correctly. + * @throws IOException if the test fails + * @throws UndefinedArchetypeException if the test fails + */ + @Test + public void testMpartIdInconsistent() throws IOException, UndefinedArchetypeException { + final StringBuilder input = new StringBuilder(); + input.append("Object head\n"); + input.append("mpart_id 1\n"); + input.append("end\n"); + input.append("More\n"); + input.append("Object tail\n"); + input.append("mpart_id 2\n"); + input.append("end\n"); + check(input.toString(), false, true, 2); + Assert.assertEquals(1, getArchetypeSet().getArchetype("head").getMultiShapeID()); + Assert.assertEquals(2, getArchetypeSet().getArchetype("tail").getMultiShapeID()); + } + + /** + * Checks that inventory game objects are recognized. + * @throws IOException if the test fails + * @throws UndefinedArchetypeException if the test fails + */ + @Test + public void testInventoryGameObjects() throws IOException, UndefinedArchetypeException { + final StringBuilder input = new StringBuilder(); + input.append("Object arch1\n"); + input.append("end\n"); + input.append("Object arch2\n"); + input.append("arch arch1\n"); + input.append("name name1\n"); + input.append("end\n"); + input.append("end\n"); + check(input.toString(), false, false, 2); + final Archetype arch2 = getArchetypeSet().getArchetype("arch2"); + Assert.assertEquals(1, arch2.countInvObjects()); + final GameObject inv = arch2.iterator().next(); + Assert.assertEquals("arch1", inv.getArchetype().getArchetypeName()); + Assert.assertEquals("name1", inv.getAttributeString(BaseObject.NAME)); + } + + /** + * Initializes the test. + */ + @BeforeClass + public static void setUp() { + final ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + actionBuilder.addParent(ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta.var.atrinik")); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { + final FaceObjects faceObjects = new DefaultFaceObjects(true); + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects animationObjects = new DefaultAnimationObjects(); + final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); + final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); + final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null); + archetypeSet.setLoadedFromArchive(true); + assert archetypeSet != null; + final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); + assert archetypeSet != null; + final IsoMapSquareInfo isoMapSquareInfo = new IsoMapSquareInfo(1, 1, 1, 1); + final MultiPositionData multiPositionData = new MultiPositionData(isoMapSquareInfo); + assert archetypeSet != null; + return new ArchetypeParser(gameObjectParser, animationObjects, archetypeSet, gameObjectFactory, multiPositionData); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + @SuppressWarnings("NullableProblems") + protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { + if (archetypeSet == null) { + throw new IllegalStateException(); + } + return archetypeSet; + } + +} // class ArchetypeParserTest Property changes on: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF 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 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -43,7 +43,6 @@ import net.sf.gridarta.maincontrol.EditorFactory; import net.sf.gridarta.maincontrol.GUIMainControl; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypeset.ArchetypeSet; @@ -60,6 +59,7 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.io.AbstractArchetypeParser; import net.sf.gridarta.model.io.DefaultMapReaderFactory; import net.sf.gridarta.model.io.DirectoryCacheFiles; import net.sf.gridarta.model.io.GameObjectParser; @@ -103,10 +103,10 @@ import net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.DefaultMapPropertiesDialogFactory; import net.sf.gridarta.var.crossfire.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; -import net.sf.gridarta.var.crossfire.model.archetype.ArchetypeParser; import net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; +import net.sf.gridarta.var.crossfire.model.io.ArchetypeParser; import net.sf.gridarta.var.crossfire.model.io.DefaultGameObjectParserFactory; import net.sf.gridarta.var.crossfire.model.io.DefaultMapArchObjectParserFactory; import net.sf.gridarta.var.crossfire.model.maparchobject.DefaultMapArchObjectFactory; Deleted: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 13:20:19 UTC (rev 9138) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -1,199 +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.var.crossfire.model.archetype; - -import java.io.BufferedReader; -import java.io.IOException; -import java.util.List; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.AbstractArchetypeParser; -import net.sf.gridarta.model.archetypeset.ArchetypeSet; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; -import net.sf.gridarta.model.gameobject.GameObjectFactory; -import net.sf.gridarta.model.io.GameObjectParser; -import net.sf.gridarta.model.smoothface.DuplicateSmoothFaceException; -import net.sf.gridarta.model.smoothface.SmoothFace; -import net.sf.gridarta.model.smoothface.SmoothFaces; -import net.sf.gridarta.utils.StringUtils; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * The <code>ArchetypeParser</code> class handles the parsing of arches. It is a - * class separated from ArchetypeSet because it is also involved in loading - * arches in map files. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype, DefaultArchetypeBuilder> { - - /** - * The tag starting the map lore. - */ - @NotNull - private static final String LORE = "lore"; - - /** - * The tag ending the map lore. - */ - @NotNull - private static final String ENDLORE = "endlore"; - - /** - * The tag for smoothing information. - */ - @NotNull - private static final String SMOOTHFACE = "smoothface"; - - /** - * The tag for smoothing information, including a trailing space. - */ - @NotNull - private static final String SMOOTHFACE_SPACE = SMOOTHFACE + " "; - - /** - * The game object parser instance. - */ - private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; - - /** - * The {@link SmoothFaces} instance to update. - */ - @NotNull - private final SmoothFaces smoothFaces; - - /** - * Creates an ArchetypeParser. - * @param gameObjectParser the game object parser instance to use - * @param animationObjects the animation objects instance to use - * @param archetypeSet the archetype set - * @param gameObjectFactory the factory for creating game objects - * @param smoothFaces the smooth faces instance to update - */ - public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SmoothFaces smoothFaces) { - super(new DefaultArchetypeBuilder(gameObjectFactory), animationObjects, archetypeSet); - this.gameObjectParser = gameObjectParser; - this.smoothFaces = smoothFaces; - } - - /** - * {@inheritDoc} - */ - @Override - protected void initParseArchetype() { - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean isStartLine(@NotNull final String line) { - return line.startsWith("Object "); - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean processLine(@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final DefaultArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List<GameObject> invObjects) throws IOException { - if (line.startsWith("arch ")) { - final GameObject invObject = gameObjectParser.load(in, line, invObjects); - assert invObject != null; - archetypeBuilder.addLast(invObject); - return true; - } - - if (line.equals(LORE)) { - parseLore(in, archetypeBuilder, errorViewCollector); - return true; - } - - if (line.startsWith(SMOOTHFACE_SPACE)) { - final String[] tmp = StringUtils.PATTERN_WHITESPACE.split(line.substring(SMOOTHFACE_SPACE.length())); - if (tmp.length == 2) { - try { - smoothFaces.add(new SmoothFace(tmp[0], tmp[1])); - } catch (final DuplicateSmoothFaceException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": duplicate " + SMOOTHFACE + " '" + ex.getMessage() + "': " + line); - } - } else { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, archetypeBuilder.getArchetypeName() + ": invalid " + SMOOTHFACE + " info: " + line); - } - return true; - } - - return false; - } - - /** - * Parses a "lore..endlore" block. - * @param in the reader to read from - * @param archetypeBuilder the archetype builder to update - * @param errorViewCollector the error view collector for reporting errors - * @throws IOException if an I/O error occurs - */ - private static void parseLore(@NotNull final BufferedReader in, @NotNull final DefaultArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector) throws IOException { - final StringBuilder loreText = new StringBuilder(); - - while (true) { - final String thisLine = in.readLine(); - if (thisLine == null) { - errorViewCollector.addError(ErrorViewCategory.ARCHETYPE_INVALID, "Truncated archetype: " + LORE + " not terminated by " + ENDLORE); - return; - } - - if (thisLine.trim().equals(ENDLORE)) { - break; - } - - // keep leading whitespace - loreText.append(thisLine).append("\n"); - } - - archetypeBuilder.setLoreText(loreText.toString()); - } - - /** - * {@inheritDoc} - */ - @Override - protected void finishParseArchetypePart(@Nullable final Archetype firstArch, @NotNull final Archetype archetype, @NotNull final ErrorViewCollector errorViewCollector) { - } - - /** - * {@inheritDoc} - */ - @Override - protected void finishParseArchetype(@NotNull final Archetype archetype) { - } - - /** - * {@inheritDoc} - */ - @Override - protected boolean addToPanel(final boolean isInternPath, @NotNull final String editorFolder, @NotNull final Archetype archetype) { - return !archetype.getArchetypeName().equals(START_ARCH_NAME); - } - -} // class ArchetypeParser Copied: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/ArchetypeParser.java (from rev 9137, trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParser.java) =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/ArchetypeParser.java (rev 0) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/ArchetypeParser.java 2011-12-17 13:27:16 UTC (rev 9139) @@ -0,0 +1,201 @@ +/* + * 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.var.crossfire.model.io; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.List; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.io.AbstractArchetypeParser; +import net.sf.gridarta.model.io.GameObjectParser; +import net.sf.gridarta.model.smoothface.DuplicateSmoothFaceException; +import net.sf.gridarta.model.smoothface.SmoothFace; +import net.sf.gridarta.model.smoothface.SmoothFaces; +import net.sf.gridarta.utils.StringUtils; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetypeBuilder; +import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; +import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * The <code>ArchetypeParser</code> class handles the parsing of arches. It is a + * class separated from ArchetypeSet because it is also involved in loading + * arches in map files. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ArchetypeParser extends AbstractArchetypeParser<GameObject, MapArchObject, Archetype, DefaultArchetypeBuilder> { + + /** + * The tag starting the map lore. + */ + @NotNull + private static final String LORE = "lore"; + + /** + * The tag ending the map lore. + */ + @NotNull + private static final String ENDLORE = "endlore"; + + /** + * The tag for smoothing information. + */ + @NotNull + private static final String SMOOTHFACE = "smoothface"; + + /** + * The tag for smoothing information, including a trailing space. + */ + @NotNull + private static final String SMOOTHFACE_SPACE = SMOOTHFACE + " "; + + /** + * The game object parser instance. + */ + private final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser; + + /** + * The {@link SmoothFaces} instance to update. + */ + @NotNull + private final SmoothFaces smoothFaces; + + /** + * Creates an ArchetypeParser. + * @param gameObjectParser the game object parser instance to use + * @param animationObjects the animation objects instance to use + * @param archetypeSet the archetype set + * @param gameObjectFactory the factory for creating game objects + * @param smoothFaces the smooth faces instance to update + */ + public ArchetypeParser(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AnimationObjects animationObjects, @NotNull ... [truncated message content] |
From: <aki...@us...> - 2011-12-18 08:31:02
|
Revision: 9142 http://gridarta.svn.sourceforge.net/gridarta/?rev=9142&view=rev Author: akirschbaum Date: 2011-12-18 08:30:54 +0000 (Sun, 18 Dec 2011) Log Message: ----------- Move AbstractArchetypeParserTest into correct package. Modified Paths: -------------- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/archetypeset/ trunk/model/src/test/net/sf/gridarta/model/archetypeset/DefaultArchetypeSetTest.java trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java Removed Paths: ------------- trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java 2011-12-17 13:33:23 UTC (rev 9141) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -23,7 +23,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; -import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.io.AbstractArchetypeParserTest; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2011-12-17 13:33:23 UTC (rev 9141) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -23,7 +23,7 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; -import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.io.AbstractArchetypeParserTest; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypeset.ArchetypeSet; import net.sf.gridarta.model.archetypeset.DefaultArchetypeSet; Modified: trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2011-12-17 13:33:23 UTC (rev 9141) +++ trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -20,12 +20,11 @@ package net.sf.gridarta.model.archetypeset; import java.lang.ref.WeakReference; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; -import java.util.TreeMap; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetype.ArchetypeSetListener; @@ -57,17 +56,12 @@ private final String imageSet; /** - * The defined Archetypes mapped by name. - */ - private final Map<String, R> archetypeMap = new TreeMap<String, R>(); - - /** - * The defined Archetypes sorted by load order. Collecting them must retain - * the load order. When they are loaded from the collection, the - * editor_folders must not be mixed. + * The defined Archetypes mapped by name. The defined Archetypes are sorted + * by load order. Collecting them must retain the load order. When they are + * loaded from the collection, the editor_folders must not be mixed. * @todo solve this issue */ - private final Collection<R> archetypes = new ArrayList<R>(); + private final Map<String, R> archetypeMap = new LinkedHashMap<String, R>(); /** * Whether Archetypes were loaded form an archive. @@ -174,7 +168,6 @@ } archetypeMap.put(name, archetype); - archetypes.add(archetype); } /** @@ -196,7 +189,7 @@ @NotNull @Override public Collection<R> getArchetypes() { - return Collections.unmodifiableCollection(archetypes); + return Collections.unmodifiableCollection(archetypeMap.values()); } /** Deleted: trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java 2011-12-17 13:33:23 UTC (rev 9141) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -1,83 +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.model.archetype; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.util.ArrayList; -import java.util.List; -import net.sf.gridarta.model.archetypeset.ArchetypeSet; -import net.sf.gridarta.model.errorview.ErrorViewCollector; -import net.sf.gridarta.model.errorview.TestErrorView; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.io.AbstractArchetypeParser; -import net.sf.gridarta.model.io.ArchetypeParser; -import net.sf.gridarta.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.junit.Assert; - -/** - * Abstract base class for regression tests for {@link ArchetypeParser}. - * @author Andreas Kirschbaum - */ -public abstract class AbstractArchetypeParserTest<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { - - /** - * Creates a new archetype parser and parses the given input. - * @param input the input to parse - * @param hasErrors whether errors are expected - * @param hasWarnings whether warnings are expected - * @param archetypes the number of archetypes to expect - * @throws IOException if parsing fails - */ - protected void check(@NotNull final String input, final boolean hasErrors, final boolean hasWarnings, final int archetypes) throws IOException { - final AbstractArchetypeParser<G, A, R, ?> archetypeParser = newArchetypeParser(); - final TestErrorView errorView = new TestErrorView(); - final List<G> invObjects = new ArrayList<G>(); - final Reader reader = new StringReader(input); - final BufferedReader bufferedReader = new BufferedReader(reader); - try { - archetypeParser.parseArchetypeFromStream(bufferedReader, null, null, null, "panel", "folder", "", invObjects, new ErrorViewCollector(errorView, new File("*string*"))); - } finally { - bufferedReader.close(); - } - Assert.assertEquals(hasErrors, errorView.hasErrors()); - Assert.assertEquals(hasWarnings, errorView.hasWarnings()); - Assert.assertEquals(archetypes, getArchetypeSet().getArchetypeCount()); - } - - /** - * Creates a new {@link AbstractArchetypeParser} instance. - * @return the new instance - */ - @NotNull - protected abstract AbstractArchetypeParser<G, A, R, ? extends AbstractArchetypeBuilder<G, A, R>> newArchetypeParser(); - - /** - * Returns the {@link ArchetypeSet}. - * @return the archetype set - */ - @NotNull - protected abstract ArchetypeSet<G, A, R> getArchetypeSet(); - -} // class AbstractArchetypeParserTest Added: trunk/model/src/test/net/sf/gridarta/model/archetypeset/DefaultArchetypeSetTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypeset/DefaultArchetypeSetTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/archetypeset/DefaultArchetypeSetTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -0,0 +1,75 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.archetypeset; + +import java.util.Collection; +import java.util.Iterator; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.TestAnimationObjects; +import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.archetype.TestArchetypeFactory; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.face.TestFaceObjects; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link DefaultArchetypeSet}. + * @author Andreas Kirschbaum + */ +public class DefaultArchetypeSetTest { + + /** + * Checks that archetypes are returned in load order. + * @throws DuplicateArchetypeException if the test fails + */ + @Test + public void testRetainLoadOrder() throws DuplicateArchetypeException { + final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory = new TestArchetypeFactory(); + final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new DefaultArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype>(archetypeFactory, null); + final FaceObjects faceObjects = new TestFaceObjects(); + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); + final AnimationObjects animationObjects = new TestAnimationObjects(); + archetypeSet.addArchetype(new TestArchetype("b", faceObjectProviders, animationObjects)); + archetypeSet.addArchetype(new TestArchetype("d", faceObjectProviders, animationObjects)); + archetypeSet.addArchetype(new TestArchetype("c", faceObjectProviders, animationObjects)); + archetypeSet.addArchetype(new TestArchetype("e", faceObjectProviders, animationObjects)); + archetypeSet.addArchetype(new TestArchetype("a", faceObjectProviders, animationObjects)); + final Collection<TestArchetype> archetypes = archetypeSet.getArchetypes(); + Assert.assertEquals(5, archetypes.size()); + final Iterator<TestArchetype> it = archetypes.iterator(); + Assert.assertEquals("b", it.next().getArchetypeName()); + Assert.assertEquals("d", it.next().getArchetypeName()); + Assert.assertEquals("c", it.next().getArchetypeName()); + Assert.assertEquals("e", it.next().getArchetypeName()); + Assert.assertEquals("a", it.next().getArchetypeName()); + Assert.assertFalse(it.hasNext()); + } + +} Property changes on: trunk/model/src/test/net/sf/gridarta/model/archetypeset/DefaultArchetypeSetTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java (from rev 9139, trunk/model/src/test/net/sf/gridarta/model/archetype/AbstractArchetypeParserTest.java) =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -0,0 +1,83 @@ +/* + * 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.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.List; +import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetypeset.ArchetypeSet; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.model.errorview.TestErrorView; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.junit.Assert; + +/** + * Abstract base class for regression tests for {@link ArchetypeParser}. + * @author Andreas Kirschbaum + */ +public abstract class AbstractArchetypeParserTest<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * Creates a new archetype parser and parses the given input. + * @param input the input to parse + * @param hasErrors whether errors are expected + * @param hasWarnings whether warnings are expected + * @param archetypes the number of archetypes to expect + * @throws IOException if parsing fails + */ + protected void check(@NotNull final String input, final boolean hasErrors, final boolean hasWarnings, final int archetypes) throws IOException { + final AbstractArchetypeParser<G, A, R, ?> archetypeParser = newArchetypeParser(); + final TestErrorView errorView = new TestErrorView(); + final List<G> invObjects = new ArrayList<G>(); + final Reader reader = new StringReader(input); + final BufferedReader bufferedReader = new BufferedReader(reader); + try { + archetypeParser.parseArchetypeFromStream(bufferedReader, null, null, null, "panel", "folder", "", invObjects, new ErrorViewCollector(errorView, new File("*string*"))); + } finally { + bufferedReader.close(); + } + Assert.assertEquals(hasErrors, errorView.hasErrors()); + Assert.assertEquals(hasWarnings, errorView.hasWarnings()); + Assert.assertEquals(archetypes, getArchetypeSet().getArchetypeCount()); + } + + /** + * Creates a new {@link AbstractArchetypeParser} instance. + * @return the new instance + */ + @NotNull + protected abstract AbstractArchetypeParser<G, A, R, ? extends AbstractArchetypeBuilder<G, A, R>> newArchetypeParser(); + + /** + * Returns the {@link ArchetypeSet}. + * @return the archetype set + */ + @NotNull + protected abstract ArchetypeSet<G, A, R> getArchetypeSet(); + +} // class AbstractArchetypeParserTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java 2011-12-17 13:33:23 UTC (rev 9141) +++ trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java 2011-12-18 08:30:54 UTC (rev 9142) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.TestAnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; -import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.archetype.TestArchetypeBuilder; import net.sf.gridarta.model.archetype.TestArchetypeFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2012-01-02 19:32:46
|
Revision: 9152 http://gridarta.svn.sourceforge.net/gridarta/?rev=9152&view=rev Author: akirschbaum Date: 2012-01-02 19:32:34 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Remove @inheritDoc Javadoc comments from anonymous classes. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ValidationError.java trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexTest.java trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/FilterGameObjectIteratorTest.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecutor.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginController.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManager.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterNameEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java trunk/src/app/net/sf/gridarta/gui/filter/BtnPopup.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/AbstractPerMapDialogManager.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/MapPreviewAccessory.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/MapTilePanel.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/ErroneousMapSquares.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapCursorTracker.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.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/mapdesktop/WindowMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCache.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDragSource.java trunk/src/app/net/sf/gridarta/gui/mapmenu/TreeDropTarget.java trunk/src/app/net/sf/gridarta/gui/mapuserlistener/MapUserListenerManager.java trunk/src/app/net/sf/gridarta/gui/misc/MainToolbar.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.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/panel/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/panel/archetypechooser/DirectionPane.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/ConnectionView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/Control.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/LockedItemsView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/MonsterView.java trunk/src/app/net/sf/gridarta/gui/panel/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/AbstractGameObjectAttributesTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/ErrorListView.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/FaceTab.java trunk/src/app/net/sf/gridarta/gui/panel/gameobjectattributes/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/panel/objectchooser/DefaultObjectChooser.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserModel.java trunk/src/app/net/sf/gridarta/gui/panel/pickmapchooser/PickmapChooserView.java trunk/src/app/net/sf/gridarta/gui/panel/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/panel/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java trunk/src/app/net/sf/gridarta/gui/utils/AsynchronousProgress.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonList.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/ButtonLists.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateState.java trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/mainactions/RandomFillDialog.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditUndoActions.java trunk/textedit/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/utils/src/app/net/sf/gridarta/utils/ProcessRunner.java trunk/utils/src/app/net/sf/gridarta/utils/XmlHelper.java trunk/utils/src/test/net/sf/gridarta/utils/HideFileFilterProxyTest.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -124,37 +124,31 @@ @NotNull private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { - /** {@inheritDoc} */ @Override public void gridVisibleChanged(final boolean gridVisible) { forceRepaint(); } - /** {@inheritDoc} */ @Override public void smoothingChanged(final boolean smoothing) { forceRepaint(); } - /** {@inheritDoc} */ @Override public void doubleFacesChanged(final boolean doubleFaces) { // does not render double faces } - /** {@inheritDoc} */ @Override public void alphaTypeChanged(final int alphaType) { // does not render alpha types } - /** {@inheritDoc} */ @Override public void editTypeChanged(final int editType) { // changed game objects will be rendered } - /** {@inheritDoc} */ @Override public void autojoinChanged(final boolean autojoin) { // does not affect rendering @@ -168,13 +162,11 @@ @NotNull private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { - /** {@inheritDoc} */ @Override public void mapSizeChanged(@NotNull final Size2D newSize) { // ignore: will trigger an mapGridChanged() callback } - /** {@inheritDoc} */ @Override public void mapSquaresChanged(@NotNull final Set<MapSquare<GameObject, MapArchObject, Archetype>> mapSquares) { final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); @@ -186,9 +178,6 @@ } } - /** - * {@inheritDoc} - */ @Override public void mapObjectsChanged(@NotNull final Set<GameObject> gameObjects, @NotNull final Set<GameObject> transientGameObjects) { final Collection<MapSquare<GameObject, MapArchObject, Archetype>> toRepaint = new HashSet<MapSquare<GameObject, MapArchObject, Archetype>>(); @@ -241,25 +230,16 @@ } } - /** - * {@inheritDoc} - */ @Override public void errorsChanged(@NotNull final ErrorCollector<GameObject, MapArchObject, Archetype> errors) { // ignore } - /** - * {@inheritDoc} - */ @Override public void mapFileChanged(@Nullable final File oldMapFile) { // ignore } - /** - * {@inheritDoc} - */ @Override public void modifiedChanged() { // ignore @@ -273,9 +253,6 @@ @NotNull private final MapGridListener mapGridListener = new MapGridListener() { - /** - * {@inheritDoc} - */ @Override public void mapGridChanged(@NotNull final MapGridEvent e) { final Rectangle recChange = mapGrid.getRecChange(); @@ -283,9 +260,6 @@ repaint(0L, borderOffset.x + recChange.x * IGUIConstants.SQUARE_WIDTH, borderOffset.y + recChange.y * IGUIConstants.SQUARE_HEIGHT, recChange.width * IGUIConstants.SQUARE_WIDTH, recChange.height * IGUIConstants.SQUARE_HEIGHT); } - /** - * {@inheritDoc} - */ @Override public void mapGridResized(@NotNull final MapGridEvent e) { resizeMapGrid(); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -134,9 +134,6 @@ @NotNull private final FilterConfigListener filterConfigListener = new FilterConfigListener() { - /** - * {@inheritDoc} - */ @Override public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -302,7 +302,6 @@ */ private static final Comparator<String> keyOrderComparator = new Comparator<String>() { - /** {@inheritDoc} */ @Override public int compare(final String o1, final String o2) { final Integer i1 = keys.get(o1); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -75,9 +75,6 @@ @NotNull private final transient ArchetypeChooserPanelListener<G, A, R> archetypeChooserPanelListener = new ArchetypeChooserPanelListener<G, A, R>() { - /** - * {@inheritDoc} - */ @Override public void selectedFolderChanged(@NotNull final ArchetypeChooserFolder<G, A, R> selectedFolder) { fireSelectedFolderChanged(selectedFolder); @@ -85,9 +82,6 @@ //fireSelectedArchetypeChanged(selectedFolder.getSelectedArchetype()); } - /** - * {@inheritDoc} - */ @Override public void selectedArchetypeChanged(@Nullable final R selectedArchetype) { fireSelectedArchetypeChanged(selectedArchetype); Modified: trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -74,9 +74,6 @@ @NotNull private final transient ArchetypeChooserFolderListener<G, A, R> archetypeChooserFolderListener = new ArchetypeChooserFolderListener<G, A, R>() { - /** - * {@inheritDoc} - */ @Override public void selectedArchetypeChanged(@Nullable final R selectedArchetype) { fireSelectedArchetypeChanged(selectedArchetype); Modified: trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -89,19 +89,19 @@ contents = new ArrayList<G>(0); recursive = new Iterable<G>() { - /** {@inheritDoc} */ @Override public Iterator<G> iterator() { return new RecursiveGameObjectIterator<G, A, R>(GameObjectContainer.this); } + }; reverse = new Iterable<G>() { - /** {@inheritDoc} */ @Override public Iterator<G> iterator() { return new ReverseIterator<G>(contents); } + }; } @@ -125,20 +125,17 @@ @Nullable private G current = null; - /** {@inheritDoc} */ @Override public boolean hasNext() { return delegate.hasNext(); } - /** {@inheritDoc} */ @Override public G next() { current = delegate.next(); return current; } - /** {@inheritDoc} */ @Override public void remove() { // keep this in sync with GameObjectContainer#remove(G) @@ -699,17 +696,11 @@ delegate = list.listIterator(list.size()); } - /** - * {@inheritDoc} - */ @Override public boolean hasNext() { return delegate.hasPrevious(); } - /** - * {@inheritDoc} - */ // previous can throw NoSuchElementException but InspectionGadgets doesn't know about that. @SuppressWarnings("IteratorNextCanNotThrowNoSuchElementException") @NotNull @@ -718,9 +709,6 @@ return delegate.previous(); } - /** - * {@inheritDoc} - */ @Override public void remove() { if (delegate.nextIndex() == 0 && list.size() >= 2) { Modified: trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -106,14 +106,12 @@ /** * Converts every second pixel by making it transparent. - * {@inheritDoc} */ @Override public int filterRGB(final int x, final int y, final int rgb) { return (x + y) % 2 == 0 ? rgb & ColourFilter.RED_GREEN_BLUE_MASK : rgb; } - /** {@inheritDoc} */ @NotNull @Override public Object clone() { @@ -249,17 +247,11 @@ final boolean[] undefinedArchetype = new boolean[1]; baseObject.visit(new BaseObjectVisitor<G, A, R>() { - /** - * {@inheritDoc} - */ @Override public void visit(@NotNull final Archetype<G, A, R> archetype) { undefinedArchetype[0] = archetype.isUndefinedArchetype(); } - /** - * {@inheritDoc} - */ @Override public void visit(@NotNull final GameObject<G, A, R> gameObject) { undefinedArchetype[0] = gameObject.hasUndefinedArchetype(); Modified: trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -53,7 +53,6 @@ @NotNull private final FilterConfigListener filterConfigListener = new FilterConfigListener() { - /** {@inheritDoc} */ @Override public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { // XXX What's with newConfigEvent? Modified: trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -221,33 +221,21 @@ @NotNull private final IndexListener<File> indexListener = new IndexListener<File>() { - /** - * {@inheritDoc} - */ @Override public void valueAdded(@NotNull final File value) { // ignore } - /** - * {@inheritDoc} - */ @Override public void valueRemoved(@NotNull final File value) { // ignore } - /** - * {@inheritDoc} - */ @Override public void nameChanged() { // ignore } - /** - * {@inheritDoc} - */ @Override public void pendingChanged() { mapsIndexSemaphore.release(); Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -200,15 +200,11 @@ */ private final transient MapArchObjectListener mapArchObjectListener = new MapArchObjectListener() { - /** {@inheritDoc} */ @Override public void mapMetaChanged() { setModified(); } - /** - * {@inheritDoc} - */ @Override public void mapSizeChanged(@NotNull final Size2D mapSize) { resizeMapInt(mapSize); Modified: trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -116,9 +116,6 @@ this.actions = actions; } - /** - * {@inheritDoc} - */ @Override public void actionPerformed(@NotNull final ActionEvent e) { for (final GameObjectMatcherToggleAction action : actions) { @@ -126,9 +123,6 @@ } } - /** - * {@inheritDoc} - */ @NotNull @Override protected Object clone() { @@ -182,9 +176,6 @@ this.mutableOrArchObjectMatcher = mutableOrArchObjectMatcher; } - /** - * {@inheritDoc} - */ @Override public void actionPerformed(@NotNull final ActionEvent e) { if (!isEnabled()) { @@ -216,9 +207,6 @@ return selected; } - /** - * {@inheritDoc} - */ @NotNull @Override protected Object clone() { Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -196,7 +196,6 @@ final PreferenceChangeListener preferenceChangeListener = new PreferenceChangeListener() { - /** {@inheritDoc} */ @Override public void preferenceChange(final PreferenceChangeEvent evt) { if (evt.getKey().equals(SHOW_MAIN_TOOLBAR_KEY)) { Modified: trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -43,7 +43,6 @@ */ private static final Comparator<Spell> spellComparator = new Comparator<Spell>() { - /** {@inheritDoc} */ @Override public int compare(final Spell o1, final Spell o2) { return String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()); Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -118,13 +118,11 @@ final ArchetypeAttributeVisitor archetypeAttributeVisitor = new ArchetypeAttributeVisitor() { - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeAnimationName archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBitmask archetypeAttribute) { final AttributeBitmask bitmask = archetypeTypeSet.getBitmask(archetypeAttribute.getBitmaskName()); @@ -137,7 +135,6 @@ } } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBool archetypeAttribute) { try { @@ -147,31 +144,26 @@ } } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBoolSpec archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFaceName archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFixed archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFloat archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeInt archetypeAttribute) { try { @@ -181,61 +173,51 @@ } } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeInvSpell archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeList archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeLong archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeMapPath archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeScriptFile archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeSpell archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeString archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeText archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeTreasure archetypeAttribute) { // XXX: missing } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeZSpell archetypeAttribute) { // XXX: missing Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ValidationError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ValidationError.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/ValidationError.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -332,18 +332,12 @@ */ private static final long serialVersionUID = 1L; - /** - * {@inheritDoc} - */ @NotNull @Override public String toString(@NotNull final G obj) { return obj.getBestName(); } - /** - * {@inheritDoc} - */ @Override public int compare(@NotNull final G o1, @NotNull final G o2) { return toString(o1).compareTo(toString(o2)); @@ -362,18 +356,12 @@ */ private static final long serialVersionUID = 1L; - /** - * {@inheritDoc} - */ @NotNull @Override public String toString(@NotNull final MapSquare<G, A, R> obj) { return obj.getMapX() + "|" + obj.getMapY(); } - /** - * {@inheritDoc} - */ @Override public int compare(@NotNull final MapSquare<G, A, R> o1, @NotNull final MapSquare<G, A, R> o2) { final int y1 = o1.getMapY(); Modified: trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexTest.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexTest.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -200,41 +200,26 @@ @NotNull private final StringBuilder stringBuilder = new StringBuilder(); - /** - * {@inheritDoc} - */ @Override public void valueAdded(@NotNull final File value) { stringBuilder.append("add ").append(value).append("\n"); } - /** - * {@inheritDoc} - */ @Override public void valueRemoved(@NotNull final File value) { stringBuilder.append("del ").append(value).append("\n"); } - /** - * {@inheritDoc} - */ @Override public void nameChanged() { stringBuilder.append("name changed\n"); } - /** - * {@inheritDoc} - */ @Override public void pendingChanged() { stringBuilder.append("pending changed\n"); } - /** - * {@inheritDoc} - */ @Override public void indexingFinished() { stringBuilder.append("indexing finished"); Modified: trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -490,17 +490,11 @@ */ private int changedModeCounter = 0; - /** - * {@inheritDoc} - */ @Override public void mapCursorChangedPos(@Nullable final Point location) { changedPosCounter++; } - /** - * {@inheritDoc} - */ @Override public void mapCursorChangedMode() { changedModeCounter++; Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -56,25 +56,16 @@ @NotNull private final MapModelListener<TestGameObject, TestMapArchObject, TestArchetype> mapModelListener = new MapModelListener<TestGameObject, TestMapArchObject, TestArchetype>() { - /** - * {@inheritDoc} - */ @Override public void mapSizeChanged(@NotNull final Size2D newSize) { log("mapSizeChanged", null, null); } - /** - * {@inheritDoc} - */ @Override public void mapSquaresChanged(@NotNull final Set<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> mapSquares) { log("mapSquaresChanged", mapSquares, null); } - /** - * {@inheritDoc} - */ @Override public void mapObjectsChanged(@NotNull final Set<TestGameObject> gameObjects, @NotNull final Set<TestGameObject> transientGameObjects) { if (!gameObjects.isEmpty()) { @@ -85,29 +76,21 @@ } } - /** - * {@inheritDoc} - */ @Override public void errorsChanged(@NotNull final ErrorCollector<TestGameObject, TestMapArchObject, TestArchetype> errors) { result.append("errorsChanged"); } - /** - * {@inheritDoc} - */ @Override public void mapFileChanged(@Nullable final File oldMapFile) { // ignore } - /** - * {@inheritDoc} - */ @Override public void modifiedChanged() { // ignore } + }; /** @@ -117,17 +100,11 @@ @NotNull private final MapArchObjectListener mapArchObjectListener = new MapArchObjectListener() { - /** - * {@inheritDoc} - */ @Override public void mapMetaChanged() { result.append("mapMetaChanged"); } - /** - * {@inheritDoc} - */ @Override public void mapSizeChanged(@NotNull final Size2D mapSize) { // ignore Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/FilterGameObjectIteratorTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/FilterGameObjectIteratorTest.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/FilterGameObjectIteratorTest.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -101,9 +101,6 @@ */ private static final long serialVersionUID = 1L; - /** - * {@inheritDoc} - */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> gameObject) { return true; @@ -135,9 +132,6 @@ this.gameObjects.addAll(Arrays.asList(gameObjects)); } - /** - * {@inheritDoc} - */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> gameObject) { return gameObjects.contains(gameObject); @@ -170,17 +164,11 @@ this.gameObjects = gameObjects.clone(); } - /** - * {@inheritDoc} - */ @Override public boolean hasNext() { return index < gameObjects.length; } - /** - * {@inheritDoc} - */ @Override public TestGameObject next() { if (index >= gameObjects.length) { @@ -189,13 +177,11 @@ return gameObjects[index++]; } - /** - * {@inheritDoc} - */ @Override public void remove() { throw new UnsupportedOperationException(); } } + } Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecutor.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecutor.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecutor.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -109,37 +109,31 @@ final ConsoleInterface console = new ConsoleInterface() { - /** {@inheritDoc} */ @Override public Reader getIn() { return new InputStreamReader(System.in); } - /** {@inheritDoc} */ @Override public PrintStream getOut() { return System.out; } - /** {@inheritDoc} */ @Override public PrintStream getErr() { return System.err; } - /** {@inheritDoc} */ @Override public void println(final Object o) { System.out.println(o); } - /** {@inheritDoc} */ @Override public void print(final Object o) { System.out.print(o); } - /** {@inheritDoc} */ @Override public void error(final Object o) { System.err.println(o); Modified: trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -76,7 +76,6 @@ @NotNull private final PreferenceChangeListener preferenceChangeListener = new PreferenceChangeListener() { - /** {@inheritDoc} */ @Override public void preferenceChange(final PreferenceChangeEvent evt) { final String key = evt.getKey(); @@ -98,7 +97,6 @@ @NotNull private final DelayedMapModelListener<G, A, R> delayedMapModelListener = new DelayedMapModelListener<G, A, R>() { - /** {@inheritDoc} */ @Override public void mapModelChanged(@NotNull final MapModel<G, A, R> mapModel) { if (wasEnabled) { Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -42,13 +42,11 @@ * Clear the selection. */ DO_CLEAR { - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void prepare(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D mapSize) { // ignore } - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType) { @@ -62,14 +60,12 @@ * Cut the selection. */ DO_CUT { - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void prepare(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D mapSize) { mapModel.getMapArchObject().setMapSize(mapSize); mapModel.clearMap(); } - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType) { @@ -89,14 +85,12 @@ * Copy the selection. */ DO_COPY { - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void prepare(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Size2D mapSize) { mapModel.getMapArchObject().setMapSize(mapSize); mapModel.clearMap(); } - /** {@inheritDoc} */ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, @NotNull final Point pos, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType && gameObject.isHead() && !gameObject.isInContainer()) { Modified: trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -81,12 +81,9 @@ final JOptionPane pane = new JOptionPane(scrollPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null); final Window dialog = pane.createDialog(parentComponent, ACTION_BUILDER.format("chooseNamedObject.title", namedObjects.getName())); pane.selectInitialValue(); + //noinspection RefusedBequest tree.addMouseListener(new MouseAdapter() { - /** - * {@inheritDoc} - * @noinspection RefusedBequest - */ @Override public void mousePressed(final MouseEvent e) { if (e.getClickCount() == 2) { Modified: trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -114,13 +114,11 @@ @NotNull private final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { - /** {@inheritDoc} */ @Override public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) { // ignore } - /** {@inheritDoc} */ @Override public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) { final MapModel<G, A, R> mapModel = mapControl.getMapModel(); @@ -133,13 +131,11 @@ scheduleMapModel(mapModel); } - /** {@inheritDoc} */ @Override public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) { // ignore } - /** {@inheritDoc} */ @Override public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) { final MapModel<G, A, R> mapModel = mapControl.getMapModel(); @@ -163,7 +159,6 @@ */ private final Thread thread = new Thread(new Runnable() { - /** {@inheritDoc} */ @Override public void run() { try { @@ -191,7 +186,6 @@ try { SwingUtilities.invokeAndWait(new Runnable() { - /** {@inheritDoc} */ @Override public void run() { for (final Map.Entry<MapModel<G, A, R>, Void> e : mapModels.entrySet()) { @@ -225,9 +219,6 @@ final ExiterListener exiterListener = new ExiterListener() { - /** - * {@inheritDoc} - */ @Override public void preExitNotify() { thread.interrupt(); @@ -239,17 +230,11 @@ } } - /** - * {@inheritDoc} - */ @Override public void appExitNotify() { // ignore } - /** - * {@inheritDoc} - */ @Override public void waitExitNotify() { // ignore @@ -333,49 +318,31 @@ this.mapModel = mapModel; } - /** - * {@inheritDoc} - */ @Override public void mapSizeChanged(@NotNull final Size2D newSize) { scheduleMapModel(mapModel); } - /** - * {@inheritDoc} - */ @Override public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) { scheduleMapModel(mapModel); } - /** - * {@inheritDoc} - */ @Override public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) { scheduleMapModel(mapModel); } - /** - * {@inheritDoc} - */ @Override public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) { // ignore } - /** - * {@inheritDoc} - */ @Override public void mapFileChanged(@Nullable final File oldMapFile) { scheduleMapModel(mapModel); } - /** - * {@inheritDoc} - */ @Override public void modifiedChanged() { // ignore @@ -403,17 +370,11 @@ this.mapModel = mapModel; } - /** - * {@inheritDoc} - */ @Override public void mapMetaChanged() { scheduleMapModel(mapModel); } - /** - * {@inheritDoc} - */ @Override public void mapSizeChanged(@NotNull final Size2D mapSize) { // ignore Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkDirectoryDialog.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -101,19 +101,16 @@ final DocumentListener documentListener = new DocumentListener() { - /** {@inheritDoc} */ @Override public void insertUpdate(@NotNull final DocumentEvent e) { updateOkButton(); } - /** {@inheritDoc} */ @Override public void removeUpdate(@NotNull final DocumentEvent e) { updateOkButton(); } - /** {@inheritDoc} */ @Override public void changedUpdate(@NotNull final DocumentEvent e) { updateOkButton(); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -100,19 +100,16 @@ final DocumentListener documentListener = new DocumentListener() { - /** {@inheritDoc} */ @Override public void insertUpdate(@NotNull final DocumentEvent e) { updateOkButton(); } - /** {@inheritDoc} */ @Override public void removeUpdate(@NotNull final DocumentEvent e) { updateOkButton(); } - /** {@inheritDoc} */ @Override public void changedUpdate(@NotNull final DocumentEvent e) { updateOkButton(); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -160,7 +160,6 @@ private void addEntry(final ErrorViewCategory categoryName, final String message) { final Runnable runnable = new Runnable() { - /** {@inheritDoc} */ @Override public void run() { final ErrorEntry category = getCategory(categoryName); @@ -242,7 +241,6 @@ /** The serial version UID. */ private static final long serialVersionUID = 1L; - /** {@inheritDoc} */ @Override public void setValue(@Nullable final Object newValue) { super.setValue(newValue); @@ -273,7 +271,6 @@ if (hasDialog()) { final Runnable runnable = new Runnable() { - /** {@inheritDoc} */ @Override public void run() { assert okButton != null; Modified: trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -57,19 +57,16 @@ final MapViewManagerListener<G, A, R> mapViewManagerListener = new MapViewManagerListener<G, A, R>() { - /** {@inheritDoc} */ @Override public void activeMapViewChanged(@Nullable final MapView<G, A, R> mapView) { // ignore } - /** {@inheritDoc} */ @Override public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) { // ignore } - /** {@inheritDoc} */ @Override public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) { disposeDialog(mapView); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -142,19 +142,16 @@ final DocumentListener documentListener = new DocumentListener() { - /** {@inheritDoc} */ @Override public void changedUpdate(@NotNull final DocumentEvent e) { doSearch(false); } - /** {@inheritDoc} */ @Override public void insertUpdate(@NotNull final DocumentEvent e) { doSearch(false); } - /** {@inheritDoc} */ @Override public void removeUpdate(@NotNull final DocumentEvent e) { doSearch(false); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -83,7 +83,6 @@ */ private final Comparator<Integer> comparator = new Comparator<Integer>() { - /** {@inheritDoc} */ @Override public int compare(final Integer o1, final Integer o2) { final Archetype<G, A, R> archetype1 = archetypes.get(o1); Modified: trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2012-01-02 19:01:35 UTC (rev 9151) +++ trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java 2012-01-02 19:32:34 UTC (rev 9152) @@ -412,7 +412,6 @@ @NotNull private final ArchetypeAttributeVisitor archetypeAttributeVisitor = new ArchetypeAttributeVisitor() { - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeAnimationName archetypeAttribute) { final String attributeName = archetypeAttribute.getArchetypeAttributeName(); @@ -422,7 +421,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeAnimationName>(new DialogAttributeAnimationName<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBitmask archetypeAttribute) { final JTextArea input = new JTextArea(); @@ -449,14 +447,12 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeBitmask>(tmpAttribute, cLabel, cComp, cRow, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBool archetypeAttribute) { final JCheckBox input = new JCheckBox(archetypeAttribute.getAttributeName(), gameObject.getAttributeInt(archetypeAttribute.getArchetypeAttributeName()) == 1); guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeBool>(new DialogAttributeBool<G, A, R>(archetypeAttribute, input), null, null, input, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBoolSpec archetypeAttribute) { final CharSequence attributeString = gameObject.getAttributeString(archetypeAttribute.getArchetypeAttributeName()); @@ -470,7 +466,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeBoolSpec>(new DialogAttributeBoolSpec<G, A, R>(archetypeAttribute, input), null, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFaceName archetypeAttribute) { final String attributeName = archetypeAttribute.getArchetypeAttributeName(); @@ -480,13 +475,11 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeFaceName>(new DialogAttributeFaceName<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFixed archetypeAttribute) { throw new AssertionError(); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeFloat archetypeAttribute) { final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); @@ -505,7 +498,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeFloat>(new DialogAttributeFloat<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeInt archetypeAttribute) { final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); @@ -522,7 +514,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeInt>(new DialogAttributeInt<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeInvSpell archetypeAttribute) { final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); @@ -532,7 +523,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeInvSpell>(new DialogAttributeInvSpell<G, A, R>(archetypeAttribute.isOptionalSpell(), archetypeAttribute, input, gameObjectSpells), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeList archetypeAttribute) { final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); @@ -553,7 +543,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeList>(new DialogAttributeList<G, A, R>(archetypeAttribute, input, archetypeTypeSet), cLabel, cComp, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeLong archetypeAttribute) { final JLabel cLabel = new JLabel(archetypeAttribute.getAttributeName() + ": "); @@ -570,7 +559,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeLong>(new DialogAttributeLong<G, A, R>(archetypeAttribute, input), cLabel, input, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeMapPath archetypeAttribute) { final MapSquare<G, A, R> mapSquare = gameObject.getMapSquare(); @@ -583,7 +571,6 @@ guiInfo = new GuiInfo<G, A, R, ArchetypeAttributeMapPath>(new DialogAttributeMapPath<G, A, R>(archetypeAttribute, tilePanel), cLabel, tilePanel, null, null, false); } - /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeScriptFile archetypeAttribute) { ... [truncated message content] |
From: <aki...@us...> - 2012-01-02 20:48:44
|
Revision: 9153 http://gridarta.svn.sourceforge.net/gridarta/?rev=9153&view=rev Author: akirschbaum Date: 2012-01-02 20:48:16 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Remove unneeded comments. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/DefaultRendererFactory.java 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/gui/scripts/DefaultScriptArchUtils.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/AtrinikEditor.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/Archetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeBuilder.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetypeFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/ArchetypeParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultGameObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/DefaultMapArchObjectParserFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/MapArchObjectParser.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/DefaultMapArchObjectFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEventFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/CollectedConfigSource.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/DefaultGlobalSettings.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/settings/FilesConfigSource.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/DefaultResources.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/io/ArchetypeParserTest.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObjectTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/DefaultRendererFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SmoothingRenderer.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/gui/scripts/DefaultScriptArchUtils.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/CrossfireEditor.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/Archetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeBuilder.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetypeFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/ArchetypeParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultMapArchObjectParserFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/DefaultMapArchObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEventFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/CollectedConfigSource.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/DefaultGlobalSettings.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/settings/FilesConfigSource.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/validation/checks/NonAbsoluteExitPathChecker.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/DefaultResources.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/io/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/validation/checks/ValidatorFactoryTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/DefaultRendererFactory.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/gui/scripts/DefaultScriptArchUtils.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DaimoninEditor.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/Archetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetypeBuilder.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetypeFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultGameObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/DefaultMapArchObjectParserFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/MapArchObjectParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/DefaultMapArchObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEventFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/CollectedConfigSource.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/DefaultGlobalSettings.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/settings/FilesConfigSource.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/DefaultResources.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/daimonin/src/test/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObjectTest.java trunk/model/src/app/net/sf/gridarta/model/anim/AbstractAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObject.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationParseException.java trunk/model/src/app/net/sf/gridarta/model/anim/AnimationValidator.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObject.java trunk/model/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/model/src/app/net/sf/gridarta/model/anim/DuplicateAnimationException.java trunk/model/src/app/net/sf/gridarta/model/anim/IllegalAnimationException.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/model/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeFactory.java trunk/model/src/app/net/sf/gridarta/model/archetype/ArchetypeSetListener.java trunk/model/src/app/net/sf/gridarta/model/archetype/AttributeListUtils.java trunk/model/src/app/net/sf/gridarta/model/archetype/DuplicateArchetypeException.java trunk/model/src/app/net/sf/gridarta/model/archetype/UndefinedArchetypeException.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModel.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserModelListener.java trunk/model/src/app/net/sf/gridarta/model/archetypechooser/ArchetypeChooserPanel.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/ArchetypeValidator.java trunk/model/src/app/net/sf/gridarta/model/archetypeset/DefaultArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/AbstractArchetypeAttributeInvSpell.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/AbstractArchetypeAttributeList.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/AbstractArchetypeAttributeSpell.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeAnimationName.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBitmask.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBool.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeBoolSpec.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFaceName.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFixed.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFloat.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeInt.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeInvSpell.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeList.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeLong.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeMapPath.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeScriptFile.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeSpell.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeString.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeText.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeTreasure.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeZSpell.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributes.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributesDefinition.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/IgnorelistsDefinition.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/MissingAttributeException.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/SectionNames.java trunk/model/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinLists.java trunk/model/src/app/net/sf/gridarta/model/autojoin/AutojoinListsParser.java trunk/model/src/app/net/sf/gridarta/model/autojoin/IllegalAutojoinListException.java trunk/model/src/app/net/sf/gridarta/model/autojoin/InsertionResult.java trunk/model/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/model/src/app/net/sf/gridarta/model/baseobject/BaseObjectVisitor.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/model/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java trunk/model/src/app/net/sf/gridarta/model/baseobject/RecursiveGameObjectIterator.java trunk/model/src/app/net/sf/gridarta/model/collectable/Collectable.java trunk/model/src/app/net/sf/gridarta/model/configsource/AbstractConfigSource.java trunk/model/src/app/net/sf/gridarta/model/configsource/ConfigSource.java trunk/model/src/app/net/sf/gridarta/model/configsource/ConfigSourceFactory.java trunk/model/src/app/net/sf/gridarta/model/configsource/DefaultConfigSourceFactory.java trunk/model/src/app/net/sf/gridarta/model/connectionview/Connections.java trunk/model/src/app/net/sf/gridarta/model/data/AbstractNamedObject.java trunk/model/src/app/net/sf/gridarta/model/data/AbstractNamedObjects.java trunk/model/src/app/net/sf/gridarta/model/data/IllegalNamedObjectException.java trunk/model/src/app/net/sf/gridarta/model/data/NamedObject.java trunk/model/src/app/net/sf/gridarta/model/data/NamedObjects.java trunk/model/src/app/net/sf/gridarta/model/data/NamedTreeNode.java trunk/model/src/app/net/sf/gridarta/model/direction/Direction.java trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorView.java trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorViewCategory.java trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorViewCollector.java trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorViewCollectorErrorHandler.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/AbstractExitConnectorModel.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/DefaultExitConnectorModel.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitConnectorModel.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitConnectorModelListener.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java trunk/model/src/app/net/sf/gridarta/model/exitconnector/ExitMatcher.java trunk/model/src/app/net/sf/gridarta/model/face/AbstractFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/AbstractFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/ArchFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/CollectedFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/ColourFilter.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObject.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/DoubleImageFilter.java trunk/model/src/app/net/sf/gridarta/model/face/DuplicateFaceException.java trunk/model/src/app/net/sf/gridarta/model/face/EmptyFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObject.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProviders.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjectProvidersListener.java trunk/model/src/app/net/sf/gridarta/model/face/FaceObjects.java trunk/model/src/app/net/sf/gridarta/model/face/FaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/FilterFaceProvider.java trunk/model/src/app/net/sf/gridarta/model/face/IllegalFaceException.java trunk/model/src/app/net/sf/gridarta/model/filter/AbstractFilterConfig.java trunk/model/src/app/net/sf/gridarta/model/filter/Filter.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterConfig.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterConfigChangeType.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterConfigListener.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterConfigVisitor.java trunk/model/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilter.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterChangeType.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterConfig.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedFilterListener.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilter.java trunk/model/src/app/net/sf/gridarta/model/filter/NamedGameObjectMatcherFilterConfig.java trunk/model/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/FaceSource.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java trunk/model/src/app/net/sf/gridarta/model/gameobject/IsoMapSquareInfo.java trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/model/src/app/net/sf/gridarta/model/gameobject/NotInsideContainerException.java trunk/model/src/app/net/sf/gridarta/model/index/AbstractIndex.java trunk/model/src/app/net/sf/gridarta/model/index/Index.java trunk/model/src/app/net/sf/gridarta/model/index/IndexListener.java trunk/model/src/app/net/sf/gridarta/model/index/MapsIndex.java trunk/model/src/app/net/sf/gridarta/model/index/MapsIndexer.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/AnimationObjectsReader.java trunk/model/src/app/net/sf/gridarta/model/io/ArchetypeParser.java trunk/model/src/app/net/sf/gridarta/model/io/CacheFiles.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReaderFactory.java trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapWriter.java trunk/model/src/app/net/sf/gridarta/model/io/DirectoryCacheFiles.java trunk/model/src/app/net/sf/gridarta/model/io/FlatFileIterator.java trunk/model/src/app/net/sf/gridarta/model/io/GameObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/GameObjectParserFactory.java trunk/model/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java trunk/model/src/app/net/sf/gridarta/model/io/MapArchObjectParser.java trunk/model/src/app/net/sf/gridarta/model/io/MapArchObjectParserFactory.java trunk/model/src/app/net/sf/gridarta/model/io/MapReader.java trunk/model/src/app/net/sf/gridarta/model/io/MapReaderFactory.java trunk/model/src/app/net/sf/gridarta/model/io/MapWriter.java trunk/model/src/app/net/sf/gridarta/model/io/PathManager.java trunk/model/src/app/net/sf/gridarta/model/io/RecursiveFileIterator.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/AbstractMapArchObject.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/MapArchObject.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/MapArchObjectFactory.java trunk/model/src/app/net/sf/gridarta/model/maparchobject/MapArchObjectListener.java trunk/model/src/app/net/sf/gridarta/model/mapcontrol/DefaultMapControl.java trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControl.java trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControlFactory.java trunk/model/src/app/net/sf/gridarta/model/mapcontrol/MapControlListener.java trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursor.java trunk/model/src/app/net/sf/gridarta/model/mapcursor/MapCursorListener.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGrid.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGridEvent.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/MapGridListener.java trunk/model/src/app/net/sf/gridarta/model/mapgrid/SelectionMode.java trunk/model/src/app/net/sf/gridarta/model/maplocation/MapLocation.java trunk/model/src/app/net/sf/gridarta/model/maplocation/NoExitPathException.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/model/src/app/net/sf/gridarta/model/mapmodel/AboveFloorInsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/AutoInsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/BelowFloorInsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/BottommostInsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/InsertionModeSet.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModel.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModelFactory.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapModelListener.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquare.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareGrid.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapSquareIterator.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/MapTransactionListener.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/SavedSquares.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopLevelGameObjectIterator.java trunk/model/src/app/net/sf/gridarta/model/mapmodel/TopmostInsertionMode.java trunk/model/src/app/net/sf/gridarta/model/mappathnormalizer/IOErrorException.java trunk/model/src/app/net/sf/gridarta/model/mappathnormalizer/InvalidPathException.java trunk/model/src/app/net/sf/gridarta/model/mappathnormalizer/MapPathNormalizer.java trunk/model/src/app/net/sf/gridarta/model/mappathnormalizer/RelativePathOnUnsavedMapException.java trunk/model/src/app/net/sf/gridarta/model/mappathnormalizer/SameMapException.java trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/AbstractMapViewSettings.java trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/DefaultMapViewSettings.java trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettings.java trunk/model/src/app/net/sf/gridarta/model/mapviewsettings/MapViewSettingsListener.java trunk/model/src/app/net/sf/gridarta/model/match/AndGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatchers.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatchersParser.java trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/MutableOrGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/NamedGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/Operation.java trunk/model/src/app/net/sf/gridarta/model/match/OrGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java trunk/model/src/app/net/sf/gridarta/model/match/SetEnabledAction.java trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/TypeNrsGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/AbstractPickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/DefaultPickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettings.java trunk/model/src/app/net/sf/gridarta/model/pickmapsettings/PickmapSettingsListener.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractCollectedResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResources.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/CollectedResourcesWriter.java trunk/model/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java trunk/model/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java trunk/model/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchData.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptUtils.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptedEvent.java trunk/model/src/app/net/sf/gridarta/model/scripts/ScriptedEventFactory.java trunk/model/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeException.java trunk/model/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeNameException.java trunk/model/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeTypeException.java trunk/model/src/app/net/sf/gridarta/model/select/ArchetypeNameMatchCriteria.java trunk/model/src/app/net/sf/gridarta/model/select/MatchCriteria.java 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/GlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettingsListener.java trunk/model/src/app/net/sf/gridarta/model/smoothface/DuplicateSmoothFaceException.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFace.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFaces.java trunk/model/src/app/net/sf/gridarta/model/smoothface/SmoothFacesLoader.java trunk/model/src/app/net/sf/gridarta/model/spells/ArchetypeSetSpellLoader.java trunk/model/src/app/net/sf/gridarta/model/spells/GameObjectSpell.java trunk/model/src/app/net/sf/gridarta/model/spells/NumberSpell.java trunk/model/src/app/net/sf/gridarta/model/spells/Spell.java trunk/model/src/app/net/sf/gridarta/model/spells/Spells.java trunk/model/src/app/net/sf/gridarta/model/spells/XMLSpellLoader.java trunk/model/src/app/net/sf/gridarta/model/tiles/MapLink.java trunk/model/src/app/net/sf/gridarta/model/tiles/TileLink.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/ArchTreasureObj.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/FolderTreasureObj.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/NoTreasureObj.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureListTreasureObj.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureListTreasureObjType.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureListsParser.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureObjVisitor.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureTree.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java trunk/model/src/app/net/sf/gridarta/model/treasurelist/YesTreasureObj.java trunk/model/src/app/net/sf/gridarta/model/undo/UndoModel.java trunk/model/src/app/net/sf/gridarta/model/undo/UndoState.java trunk/model/src/app/net/sf/gridarta/model/undo/UndoType.java trunk/model/src/app/net/sf/gridarta/model/validation/AbstractValidator.java trunk/model/src/app/net/sf/gridarta/model/validation/DefaultErrorCollector.java trunk/model/src/app/net/sf/gridarta/model/validation/DefaultValidatorPreferences.java trunk/model/src/app/net/sf/gridarta/model/validation/DelegatingMapValidator.java trunk/model/src/app/net/sf/gridarta/model/validation/ErrorCollector.java trunk/model/src/app/net/sf/gridarta/model/validation/GameObjectValidator.java trunk/model/src/app/net/sf/gridarta/model/validation/MapValidator.java trunk/model/src/app/net/sf/gridarta/model/validation/NoSuchValidatorException.java trunk/model/src/app/net/sf/gridarta/model/validation/SquareValidator.java trunk/model/src/app/net/sf/gridarta/model/validation/ValidationErrorComparator.java trunk/model/src/app/net/sf/gridarta/model/validation/Validator.java trunk/model/src/app/net/sf/gridarta/model/validation/ValidatorPreferences.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/AbstractShopSquareChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ArchetypeTypeChecks.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/AttributeRangeChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedMatrix.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSpawnPointChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/BlockedSquareChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ConnectedInsideContainerChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ConnectedPickableChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ConnectionChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/CustomTypeChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/DoubleLayerChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/DoubleTypeChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/EmptySpawnPointChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/Entry.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ExitChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/InvalidCheckException.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptFailureError.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapCheckerScriptMissingError.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/MobOutsideSpawnPointChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/NonAbsoluteExitPathError.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/PaidItemShopSquareChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/Range.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/RangeEntry.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/SlayingChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/SquareWithoutFloorChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/SysObjectNotOnLayerZeroChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/TilePathsChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/Type.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/UndefinedArchetypeChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/UndefinedFaceChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/UnsetSlayingChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/AttributeRangeError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/BlockedMobOrSpawnPointError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/BlockedSpawnPointError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/BlockedSquareError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectedInsideContainerError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectedPickableError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectionError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectionUnknownError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectionWithoutSinksError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ConnectionWithoutSourcesError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/CorrectableError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/CustomTypeError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/DoubleLayerError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/DoubleTypeError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EmptySpawnPointError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentSensorSlayingError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ExitError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/GameObjectValidationError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/GameObjectsValidationError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapDifficultyError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/MapValidationError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/MobOutsideSpawnPointError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/PaidItemShopSquareError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SlayingError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareValidationError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SquareWithoutFloorError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/SysObjectNotOnLayerZeroError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/TilePathsError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/UndefinedAnimError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/UndefinedArchetypeError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/UndefinedFaceError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/UnsetSlayingError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/ValidationError.java trunk/model/src/test/net/sf/gridarta/model/anim/TestAnimationObjects.java trunk/model/src/test/net/sf/gridarta/model/archetype/AttributeListUtilsTest.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeBuilder.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeFactory.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestDefaultArchetype.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/TestArchetypeAttribute.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/TestArchetypeAttributeFactory.java trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/autojoin/AutojoinListsHelper.java trunk/model/src/test/net/sf/gridarta/model/autojoin/AutojoinListsTest.java trunk/model/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/model/src/test/net/sf/gridarta/model/errorview/TestErrorView.java trunk/model/src/test/net/sf/gridarta/model/exitconnector/TestExitConnectorModel.java trunk/model/src/test/net/sf/gridarta/model/face/TestFaceObjects.java 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/gameobject/TestGameObject.java trunk/model/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexTest.java trunk/model/src/test/net/sf/gridarta/model/index/MapsIndexerTest.java trunk/model/src/test/net/sf/gridarta/model/io/AbstractArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/io/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/io/PathManagerTest.java trunk/model/src/test/net/sf/gridarta/model/io/TestArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestCacheFiles.java trunk/model/src/test/net/sf/gridarta/model/io/TestGameObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParser.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapArchObjectParserFactory.java trunk/model/src/test/net/sf/gridarta/model/io/TestMapReaderFactory.java trunk/model/src/test/net/sf/gridarta/model/maparchobject/TestMapArchObject.java trunk/model/src/test/net/sf/gridarta/model/maparchobject/TestMapArchObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlFactory.java trunk/model/src/test/net/sf/gridarta/model/mapcursor/MapCursorTest.java trunk/model/src/test/net/sf/gridarta/model/mapgrid/MapGridTest.java trunk/model/src/test/net/sf/gridarta/model/mapmanager/DefaultMapManagerTest.java trunk/model/src/test/net/sf/gridarta/model/mapmanager/TestFileControl.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/CannotInsertGameObjectException.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java trunk/model/src/test/net/sf/gridarta/model/mapviewsettings/TestMapViewSettings.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java trunk/model/src/test/net/sf/gridarta/model/settings/TestGlobalSettings.java trunk/model/src/test/net/sf/gridarta/model/validation/AbstractValidatorTest.java trunk/model/src/test/net/sf/gridarta/model/validation/TestValidatorPreferences.java trunk/model/src/test/net/sf/gridarta/model/validation/ValidationUtils.java trunk/model/src/test/net/sf/gridarta/model/validation/checks/ValidatorFactoryTest.java trunk/plugin/src/app/net/sf/gridarta/plugin/BshThread.java trunk/plugin/src/app/net/sf/gridarta/plugin/Plugin.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginConsole.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecException.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginExecutor.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModel.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelListener.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelLoader.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelParser.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginParameters.java trunk/plugin/src/app/net/sf/gridarta/plugin/PluginRunMode.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/AbstractPluginParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanConfig.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleConfig.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/FilterParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerConfig.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/MapParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/NoSuchParameterException.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterListener.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/StringParameter.java trunk/preferences/src/app/net/sf/gridarta/preferences/Codec.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferences.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesFactory.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesNode.java trunk/preferences/src/app/net/sf/gridarta/preferences/FilePreferencesRoot.java trunk/preferences/src/app/net/sf/gridarta/preferences/NodeType.java trunk/preferences/src/app/net/sf/gridarta/preferences/Storage.java trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java trunk/src/app/net/sf/gridarta/actions/CannotSaveMapFileException.java trunk/src/app/net/sf/gridarta/actions/ExitConnectorActions.java trunk/src/app/net/sf/gridarta/actions/InvalidPathNameException.java trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java trunk/src/app/net/sf/gridarta/actions/UndoActions.java trunk/src/app/net/sf/gridarta/commands/BatchPngCommand.java trunk/src/app/net/sf/gridarta/commands/CollectArchesCommand.java trunk/src/app/net/sf/gridarta/commands/Collector.java trunk/src/app/net/sf/gridarta/commands/Command.java trunk/src/app/net/sf/gridarta/commands/SinglePngCommand.java trunk/src/app/net/sf/gridarta/gui/autovalidator/AutoValidator.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/data/NamedObjectsUtils.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListener.java trunk/src/app/net/sf/gridarta/gui/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ConsoleErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/DefaultErrorView.java trunk/src/app/net/sf/gridarta/gui/dialog/errorview/ErrorEntry.java trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/find/FindDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/FindArchetypesDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ConfirmErrorsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttribute.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBitmask.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBool.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeBoolSpec.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeFloat.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInt.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeInvSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeList.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeLong.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeMapPath.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeScriptFile.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeText.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeTreasure.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/DialogAttributeZSpell.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GameObjectAttributesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/GuiInfo.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/HelpActionListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ScrollToVisibleFocusListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/StringKeyManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/TypesBoxItemListener.java trunk/src/app/net/sf/gridarta/gui/dialog/gameobjectattributes/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/goexit/GoExitDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/golocation/GoLocationDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/golocation/GoLocationDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/GoMapDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/gomap/MapListCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/help/Help.java trunk/src/app/net/sf/gridarta/gui/dialog/help/HtmlPane.java trunk/src/app/net/sf/gridarta/gui/dialog/mapproperties/MapPropertiesDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractMapsizeNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/AbstractNewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewMapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewMapDialogFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewPickmapDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/newmap/NewPickmapFolderDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/CloseableTabbedPane.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/ClosingIcon.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/ClosingListener.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginController.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManager.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginManagerFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/PluginViewPane.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/StackLayout.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBox.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ArchParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/BooleanParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/DoubleParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/FilterParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/IntegerParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterCellRenderer.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterComboBoxModel.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/MapParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterDescriptionEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterNameEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/ParameterTypeEditor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/StringParameterView.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/TooltipSpinner.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferencesModel.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/DevPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/GUIPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/MapValidatorPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/MiscPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/NetPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/UpdatePreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/replace/ReplaceDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeField.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/KeyStrokeFieldListener.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shortcuts/ShortcutsManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeDialogManager.java trunk/src/app/net/sf/gridarta/gui/dialog/shrinkmapsize/ShrinkMapSizeUtils.java trunk/src/app/net/sf/gridarta/gui/exitconnector/ExitConnectorController.java trunk/src/app/net/sf/gridarta/gui/filter/BtnPopup.java trunk/src/app/net/sf/gridarta/gui/filter/DefaultFilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterComponent.java trunk/src/app/net/sf/gridarta/gui/filter/FilterControl.java trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java trunk/src/app/net/sf/gridarta/gui/filter/FilterState.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/GameObjectTextEditorTab.java trunk/src/app/net/sf/gridarta/gui/mainwindow/WarningsTab.java trunk/src/app/net/sf/gridarta/gui/map/MapFileActions.java trunk/src/app/net/sf/gridarta/gui/map/MapPreviewAccessory.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpAdapter.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpListener.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/EnterMap.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/maptilepane/MapTilePanel.java trunk/src/app/net/sf/gridarta/gui/map/maptilepane/TilePanel.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/DefaultMapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewFactory.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManager.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewManagerListener.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViews.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsListener.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractSimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/GridMapSquarePainter.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/MapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/RendererFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewActions.java trunk/src/app/net/sf/gridarta/gui/mapcursor/MapCursorActions.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/mapdesktop/WindowMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapfiles/Loader.java trunk/src/app/net/sf/gridarta/gui/mapfiles/Map... [truncated message content] |
From: <aki...@us...> - 2012-01-08 13:42:44
|
Revision: 9155 http://gridarta.svn.sourceforge.net/gridarta/?rev=9155&view=rev Author: akirschbaum Date: 2012-01-08 13:42:37 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Fix file chooser buttons in setup dialog. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/utils/JFileChooserButton.java trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/atrinik/ChangeLog 2012-01-08 13:42:37 UTC (rev 9155) @@ -1,3 +1,7 @@ +2012-01-08 Andreas Kirschbaum + + * Fix file chooser buttons in setup dialog. + 2011-11-17 Andreas Kirschbaum * Ignore "enable updates" setting for builds without valid update Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/crossfire/ChangeLog 2012-01-08 13:42:37 UTC (rev 9155) @@ -1,3 +1,7 @@ +2012-01-08 Andreas Kirschbaum + + * Fix file chooser buttons in setup dialog. + 2011-11-17 Andreas Kirschbaum * Ignore "enable updates" setting for builds without valid update Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/daimonin/ChangeLog 2012-01-08 13:42:37 UTC (rev 9155) @@ -1,3 +1,7 @@ +2012-01-08 Andreas Kirschbaum + + * Fix file chooser buttons in setup dialog. + 2011-11-17 Andreas Kirschbaum * Ignore "enable updates" setting for builds without valid update Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/src/app/net/sf/gridarta/action.properties 2012-01-08 13:42:37 UTC (rev 9155) @@ -173,3 +173,5 @@ # Main Window tabButtonMenu.menu=tabButtonMoveTo tabButtonMoveTo.menu= + +fileChooserButton.icon=general/Open16 Modified: trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/src/app/net/sf/gridarta/gui/dialog/prefs/AppPreferences.java 2012-01-08 13:42:37 UTC (rev 9155) @@ -21,6 +21,7 @@ import java.awt.Component; import java.awt.GridBagLayout; +import java.io.File; import javax.swing.Box; import javax.swing.JComponent; import javax.swing.JFileChooser; @@ -29,10 +30,10 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.JFileField; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.swing.misc.JFileField; import net.sf.japi.swing.prefs.AbstractPrefs; import org.jetbrains.annotations.NotNull; @@ -101,9 +102,9 @@ */ @Override public void apply() { - AppPreferencesModel.setServer(serverField.getText()); - AppPreferencesModel.setClient(clientField.getText()); - AppPreferencesModel.setEditor(editorField.getText()); + AppPreferencesModel.setServer(serverField.getFile().getPath()); + AppPreferencesModel.setClient(clientField.getFile().getPath()); + AppPreferencesModel.setEditor(editorField.getFile().getPath()); } /** @@ -111,9 +112,9 @@ */ @Override public void revert() { - serverField.setText(appPreferencesModel.getServer()); - clientField.setText(appPreferencesModel.getClient()); - editorField.setText(appPreferencesModel.getEditor()); + serverField.setFile(new File(appPreferencesModel.getServer())); + clientField.setFile(new File(appPreferencesModel.getClient())); + editorField.setFile(new File(appPreferencesModel.getEditor())); } /** @@ -121,9 +122,9 @@ */ @Override public void defaults() { - serverField.setText(appPreferencesModel.getServerDefault()); - clientField.setText(appPreferencesModel.getClientDefault()); - editorField.setText(appPreferencesModel.getEditorDefault()); + serverField.setFile(new File(appPreferencesModel.getServerDefault())); + clientField.setFile(new File(appPreferencesModel.getClientDefault())); + editorField.setFile(new File(appPreferencesModel.getEditorDefault())); } /** @@ -131,7 +132,7 @@ */ @Override public boolean isChanged() { - return !(serverField.getText().equals(appPreferencesModel.getServer()) && clientField.getText().equals(appPreferencesModel.getClient()) && editorField.getText().equals(appPreferencesModel.getEditor())); + return !(serverField.getFile().equals(new File(appPreferencesModel.getServer())) && clientField.getFile().equals(new File(appPreferencesModel.getClient())) && editorField.getFile().equals(new File(appPreferencesModel.getEditor()))); } /** @@ -143,9 +144,15 @@ final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsApps")); - serverField = preferencesHelper.createFileField("optionsAppServer", appPreferencesModel.getServer(), JFileChooser.FILES_ONLY); - clientField = preferencesHelper.createFileField("optionsAppClient", appPreferencesModel.getClient(), JFileChooser.FILES_ONLY); - editorField = preferencesHelper.createFileField("optionsAppEditor", appPreferencesModel.getEditor(), JFileChooser.FILES_ONLY); + serverField = new JFileField(this, "optionsAppServer", new File(appPreferencesModel.getServer()), JFileChooser.FILES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsAppServer")); + preferencesHelper.addComponent(serverField); + clientField = new JFileField(this, "optionsAppClient", new File(appPreferencesModel.getClient()), JFileChooser.FILES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsAppClient")); + preferencesHelper.addComponent(clientField); + editorField = new JFileField(this, "optionsAppEditor", new File(appPreferencesModel.getEditor()), JFileChooser.FILES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsAppEditor")); + preferencesHelper.addComponent(editorField); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/src/app/net/sf/gridarta/gui/dialog/prefs/PreferencesHelper.java 2012-01-08 13:42:37 UTC (rev 9155) @@ -22,11 +22,6 @@ import java.awt.Component; import java.awt.Container; import java.awt.GridBagConstraints; -import javax.swing.JLabel; -import net.sf.gridarta.utils.ActionBuilderUtils; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.swing.misc.JFileField; import org.jetbrains.annotations.NotNull; /** @@ -36,11 +31,6 @@ public class PreferencesHelper { /** - * The {@link ActionBuilder}. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** * The {@link Container} to add to. */ @NotNull @@ -65,28 +55,6 @@ } /** - * Creates a {@link JFileField} for choosing a file and adds it to the - * container. - * @param key the preferences key - * @param initial the initial file to show - * @param fileSelectionMode the file selection mode - * @return the created file field - */ - @NotNull - public JFileField createFileField(@NotNull final String key, @NotNull final String initial, final int fileSelectionMode) { - addComponent(new JLabel(ActionBuilderUtils.getString(ACTION_BUILDER, key) + ":")); // XXX: use ActionBuilderUtils.newLabel() - - final JFileField fileField = new JFileField(initial, fileSelectionMode); - final String tooltip = ACTION_BUILDER.getString(key + ".shortdescription"); - if (tooltip != null) { - fileField.setToolTipText(tooltip); - } - addComponent(fileField); - - return fileField; - } - - /** * Adds a component to the container. * @param component the component to add */ Modified: trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java 2012-01-04 22:12:19 UTC (rev 9154) +++ trunk/src/app/net/sf/gridarta/gui/dialog/prefs/ResPreferences.java 2012-01-08 13:42:37 UTC (rev 9155) @@ -35,15 +35,14 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.JFileField; import net.sf.gridarta.model.configsource.ConfigSource; import net.sf.gridarta.model.configsource.ConfigSourceFactory; -import net.sf.gridarta.model.io.PathManager; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.utils.ActionBuilderUtils; import net.sf.gridarta.utils.StringUtils; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.swing.misc.JFileField; import net.sf.japi.swing.prefs.AbstractPrefs; import net.sf.japi.util.Arrays2; import org.jetbrains.annotations.NotNull; @@ -163,11 +162,11 @@ */ @Override public void apply() { - globalSettings.setArchDirectory(new File(PathManager.getAbsolutePath(archField.getText()))); - globalSettings.setMapsDirectory(new File(PathManager.getAbsolutePath(mapField.getText()))); + globalSettings.setArchDirectory(archField.getFile()); + globalSettings.setMapsDirectory(mapField.getFile()); if (globalSettings.hasMediaDirectory()) { assert mediaField != null; - globalSettings.setMediaDirectory(new File(PathManager.getAbsolutePath(mediaField.getText()))); + globalSettings.setMediaDirectory(mediaField.getFile()); } globalSettings.setConfigSourceName(((ConfigSource) configSourceComboBox.getSelectedItem()).getName()); @@ -185,12 +184,12 @@ */ @Override public void revert() { - archField.setText(globalSettings.getArchDirectory().getPath()); - mapField.setText(globalSettings.getMapsDirectory().getPath()); + archField.setFile(globalSettings.getArchDirectory()); + mapField.setFile(globalSettings.getMapsDirectory()); if (globalSettings.hasMediaDirectory()) { - final String text = globalSettings.getMediaDirectory().getPath(); + final File mediaDirectory = globalSettings.getMediaDirectory(); assert mediaField != null; - mediaField.setText(text); + mediaField.setFile(mediaDirectory); } configSourceComboBox.setSelectedItem(configSourceFactory.getConfigSource(globalSettings.getConfigSourceName())); if (globalSettings.hasImageSet()) { @@ -207,12 +206,12 @@ */ @Override public void defaults() { - archField.setText(globalSettings.getArchDirectoryDefault().getPath()); - mapField.setText(globalSettings.getMapsDirectoryDefault().getPath()); + archField.setFile(globalSettings.getArchDirectoryDefault()); + mapField.setFile(globalSettings.getMapsDirectoryDefault()); if (globalSettings.hasMediaDirectory()) { - final String text = globalSettings.getMediaDirectoryDefault().getPath(); + final File mediaDirectory = globalSettings.getMediaDirectoryDefault(); assert mediaField != null; - mediaField.setText(text); + mediaField.setFile(mediaDirectory); } configSourceComboBox.setSelectedItem(configSourceFactory.getDefaultConfigSource()); if (globalSettings.hasImageSet()) { @@ -235,13 +234,13 @@ } else { imageSet = convertImageSet(null); } - if (!PathManager.getAbsolutePath(archField.getText()).equals(globalSettings.getArchDirectory().getPath()) || !PathManager.getAbsolutePath(mapField.getText()).equals(globalSettings.getMapsDirectory().getPath())) { + if (!archField.getFile().equals(globalSettings.getArchDirectory()) || !mapField.getFile().equals(globalSettings.getMapsDirectory())) { return true; } if (globalSettings.hasMediaDirectory()) { assert mediaField != null; - if (!PathManager.getAbsolutePath(mediaField.getText()).equals(globalSettings.getMediaDirectory().getPath())) { + if (!mediaField.getFile().equals(globalSettings.getMediaDirectory())) { return true; } } @@ -257,10 +256,17 @@ final JComponent panel = new JPanel(new GridBagLayout()); final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsResPaths")); - archField = preferencesHelper.createFileField("optionsResArch", globalSettings.getArchDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); - mapField = preferencesHelper.createFileField("optionsResMaps", globalSettings.getMapsDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); + archField = new JFileField(this, "optionsResArch", globalSettings.getArchDirectory(), JFileChooser.DIRECTORIES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsResArch")); + preferencesHelper.addComponent(archField); + mapField = new JFileField(this, "optionsResMaps", globalSettings.getMapsDirectory(), JFileChooser.DIRECTORIES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsResMaps")); + preferencesHelper.addComponent(mapField); if (globalSettings.hasMediaDirectory()) { - mediaField = preferencesHelper.createFileField("optionsResMedia", globalSettings.getMediaDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); + mediaField = new JFileField(this, "optionsResMedia", globalSettings.getMediaDirectory(), JFileChooser.DIRECTORIES_ONLY); + preferencesHelper.addComponent(ActionBuilderUtils.newLabel(ACTION_BUILDER, "optionsResMedia")); + assert mediaField != null; + preferencesHelper.addComponent(mediaField); } return panel; } Added: trunk/src/app/net/sf/gridarta/gui/utils/JFileChooserButton.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/JFileChooserButton.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/utils/JFileChooserButton.java 2012-01-08 13:42:37 UTC (rev 9155) @@ -0,0 +1,105 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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 java.io.File; +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JFileChooser; +import javax.swing.JTextField; +import net.sf.gridarta.utils.FileChooserUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * A button for selecting a file. + * @author Andreas Kirschbaum + */ +public class JFileChooserButton extends JButton { + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link JFileChooser} for selecting the file. + */ + @NotNull + private final JFileChooser fileChooser = new JFileChooser(); + + /** + * The parent component. + */ + @NotNull + private final JComponent parent; + + /** + * The currently selected file. + */ + @NotNull + private final JTextField textField; + + /** + * Creates a new instance. + * @param parent the parent component + * @param textField the text field to modify + * @param fileSelectionMode the file selection mode for the file chooser + */ + public JFileChooserButton(@NotNull final JComponent parent, @NotNull final JTextField textField, final int fileSelectionMode) { + this.parent = parent; + this.textField = textField; + setAction(ACTION_BUILDER.createAction(false, "fileChooserButton", this)); + fileChooser.setFileSelectionMode(fileSelectionMode); + setMargin(new Insets(0, 0, 0, 0)); + } + + /** + * The action method for the button. It shows the file chooser. + */ + @ActionMethod + public void fileChooserButton() { + final File file = getFile(); + fileChooser.setSelectedFile(file); + if (file.isDirectory()) { + FileChooserUtils.setCurrentDirectory(fileChooser, file); + } else { + FileChooserUtils.setCurrentDirectory(fileChooser, file.getParentFile()); + } + if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) { + textField.setText(fileChooser.getSelectedFile().getPath()); + } + } + + /** + * Returns the currently selected file. + * @return the currently selected file + */ + @NotNull + public File getFile() { + final String text = textField.getText(); + return text.isEmpty() ? new File(System.getProperty("user.dir")) : new File(text); + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/utils/JFileChooserButton.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/utils/JFileField.java 2012-01-08 13:42:37 UTC (rev 9155) @@ -0,0 +1,87 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2011 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.BorderLayout; +import java.io.File; +import javax.swing.JComponent; +import javax.swing.JTextField; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; + +/** + * A component for selecting files. It consists of a text field and a button + * which pops up a file chooser. + * @author Andreas Kirschbaum + */ +public class JFileField extends JComponent { + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The text file that contains the currently selected file. + */ + @NotNull + private final JTextField textField; + + /** + * Creates a new instance. + * @param parent the parent component + * @param key the resource key for creating components + * @param file the currently selected file + * @param fileSelectionMode the file selection mode for the file chooser + */ + public JFileField(@NotNull final JComponent parent, @NotNull final String key, @NotNull final File file, final int fileSelectionMode) { + textField = new JTextField(file.getPath(), 20); + + final String tooltip = ACTION_BUILDER.getString(key + ".shortdescription"); + if (tooltip != null) { + textField.setToolTipText(tooltip); + } + + setLayout(new BorderLayout()); + add(textField, BorderLayout.CENTER); + add(new JFileChooserButton(parent, textField, fileSelectionMode), BorderLayout.EAST); + } + + /** + * Returns the currently selected file. + * @return the currently selected file + */ + @NotNull + public File getFile() { + final String text = textField.getText(); + return text.isEmpty() ? new File(System.getProperty("user.dir")) : new File(text); + } + + /** + * Sets the currently selected file. + * @param file the currently selected file + */ + public void setFile(@NotNull final File file) { + textField.setText(file.getAbsolutePath()); + } + +} Property changes on: trunk/src/app/net/sf/gridarta/gui/utils/JFileField.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...> - 2012-01-08 16:10:36
|
Revision: 9162 http://gridarta.svn.sourceforge.net/gridarta/?rev=9162&view=rev Author: akirschbaum Date: 2012-01-08 16:10:30 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java 2012-01-08 15:56:59 UTC (rev 9161) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java 2012-01-08 16:10:30 UTC (rev 9162) @@ -22,6 +22,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; /** * Interface for visitors of {@link PluginParameter} instances. @@ -29,18 +30,18 @@ */ public interface PluginParameterVisitor<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { - void visit(ArchParameter<G, A, R> parameter); + void visit(@NotNull ArchParameter<G, A, R> parameter); - void visit(BooleanParameter<G, A, R> parameter); + void visit(@NotNull BooleanParameter<G, A, R> parameter); - void visit(DoubleParameter<G, A, R> parameter); + void visit(@NotNull DoubleParameter<G, A, R> parameter); - void visit(FilterParameter<G, A, R> parameter); + void visit(@NotNull FilterParameter<G, A, R> parameter); - void visit(IntegerParameter<G, A, R> parameter); + void visit(@NotNull IntegerParameter<G, A, R> parameter); - void visit(MapParameter<G, A, R> parameter); + void visit(@NotNull MapParameter<G, A, R> parameter); - void visit(StringParameter<G, A, R> parameter); + void visit(@NotNull StringParameter<G, A, R> parameter); } Modified: trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java 2012-01-08 15:56:59 UTC (rev 9161) +++ trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java 2012-01-08 16:10:30 UTC (rev 9162) @@ -66,40 +66,41 @@ @Nullable private PluginParameterView<G, A, R> view = null; + @NotNull private final PluginParameterVisitor<G, A, R> visitor = new PluginParameterVisitor<G, A, R>() { @Override - public void visit(final ArchParameter<G, A, R> parameter) { + public void visit(@NotNull final ArchParameter<G, A, R> parameter) { view = new ArchParameterView<G, A, R>(parameter, gameObjectAttributesModel, archetypeSet, objectChooser, faceObjectProviders); } @Override - public void visit(final BooleanParameter<G, A, R> parameter) { + public void visit(@NotNull final BooleanParameter<G, A, R> parameter) { view = new BooleanParameterView<G, A, R>(parameter); } @Override - public void visit(final DoubleParameter<G, A, R> parameter) { + public void visit(@NotNull final DoubleParameter<G, A, R> parameter) { view = new DoubleParameterView<G, A, R>(parameter); } @Override - public void visit(final FilterParameter<G, A, R> parameter) { + public void visit(@NotNull final FilterParameter<G, A, R> parameter) { view = new FilterParameterView<G, A, R>(parameter); } @Override - public void visit(final IntegerParameter<G, A, R> parameter) { + public void visit(@NotNull final IntegerParameter<G, A, R> parameter) { view = new IntegerParameterView<G, A, R>(parameter); } @Override - public void visit(final MapParameter<G, A, R> parameter) { + public void visit(@NotNull final MapParameter<G, A, R> parameter) { view = new MapParameterView<G, A, R>(parameter, mapManager); } @Override - public void visit(final StringParameter<G, A, R> parameter) { + public void visit(@NotNull final StringParameter<G, A, R> parameter) { view = new StringParameterView<G, A, R>(parameter); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2012-01-08 16:21:16
|
Revision: 9164 http://gridarta.svn.sourceforge.net/gridarta/?rev=9164&view=rev Author: akirschbaum Date: 2012-01-08 16:21:09 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Simplify PluginParameterViewFactory. Modified Paths: -------------- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/FilterParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/MapParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameter.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/StringParameter.java trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/ArchParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -65,9 +65,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/BooleanParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -45,9 +45,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/DoubleParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -52,9 +52,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/FilterParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/FilterParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/FilterParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -69,9 +69,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } @NotNull Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/IntegerParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -49,9 +49,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/MapParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/MapParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/MapParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -82,9 +82,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -65,6 +65,7 @@ void removePluginParameterListener(@NotNull PluginParameterListener<G, A, R> listener); - void visit(@NotNull PluginParameterVisitor<G, A, R> visitor); + @NotNull + <T> T visit(@NotNull PluginParameterVisitor<G, A, R, T> visitor); } Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterVisitor.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -28,20 +28,27 @@ * Interface for visitors of {@link PluginParameter} instances. * @author Andreas Kirschbaum */ -public interface PluginParameterVisitor<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { +public interface PluginParameterVisitor<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, T> { - void visit(@NotNull ArchParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull ArchParameter<G, A, R> parameter); - void visit(@NotNull BooleanParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull BooleanParameter<G, A, R> parameter); - void visit(@NotNull DoubleParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull DoubleParameter<G, A, R> parameter); - void visit(@NotNull FilterParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull FilterParameter<G, A, R> parameter); - void visit(@NotNull IntegerParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull IntegerParameter<G, A, R> parameter); - void visit(@NotNull MapParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull MapParameter<G, A, R> parameter); - void visit(@NotNull StringParameter<G, A, R> parameter); + @NotNull + T visit(@NotNull StringParameter<G, A, R> parameter); } Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/StringParameter.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/StringParameter.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/StringParameter.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -78,9 +78,10 @@ /** * {@inheritDoc} */ + @NotNull @Override - public void visit(@NotNull final PluginParameterVisitor<G, A, R> visitor) { - visitor.visit(this); + public <T> T visit(@NotNull final PluginParameterVisitor<G, A, R, T> visitor) { + return visitor.visit(this); } /** Modified: trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java 2012-01-08 16:18:57 UTC (rev 9163) +++ trunk/src/app/net/sf/gridarta/gui/dialog/plugin/parameter/PluginParameterViewFactory.java 2012-01-08 16:21:09 UTC (rev 9164) @@ -37,7 +37,6 @@ import net.sf.gridarta.plugin.parameter.PluginParameterVisitor; import net.sf.gridarta.plugin.parameter.StringParameter; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Factory for creating {@link PluginParameterView} instances. @@ -63,45 +62,49 @@ @NotNull private final FaceObjectProviders faceObjectProviders; - @Nullable - private PluginParameterView<G, A, R> view = null; - @NotNull - private final PluginParameterVisitor<G, A, R> visitor = new PluginParameterVisitor<G, A, R>() { + private final PluginParameterVisitor<G, A, R, PluginParameterView<G, A, R>> visitor = new PluginParameterVisitor<G, A, R, PluginParameterView<G, A, R>>() { + @NotNull @Override - public void visit(@NotNull final ArchParameter<G, A, R> parameter) { - view = new ArchParameterView<G, A, R>(parameter, gameObjectAttributesModel, archetypeSet, objectChooser, faceObjectProviders); + public PluginParameterView<G, A, R> visit(@NotNull final ArchParameter<G, A, R> parameter) { + return new ArchParameterView<G, A, R>(parameter, gameObjectAttributesModel, archetypeSet, objectChooser, faceObjectProviders); } + @NotNull @Override - public void visit(@NotNull final BooleanParameter<G, A, R> parameter) { - view = new BooleanParameterView<G, A, R>(parameter); + public PluginParameterView<G, A, R> visit(@NotNull final BooleanParameter<G, A, R> parameter) { + return new BooleanParameterView<G, A, R>(parameter); } + @NotNull @Override - public void visit(@NotNull final DoubleParameter<G, A, R> parameter) { - view = new DoubleParameterView<G, A, R>(parameter); + public PluginParameterView<G, A, R> visit(@NotNull final DoubleParameter<G, A, R> parameter) { + return new DoubleParameterView<G, A, R>(parameter); } + @NotNull @Override - public void visit(@NotNull final FilterParameter<G, A, R> parameter) { - view = new FilterParameterView<G, A, R>(parameter); + public PluginParameterView<G, A, R> visit(@NotNull final FilterParameter<G, A, R> parameter) { + return new FilterParameterView<G, A, R>(parameter); } + @NotNull @Override - public void visit(@NotNull final IntegerParameter<G, A, R> parameter) { - view = new IntegerParameterView<G, A, R>(parameter); + public PluginParameterView<G, A, R> visit(@NotNull final IntegerParameter<G, A, R> parameter) { + return new IntegerParameterView<G, A, R>(parameter); } + @NotNull @Override - public void visit(@NotNull final MapParameter<G, A, R> parameter) { - view = new MapParameterView<G, A, R>(parameter, mapManager); + public PluginParameterView<G, A, R> visit(@NotNull final MapParameter<G, A, R> parameter) { + return new MapParameterView<G, A, R>(parameter, mapManager); } + @NotNull @Override - public void visit(@NotNull final StringParameter<G, A, R> parameter) { - view = new StringParameterView<G, A, R>(parameter); + public PluginParameterView<G, A, R> visit(@NotNull final StringParameter<G, A, R> parameter) { + return new StringParameterView<G, A, R>(parameter); } }; @@ -121,10 +124,7 @@ @NotNull public PluginParameterView<G, A, R> getView(@NotNull final PluginParameter<G, A, R> parameter) { - view = null; - parameter.visit(visitor); - assert view != null; - return view; + return parameter.visit(visitor); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2012-01-08 19:20:03
|
Revision: 9169 http://gridarta.svn.sourceforge.net/gridarta/?rev=9169&view=rev Author: akirschbaum Date: 2012-01-08 19:19:57 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Do not drop plugin script parameter with unknown type. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelParser.java trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2012-01-08 18:31:29 UTC (rev 9168) +++ trunk/atrinik/ChangeLog 2012-01-08 19:19:57 UTC (rev 9169) @@ -1,5 +1,8 @@ 2012-01-08 Andreas Kirschbaum + * Do not drop plugin script parameter with unknown type. Create + String parameters instead. + * Fix file chooser buttons in setup dialog. 2011-11-17 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2012-01-08 18:31:29 UTC (rev 9168) +++ trunk/crossfire/ChangeLog 2012-01-08 19:19:57 UTC (rev 9169) @@ -1,5 +1,8 @@ 2012-01-08 Andreas Kirschbaum + * Do not drop plugin script parameter with unknown type. Create + String parameters instead. + * Fix file chooser buttons in setup dialog. 2011-11-17 Andreas Kirschbaum Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2012-01-08 18:31:29 UTC (rev 9168) +++ trunk/daimonin/ChangeLog 2012-01-08 19:19:57 UTC (rev 9169) @@ -1,5 +1,8 @@ 2012-01-08 Andreas Kirschbaum + * Do not drop plugin script parameter with unknown type. Create + String parameters instead. + * Fix file chooser buttons in setup dialog. 2011-11-17 Andreas Kirschbaum Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelParser.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelParser.java 2012-01-08 18:31:29 UTC (rev 9168) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/PluginModelParser.java 2012-01-08 19:19:57 UTC (rev 9169) @@ -117,12 +117,12 @@ final Collection<Element> parameters = node.getChildren("parameter"); if (parameters != null && !parameters.isEmpty()) { for (final Element parameter : parameters) { - final PluginParameter<G, A, R> pluginParameter; + PluginParameter<G, A, R> pluginParameter; try { pluginParameter = pluginParameterFactory.createParameter(parameter); } catch (final NoSuchParameterException ex) { - log.warn("Cannot create parameter type " + ex.getMessage() + ", dropping parameter"); - continue; + log.warn("Parameter type " + ex.getMessage() + " in plugin " + pluginModel + " is unknown"); + pluginParameter = pluginParameterFactory.createStringParameter(parameter); } pluginModel.addParameter(pluginParameter); } Modified: trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java =================================================================== --- trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java 2012-01-08 18:31:29 UTC (rev 9168) +++ trunk/plugin/src/app/net/sf/gridarta/plugin/parameter/PluginParameterFactory.java 2012-01-08 19:19:57 UTC (rev 9169) @@ -61,7 +61,19 @@ return createParameter(parameterNode.getChildText("type"), parameterNode); } + /** + * Creates a new {@link StringParameter} from XML representation. + * @param parameterNode the XML representation + * @return the string parameter + */ @NotNull + public PluginParameter<G, A, R> createStringParameter(@NotNull final Element parameterNode) { + final PluginParameter<G, A, R> parameter = new StringParameter<G, A, R>(); + codec.fromXML(parameter, parameterNode); + return parameter; + } + + @NotNull public PluginParameter<G, A, R> createParameter(@NotNull final String type) throws NoSuchParameterException { if (type.equals(StringParameter.PARAMETER_TYPE)) { return new StringParameter<G, A, R>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |