From: <aki...@us...> - 2008-08-20 00:29:18
|
Revision: 4910 http://gridarta.svn.sourceforge.net/gridarta/?rev=4910&view=rev Author: akirschbaum Date: 2008-08-20 00:29:26 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Move more code into DefaultMapControlFactory. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java trunk/src/app/net/sf/gridarta/CopyBuffer.java trunk/src/app/net/sf/gridarta/DefaultMapManager.java trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java trunk/src/app/net/sf/gridarta/map/MapControlFactory.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -147,8 +147,8 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists) { - return mapControlFactory.newMapControl(this, parent, objects, mapArchObject); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final String mapName, @Nullable final File file) { + return mapControlFactory.newMapControl(this, parent, objects, mapArchObject, mapName, file); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/crossfire/src/cfeditor/map/DefaultMapControlFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -92,8 +92,11 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final Component parent, @Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(gridartaObjectsFactory, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final Component parent, @Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final String mapName, @Nullable final File file) { + final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(gridartaObjectsFactory, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); + mapControl.setMapFile(file); + mapControl.setMapFileName(mapName); + return mapControl; } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java =================================================================== --- trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -151,8 +151,8 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists) { - return mapControlFactory.newMapControl(this, parent, objects, mapArchObject); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final String mapName, @Nullable final File file) { + return mapControlFactory.newMapControl(this, parent, objects, mapArchObject, mapName, file); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/daimonin/src/daieditor/map/DefaultMapControlFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -92,8 +92,11 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final Component parent, @Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(gridartaObjectsFactory, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final Component parent, @Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final String mapName, @Nullable final File file) { + final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl = DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(gridartaObjectsFactory, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); + mapControl.setMapFile(file); + mapControl.setMapFileName(mapName); + return mapControl; } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -103,8 +103,7 @@ public void init(final A mapArch) { assert copyMapCtrl == null; mapArch.setMapName("cb"); - copyMapCtrl = gridartaObjectsFactory.newMapControl(null, mapArch, mainControl.getMainView(), autojoinLists); - copyMapCtrl.setMapFileName("cb"); + copyMapCtrl = gridartaObjectsFactory.newMapControl(null, mapArch, mainControl.getMainView(), autojoinLists, "cb", null); } /** Modified: trunk/src/app/net/sf/gridarta/DefaultMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -136,10 +136,7 @@ @NotNull private MapControl<G, A, R, V> newMap(final List<G> objects, final A mapArchObject, @Nullable final File file, @NotNull final String mapFileName) { - final MapControl<G, A, R, V> mapControl = gridartaObjectsFactory.newMapControl(objects, mapArchObject, mainControl.getMainView(), autojoinLists); - mapControl.setMapFile(file); - mapControl.setMapFileName(mapFileName); - return mapControl; + return gridartaObjectsFactory.newMapControl(objects, mapArchObject, mainControl.getMainView(), autojoinLists, mapFileName, file); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -103,10 +103,12 @@ * @param mapArchObject The map arch object to use for the new map. * @param parent the parent component for error messages * @param autojoinLists the autojoin lists instance + * @param mapName the map name + * @param file the associated file * @return The new map control instance. */ @NotNull - MapControl<G, A, R, V> newMapControl(@Nullable List<G> objects, @NotNull A mapArchObject, @NotNull Component parent, @NotNull AutojoinLists<G, A, R> autojoinLists); + MapControl<G, A, R, V> newMapControl(@Nullable List<G> objects, @NotNull A mapArchObject, @NotNull Component parent, @NotNull AutojoinLists<G, A, R> autojoinLists, @NotNull String mapName, @Nullable File file); /** * Create a new pickmap map control instance. Modified: trunk/src/app/net/sf/gridarta/map/MapControlFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControlFactory.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/src/app/net/sf/gridarta/map/MapControlFactory.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -41,10 +41,12 @@ * @param parent the parent component for error messages * @param objects the objects to insert into the new map * @param mapArchObject the map arch object to use for the new map + * @param mapName the map name + * @param file the associated file * @return the new map control instance */ @NotNull - MapControl<G, A, R, V> newMapControl(@NotNull GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull Component parent, @Nullable final List<G> objects, @NotNull A mapArchObject); + MapControl<G, A, R, V> newMapControl(@NotNull GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull Component parent, @Nullable List<G> objects, @NotNull A mapArchObject, @NotNull String mapName, @Nullable File file); /** * Create a new pickmap map control instance. Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-19 23:50:18 UTC (rev 4909) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-20 00:29:26 UTC (rev 4910) @@ -875,7 +875,7 @@ /** {@inheritDoc} */ @NotNull - public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists) { + public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @NotNull final Component parent, @NotNull final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists, @NotNull final String mapName, @Nullable final File file) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |