From: <aki...@us...> - 2008-07-31 23:09:35
|
Revision: 4649 http://gridarta.svn.sourceforge.net/gridarta/?rev=4649&view=rev Author: akirschbaum Date: 2008-07-31 23:09:40 +0000 (Thu, 31 Jul 2008) Log Message: ----------- Remove calls to MainControl.getMainView(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java trunk/daimonin/src/daieditor/DaimoninObjectsFactory.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/gui/pickmapchooser/Folder.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Loader.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Pickmap.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -27,6 +27,7 @@ import cfeditor.io.GameObjectParser; import cfeditor.io.MapArchObjectParser; import cfeditor.map.MapArchObject; +import java.awt.Component; import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; @@ -149,14 +150,14 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent) { + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); } /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent) { + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java =================================================================== --- trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -27,6 +27,7 @@ import daieditor.io.GameObjectParser; import daieditor.io.MapArchObjectParser; import daieditor.map.MapArchObject; +import java.awt.Component; import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; @@ -152,14 +153,14 @@ /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent) { + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); } /** {@inheritDoc} */ @NotNull - public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject) { - final DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + public MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> newPickmapControl(@Nullable final List<GameObject> objects, @NotNull final MapArchObject mapArchObject, @NotNull final Component parent) { + final DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mainControl, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); mapArchObject.setDifficulty(1); return mapControl; } Modified: trunk/src/app/net/sf/gridarta/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/CopyBuffer.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -89,7 +89,7 @@ public void init(final A mapArch) { assert copyMapCtrl == null; mapArch.setMapName("cb"); - copyMapCtrl = mainControl.getGridartaObjectsFactory().newMapControl(null, mapArch); + copyMapCtrl = mainControl.getGridartaObjectsFactory().newMapControl(null, mapArch, mainControl.getMainView()); copyMapCtrl.setMapFileName("cb"); } Modified: trunk/src/app/net/sf/gridarta/DefaultMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/DefaultMapManager.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -112,7 +112,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 = mainControl.getGridartaObjectsFactory().newMapControl(objects, mapArchObject); + final MapControl<G, A, R, V> mapControl = mainControl.getGridartaObjectsFactory().newMapControl(objects, mapArchObject, mainControl.getMainView()); mapControl.setMapFile(file); mapControl.setMapFileName(mapFileName); return mapControl; Modified: trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta; +import java.awt.Component; import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; @@ -98,19 +99,21 @@ * Create a new map control instance. * @param objects The objects to insert into the new map. * @param mapArchObject The map arch object to use for the new map. + * @param parent the parent component for error messages * @return The new map control instance. */ @NotNull - MapControl<G, A, R, V> newMapControl(@Nullable List<G> objects, @NotNull A mapArchObject); + MapControl<G, A, R, V> newMapControl(@Nullable List<G> objects, @NotNull A mapArchObject, @NotNull Component parent); /** * Create a new pickmap map control instance. * @param objects The objects to insert into the new pickmap. * @param mapArchObject The map arch object to use for the new pickmap. + * @param parent the parent component for error messages * @return The new pickmap map control instance. */ @NotNull - MapControl<G, A, R, V> newPickmapControl(@Nullable List<G> objects, @NotNull A mapArchObject); + MapControl<G, A, R, V> newPickmapControl(@Nullable List<G> objects, @NotNull A mapArchObject, @NotNull Component parent); /** * Create a new level renderer instance. Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Folder.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Folder.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Folder.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.pickmapchooser; +import java.awt.Component; import java.io.File; import java.util.ArrayList; import java.util.Collection; @@ -130,11 +131,12 @@ * @param name the map file name * @param gridartaObjectsFactory the <code>GridartaObjectsFactory</code> * instance for loading the pickmap map file + * @param parent the parent component for error messages * @return the newly created pickmap * @throws InvalidNameException if the pickmap name is invalid */ - public synchronized Pickmap<G, A, R, V> addPickmap(@NotNull final String name, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory) throws InvalidNameException { - final Pickmap<G, A, R, V> pickmap = new Pickmap<G, A, R, V>(this, name, gridartaObjectsFactory); + public synchronized Pickmap<G, A, R, V> addPickmap(@NotNull final String name, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final Component parent) throws InvalidNameException { + final Pickmap<G, A, R, V> pickmap = new Pickmap<G, A, R, V>(this, name, gridartaObjectsFactory, parent); pickmaps.add(pickmap); for (final FolderListener<G, A, R, V> listener : listeners.getListeners(FolderListener.class)) { listener.pickmapAdded(pickmap); Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Loader.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Loader.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Loader.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.pickmapchooser; +import java.awt.Component; import java.io.File; import java.util.Arrays; import net.sf.gridarta.GridartaObjectsFactory; @@ -51,14 +52,22 @@ private final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory; /** + * The parent component for error messages. + */ + @NotNull + private final Component parent; + + /** * Creates a new instance. * @param model the model to add the loaded pickmaps to * @param gridartaObjectsFactory the <code>GridartaObjectsFactory</code> + * @param parent the parent component for error messages * instance to use for loading pickmap files */ - public Loader(@NotNull final Model<G, A, R, V> model, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory) { + public Loader(@NotNull final Model<G, A, R, V> model, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final Component parent) { this.model = model; this.gridartaObjectsFactory = gridartaObjectsFactory; + this.parent = parent; } /** Loads all pickmap files from a directory and its subdirectories. */ @@ -104,7 +113,7 @@ for (final File file : files) { if (file.isFile()) { try { - folder.addPickmap(file.getName(), gridartaObjectsFactory); + folder.addPickmap(file.getName(), gridartaObjectsFactory, this.parent); } catch (final InvalidNameException ex) { log.warn("ignoring pickmap with invalid name: " + file); } Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Pickmap.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Pickmap.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/Pickmap.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.pickmapchooser; +import java.awt.Component; import java.io.File; import java.io.IOException; import java.util.Collection; @@ -65,6 +66,12 @@ private final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory; /** + * The parent component for error messages. + */ + @NotNull + private final Component parent; + + /** * The {@link MapControl} instance representing the map file, or * <code>null</code> if the map file is not loaded. */ @@ -84,9 +91,10 @@ * @param name the underlying map file name * @param gridartaObjectsFactory the <code>GridartaObjectsFactory</code> * instance for loading the map file + * @param parent the parent component for error messages * @throws InvalidNameException if <code>name</code> is not valid */ - public Pickmap(@NotNull final Folder<G, A, R, V> folder, @NotNull final String name, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory) throws InvalidNameException { + public Pickmap(@NotNull final Folder<G, A, R, V> folder, @NotNull final String name, @NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final Component parent) throws InvalidNameException { if (!isValidPickmapName(name)) { throw new InvalidNameException(name); } @@ -94,6 +102,7 @@ this.folder = folder; this.name = name; this.gridartaObjectsFactory = gridartaObjectsFactory; + this.parent = parent; } /** @@ -153,7 +162,7 @@ decoder.close(); } - pickmap = gridartaObjectsFactory.newPickmapControl(decoder.getGameObjects(), decoder.getMapArchObject()); + pickmap = gridartaObjectsFactory.newPickmapControl(decoder.getGameObjects(), decoder.getMapArchObject(), parent); pickmap.setMapFile(file); pickmap.setMapFileName(file.getPath()); pickmap.resetModified(); Modified: trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/gui/pickmapchooser/PickmapChooserControl.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -199,7 +199,7 @@ * Load all pickmaps and build the pickmap-panel. */ public void loadPickmaps() { - new Loader<G, A, R, V>(model, mainControl.getGridartaObjectsFactory()).load(); + new Loader<G, A, R, V>(model, mainControl.getGridartaObjectsFactory(), mainControl.getMainView()).load(); } /** @@ -240,7 +240,7 @@ } } - final MapControl<G, A, R, V> mapControl = mainControl.getGridartaObjectsFactory().newPickmapControl(null, mapArchObject); + final MapControl<G, A, R, V> mapControl = mainControl.getGridartaObjectsFactory().newPickmapControl(null, mapArchObject, mainControl.getMainView()); mapControl.setMapFile(mapFile); mapControl.setMapFileName(mapFile.getPath()); mapControl.resetModified(); @@ -248,7 +248,7 @@ final Pickmap<G, A, R, V> pickmap; try { - pickmap = activeFolder.addPickmap(pickmapName, mainControl.getGridartaObjectsFactory()); + pickmap = activeFolder.addPickmap(pickmapName, mainControl.getGridartaObjectsFactory(), mainControl.getMainView()); } catch (final InvalidNameException ex) { throw new AssertionError(); // the name has been checked before } Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta.map; +import java.awt.Component; import java.awt.Point; import java.io.File; import java.io.IOException; @@ -75,6 +76,12 @@ @NotNull private final MainControl<G, A, R, V> mainControl; + /** + * The parent component for error messages. + */ + @NotNull + private final Component parent; + /** The map image cache instance. */ @NotNull private final MapImageCache<G, A, R, V> mapImageCache; @@ -150,6 +157,7 @@ * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory instance * @param mainControl the main control + * @param parent the parent component for error messages * @param autojoinLists the autojoin lists instance to use * @param mapImageCache the map image cache instance * @param objects the game objects to insert; my be <code>null</code> @@ -159,13 +167,14 @@ * @param archetypeChooserControl the archeype chooser control to use * @param mapActions the map actions to use */ - public DefaultMapControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final MainControl<G, A, R, V> mainControl, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final MapImageCache<G, A, R, V> mapImageCache, @Nullable final List<G> objects, @NotNull final A mapArchObject, final boolean isPickmap, @Nullable final GameObjectMatcher exitTypeGameObjectMatcher, @NotNull final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, @NotNull final MapActions mapActions) { + public DefaultMapControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final MainControl<G, A, R, V> mainControl, @NotNull final Component parent, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final MapImageCache<G, A, R, V> mapImageCache, @Nullable final List<G> objects, @NotNull final A mapArchObject, final boolean isPickmap, @Nullable final GameObjectMatcher exitTypeGameObjectMatcher, @NotNull final ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, @NotNull final MapActions mapActions) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.mainControl = mainControl; + this.parent = parent; this.mapImageCache = mapImageCache; this.isPickmap = isPickmap; // we create model (= data) - mapModel = new DefaultMapModel<G, A, R>(mainControl, autojoinLists, this, objects, mapArchObject, exitTypeGameObjectMatcher, archetypeChooserControl, mapActions); + mapModel = new DefaultMapModel<G, A, R>(parent, autojoinLists, this, objects, mapArchObject, exitTypeGameObjectMatcher, archetypeChooserControl, mapActions); mapModel.addMapModelListener(mapModelListener); } @@ -414,7 +423,7 @@ mapImageCache.updateCaches(file, this, MapImageCache.ImageType.ICON); } catch (final IOException e) { - ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "encodeMapFile", file, e.getMessage()); + ACTION_FACTORY.showMessageDialog(parent, "encodeMapFile", file, e.getMessage()); return false; } return true; Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapModel.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package net.sf.gridarta.map; +import java.awt.Component; import java.awt.Point; import java.util.HashSet; import java.util.Iterator; @@ -28,7 +29,6 @@ import javax.swing.event.EventListenerList; import net.sf.gridarta.AutojoinList; import net.sf.gridarta.AutojoinLists; -import net.sf.gridarta.MainControl; import net.sf.gridarta.MapActions; import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Archetype; @@ -79,14 +79,10 @@ private final A mapArchObject; /** - * The CMainControl used for various operations. - * @deprecated it's not a good idea to require the MapModel implementation - * to know such a heavy-weight strongly UI-related glue class - * like {@link MainControl}. + * The parent component for error messages. */ - @Deprecated @NotNull - private final transient MainControl<G, A, R, ?> mainControl; + private final Component parent; @NotNull private final AutojoinLists<G, A, R> autojoinLists; @@ -150,7 +146,7 @@ /** * Create an DefaultMapModel. - * @param mainControl main controller + * @param parent the parent component for error messages * @param autojoinLists the autojoin lists instance to use * @param mapControl MapControl to associate with this model. * @param objects the <code>GameObject</code> list of this map or @@ -160,10 +156,10 @@ * @param archetypeChooserControl the archetype chooser control * @param mapActions the map actions to use */ - public DefaultMapModel(@NotNull final MainControl<G, A, R, ?> mainControl, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final MapControl<G, A, R, ?> mapControl, @Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final GameObjectMatcher exitTypeGameObjectMatcher, @NotNull final ArchetypeChooserControl<G, A, R, ?> archetypeChooserControl, @NotNull final MapActions mapActions) { + public DefaultMapModel(@NotNull final Component parent, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull final MapControl<G, A, R, ?> mapControl, @Nullable final List<G> objects, @NotNull final A mapArchObject, @Nullable final GameObjectMatcher exitTypeGameObjectMatcher, @NotNull final ArchetypeChooserControl<G, A, R, ?> archetypeChooserControl, @NotNull final MapActions mapActions) { this.mapControl = mapControl; this.mapArchObject = mapArchObject; - this.mainControl = mainControl; + this.parent = parent; this.autojoinLists = autojoinLists; this.archetypeChooserControl = archetypeChooserControl; this.exitTypeGameObjectMatcher = exitTypeGameObjectMatcher; @@ -814,7 +810,7 @@ // TODO: // Think about how this could be handled via an exception and caught much earlier, perhaps already while reading the map, not after it // already has been read. - ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "mapErrorArchOutOfGrid"); + ACTION_FACTORY.showMessageDialog(parent, "mapErrorArchOutOfGrid"); return; } Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-07-31 22:50:50 UTC (rev 4648) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-07-31 23:09:40 UTC (rev 4649) @@ -19,6 +19,7 @@ package test.net.sf.gridarta.map; +import java.awt.Component; import java.awt.Point; import java.io.File; import java.io.FileNotFoundException; @@ -28,6 +29,7 @@ import java.util.TreeSet; import javax.swing.ImageIcon; import javax.swing.JList; +import javax.swing.JPanel; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.AutojoinLists; import net.sf.gridarta.DefaultMapManager; @@ -389,7 +391,7 @@ final MapActions mapActions = new TestMapActions(); final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists = new AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype>(); final TestMapControl mapControl = new TestMapControl(gridartaObjectsFactory, mainControl, autojoinLists, mapImageCache, null, mapArchObject, false, null, archetypeChooserControl, mapActions); - mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(mainControl, autojoinLists, mapControl, null, mapArchObject, null, archetypeChooserControl, mapActions); + mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(new JPanel(), autojoinLists, mapControl, null, mapArchObject, null, archetypeChooserControl, mapActions); result.setLength(0); mapModel.addMapModelListener(mapModelListener); @@ -512,7 +514,7 @@ * @param mapActions the map actions to use */ public TestMapControl(@NotNull final GridartaObjectsFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> gridartaObjectsFactory, @NotNull final MainControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mainControl, @NotNull final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists, @NotNull final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapImageCache, @Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, final boolean isPickmap, @Nullable final GameObjectMatcher exitTypeGameObjectMatcher, @NotNull final ArchetypeChooserControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> archetypeChooserControl, @NotNull final MapActions mapActions) { - super(gridartaObjectsFactory, mainControl, autojoinLists, mapImageCache, objects, mapArchObject, isPickmap, exitTypeGameObjectMatcher, archetypeChooserControl, mapActions); + super(gridartaObjectsFactory, mainControl, new JPanel(), autojoinLists, mapImageCache, objects, mapArchObject, isPickmap, exitTypeGameObjectMatcher, archetypeChooserControl, mapActions); } } @@ -878,13 +880,13 @@ /** {@inheritDoc} */ @NotNull - public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject) { + public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newMapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @NotNull final Component parent) { throw new AssertionError(); } /** {@inheritDoc} */ @NotNull - public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newPickmapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject) { + public MapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> newPickmapControl(@Nullable final List<TestGameObject> objects, @NotNull final TestMapArchObject mapArchObject, @NotNull final Component parent) { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |