From: <aki...@us...> - 2008-08-04 21:04:19
|
Revision: 4758 http://gridarta.svn.sourceforge.net/gridarta/?rev=4758&view=rev Author: akirschbaum Date: 2008-08-04 21:03:43 +0000 (Mon, 04 Aug 2008) Log Message: ----------- Remove ArchetypeChooserControl.getArchetypeChooserModel(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -80,6 +80,7 @@ import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; import net.sf.gridarta.gui.map.MapCursorControl; @@ -233,7 +234,8 @@ ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "zoom", "gc", "onlineHelp", "tod", "about"); final MapManagerActions<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManagerActions = new MapManagerActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); PathManager.setGlobalSettings(globalSettings); - final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = new ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, archetypeSet, false); + final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel = new ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic>(archetypeSet); + final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = new ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, false, archetypeChooserModel); newMapDialogFactory = new NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mapManager, gridartaObjectsFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, 0, false, false, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT); pickmapChooserControl = new PickmapChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(newMapDialogFactory, this, gridartaObjectsFactory, new File(globalSettings.getMapDir(), IGUIConstants.PICKMAP_DIR), mapManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); @@ -329,14 +331,14 @@ final CFilterControl filterControl = new CFilterControl(null, mapManager, defaultNamedFilterList); ((CrossfireObjectsFactory) gridartaObjectsFactory).setFilterControl(filterControl); scriptControl = new ScriptController(this, filterControl, archetypeSet, mainView); - final ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic> objectChoiceDisplay = new ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, archetypeTypeSet, objectChooser, archetypeChooserControl.getArchetypeChooserModel(), pickmapChooserControl); + final ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic> objectChoiceDisplay = new ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, archetypeTypeSet, objectChooser, archetypeChooserModel, pickmapChooserControl); final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette = new ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic>(editTypes, selectedSquareView, objectChooser, pickmapChooserControl, copyBuffer); final LeftPanel leftPanel = new LeftPanel(objectChooser, toolPalette, objectChoiceDisplay); mainView.init(gameObjectAttributesPanel, selectedSquareView, archetypeTypeSet, mapTileListBottom, gameObjectMatchers, archetypeChooserControl, objectChooser, leftPanel); mapActions.updateMenuState(); scriptControl.getView().setMenu((JMenu) ACTION_FACTORY.find(mainView.getJMenuBar(), "plugins")); final ArchetypeParser archetypeParser = new ArchetypeParser(gridartaObjectsFactory, archetypeChooserControl, animationObjects, archetypeSet); - gridartaObjectsFactory.init(faceObjects, archetypeChooserControl, selectedSquareView, this, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, autojoinLists, toolPalette); + gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, autojoinLists, toolPalette); archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { Modified: trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/crossfire/src/cfeditor/CrossfireObjectsFactory.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -44,7 +44,7 @@ import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.tools.ToolPalette; @@ -70,9 +70,9 @@ /** Preferences. */ private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - /** The {@link ArchetypeChooserControl} instance to use. */ + /** The {@link ArchetypeChooserModel} instance to use. */ @NotNull - private ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = null; + private ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel = null; /** The {@link SelectedSquareView} instance to use. */ @NotNull @@ -154,13 +154,13 @@ /** {@inheritDoc} */ @NotNull 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, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserModel, mapActions); } /** {@inheritDoc} */ @NotNull 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, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserModel, mapActions); } /** {@inheritDoc} */ @@ -176,8 +176,8 @@ } /** {@inheritDoc} */ - public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final EditTypes<GameObject, MapArchObject, Archetype, CMapViewBasic> editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette) { - this.archetypeChooserControl = archetypeChooserControl; + public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final EditTypes<GameObject, MapArchObject, Archetype, CMapViewBasic> editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette) { + this.archetypeChooserModel = archetypeChooserModel; this.selectedSquareView = selectedSquareView; this.mainControl = mainControl; this.editTypes = editTypes; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -88,6 +88,7 @@ import net.sf.gridarta.gui.StatusBar; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributesdialog.GameObjectAttributesDialogFactory; import net.sf.gridarta.gui.map.MapCursorControl; @@ -296,7 +297,8 @@ ACTION_FACTORY.createAction(true, "collectSpells", this); final MapManagerActions<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManagerActions = new MapManagerActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); PathManager.setGlobalSettings(globalSettings); - final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = new ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, archetypeSet, true); + final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel = new ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic>(archetypeSet); + final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = new ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, true, archetypeChooserModel); newMapDialogFactory = new NewMapDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, mapManager, gridartaObjectsFactory, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPDIFFICULTY, true, true, IGUIConstants.DEF_PICKMAP_WIDTH, IGUIConstants.DEF_PICKMAP_HEIGHT); pickmapChooserControl = new PickmapChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(newMapDialogFactory, this, gridartaObjectsFactory, new File(globalSettings.getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), mapManager); newMapDialogFactory.setPickmapChooserControl(pickmapChooserControl); @@ -390,13 +392,13 @@ // Initialize the main view final LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic> lockedItemsControl = new LockedItemsControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager, 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); gameObjectAttributesPanel = new GameObjectAttributesPanel(this, objectChooser, archetypeTypeSet, mapManager, animationObjects, lockedItemsControl, monsterMatcher, selectedSquareControl, selectedSquareView, mainView); - final ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic> objectChoiceDisplay = new ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, archetypeTypeSet, objectChooser, archetypeChooserControl.getArchetypeChooserModel(), pickmapChooserControl); + final ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic> objectChoiceDisplay = new ObjectChoiceDisplay<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, archetypeTypeSet, objectChooser, archetypeChooserModel, pickmapChooserControl); final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette = new ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic>(editTypes, selectedSquareView, objectChooser, pickmapChooserControl, copyBuffer); final LeftPanel leftPanel = new LeftPanel(objectChooser, toolPalette, objectChoiceDisplay); mainView.init(gameObjectAttributesPanel, selectedSquareView, archetypeTypeSet, mapTileListBottom, gameObjectMatchers, archetypeChooserControl, objectChooser, leftPanel); mapActions.updateMenuState(); final ArchetypeParser archetypeParser = new ArchetypeParser(archetypeChooserControl, animationObjects, archetypeSet); - gridartaObjectsFactory.init(faceObjects, archetypeChooserControl, selectedSquareView, this, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, autojoinLists, toolPalette); + gridartaObjectsFactory.init(faceObjects, archetypeChooserModel, selectedSquareView, this, editTypes, mapImageCache, mapActions, archetypeParser, archetypeSet, autojoinLists, toolPalette); archetypeSet.loadArchetypes(archetypeParser); if (globalSettings.isAutoPopupDocu()) { Modified: trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java =================================================================== --- trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/daimonin/src/daieditor/DaimoninObjectsFactory.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -44,7 +44,7 @@ import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.tools.ToolPalette; @@ -73,9 +73,9 @@ /** The {@link FaceObjects} instance to use. */ private FaceObjects faceObjects = null; - /** The {@link ArchetypeChooserControl} instance to use. */ + /** The {@link ArchetypeChooserModel} instance to use. */ @NotNull - private ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl = null; + private ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel = null; /** The {@link SelectedSquareView} instance to use. */ @NotNull @@ -154,13 +154,13 @@ /** {@inheritDoc} */ @NotNull 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, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + return new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, parent, autojoinLists, mapImageCache, objects, mapArchObject, false, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserModel, mapActions); } /** {@inheritDoc} */ @NotNull 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, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserControl, mapActions); + final DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl = new DefaultMapControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, parent, autojoinLists, mapImageCache, objects, mapArchObject, true, GameObjectMatchersInstance.getInstance().getMatcher("exit"), archetypeChooserModel, mapActions); mapArchObject.setDifficulty(1); return mapControl; } @@ -178,9 +178,9 @@ } /** {@inheritDoc} */ - public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final EditTypes<GameObject, MapArchObject, Archetype, CMapViewBasic> editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette) { + public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserModel, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final EditTypes<GameObject, MapArchObject, Archetype, CMapViewBasic> editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette) { this.faceObjects = faceObjects; - this.archetypeChooserControl = archetypeChooserControl; + this.archetypeChooserModel = archetypeChooserModel; this.selectedSquareView = selectedSquareView; this.mainControl = mainControl; this.editTypes = editTypes; Modified: trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/src/app/net/sf/gridarta/GridartaObjectsFactory.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -29,7 +29,7 @@ import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gameobject.face.FaceObjects; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; @@ -137,7 +137,7 @@ /** * Initializes the instance. * @param faceObjects the FaceObjects instance - * @param archetypeChooserControl the ArchetypeChooserControl instance + * @param archetypeChooserModel the archetype chooser model instance * @param selectedSquareView the selected square view instance * @param mainControl the main control instance * @param editTypes the edit types instance @@ -148,6 +148,6 @@ * @param autojoinLists the autojoin lists instance * @param toolPalette the tool palette instance */ - void init(@NotNull FaceObjects faceObjects, @NotNull ArchetypeChooserControl<G, A, R, V> archetypeChooserControl, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull MainControl<G, A, R, V> mainControl, @NotNull EditTypes<G, A, R, V> editTypes, @NotNull MapImageCache<G, A, R, V> mapImageCache, @NotNull MapActions mapActions, @NotNull ArchetypeParser<G, A, R> archetypeParser, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull ToolPalette<G, A, R, V> toolPalette); + void init(@NotNull FaceObjects faceObjects, @NotNull ArchetypeChooserModel<G, A, R, V> archetypeChooserModel, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull MainControl<G, A, R, V> mainControl, @NotNull EditTypes<G, A, R, V> editTypes, @NotNull MapImageCache<G, A, R, V> mapImageCache, @NotNull MapActions mapActions, @NotNull ArchetypeParser<G, A, R> archetypeParser, @NotNull ArchetypeSet<G, A, R> archetypeSet, @NotNull final AutojoinLists<G, A, R> autojoinLists, @NotNull ToolPalette<G, A, R, V> toolPalette); } // interface GridartaObjectsFactory Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserControl.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -28,7 +28,6 @@ import java.util.Map; import net.sf.gridarta.MainControl; import net.sf.gridarta.gameobject.Archetype; -import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gui.map.MapViewBasic; import net.sf.gridarta.map.InsertionMode; @@ -64,11 +63,11 @@ /** * Creates a new instance. * @param mainControl The main control. - * @param archetypeSet the archetype set to display * @param createDirectionPane Whether to create a "direction" panel. + * @param archetypeChooserModel the archetype chooser model to use */ - public ArchetypeChooserControl(@NotNull final MainControl<G, A, R, V> mainControl, @NotNull final ArchetypeSet<G, A, R> archetypeSet, final boolean createDirectionPane) { - archetypeChooserModel = new ArchetypeChooserModel<G, A, R, V>(archetypeSet); + public ArchetypeChooserControl(@NotNull final MainControl<G, A, R, V> mainControl, final boolean createDirectionPane, @NotNull final ArchetypeChooserModel<G, A, R, V> archetypeChooserModel) { + this.archetypeChooserModel = archetypeChooserModel; archetypeChooserView = new ArchetypeChooserView<G, A, R, V>(createDirectionPane, mainControl, archetypeChooserModel); } @@ -169,14 +168,4 @@ return archetypeChooserView; } - /** - * Returns the archetype chooser model. - * @return the archetype chooser model - */ - @Deprecated - @NotNull - public ArchetypeChooserModel<G, A, R, V> getArchetypeChooserModel() { - return archetypeChooserModel; - } - } // class ArchetypeChooserControl Modified: trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/src/app/net/sf/gridarta/map/DefaultMapControl.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -37,7 +37,7 @@ import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; @@ -158,16 +158,16 @@ * @param mapArchObject the map arch object for this map * @param isPickmap true if this is a pickmap * @param exitTypeGameObjectMatcher the matcher to select exit objects - * @param archetypeChooserControl the archeype chooser control to use + * @param archetypeChooserModel the archeype chooser model to use * @param mapActions the map actions to use */ - public DefaultMapControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @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) { + public DefaultMapControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @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 ArchetypeChooserModel<G, A, R, V> archetypeChooserModel, @NotNull final MapActions mapActions) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.parent = parent; this.mapImageCache = mapImageCache; this.isPickmap = isPickmap; // we create model (= data) - mapModel = new DefaultMapModel<G, A, R>(parent, autojoinLists, this, objects, mapArchObject, exitTypeGameObjectMatcher, archetypeChooserControl.getArchetypeChooserModel(), mapActions); + mapModel = new DefaultMapModel<G, A, R>(parent, autojoinLists, this, objects, mapArchObject, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); mapModel.addMapModelListener(mapModelListener); } Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-04 20:43:35 UTC (rev 4757) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-04 21:03:43 UTC (rev 4758) @@ -53,7 +53,7 @@ import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gui.GameObjectAttributesPanel; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserControl; +import net.sf.gridarta.gui.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.gui.map.LevelRenderer; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; @@ -385,13 +385,13 @@ final TestMainControl mainControl = new TestMainControl(gridartaObjectsFactory, "test", globalSettings); final TestMapArchObject mapArchObject = new TestMapArchObject(); final TestArchetypeSet archetypeSet = new TestArchetypeSet(gridartaObjectsFactory); - final ArchetypeChooserControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> archetypeChooserControl = new ArchetypeChooserControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic>(mainControl, archetypeSet, false); + final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic>(archetypeSet); final MapManager<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapManager = new DefaultMapManager<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic>(mainControl, "test", gridartaObjectsFactory); final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapImageCache = new MapImageCache<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic>(null, mapManager, null, new ImageIcon(), new ImageIcon()); final MapActions mapActions = new TestMapActions(); final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists = new AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype>(); - final TestMapControl mapControl = new TestMapControl(gridartaObjectsFactory, autojoinLists, mapImageCache, null, mapArchObject, false, null, archetypeChooserControl, mapActions); - mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(new JPanel(), autojoinLists, mapControl, null, mapArchObject, null, archetypeChooserControl.getArchetypeChooserModel(), mapActions); + final TestMapControl mapControl = new TestMapControl(gridartaObjectsFactory, autojoinLists, mapImageCache, null, mapArchObject, false, null, archetypeChooserModel, mapActions); + mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(new JPanel(), autojoinLists, mapControl, null, mapArchObject, null, archetypeChooserModel, mapActions); result.setLength(0); mapModel.addMapModelListener(mapModelListener); @@ -490,11 +490,11 @@ * @param mapArchObject the map arch object to use * @param isPickmap whether this map control is a pickmap * @param exitTypeGameObjectMatcher the exit matcher to use - * @param archetypeChooserControl the archetype chooser control to use + * @param archetypeChooserModel the archetype chooser model to use * @param mapActions the map actions to use */ - public TestMapControl(@NotNull final GridartaObjectsFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> gridartaObjectsFactory, @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, new JPanel(), autojoinLists, mapImageCache, objects, mapArchObject, isPickmap, exitTypeGameObjectMatcher, archetypeChooserControl, mapActions); + public TestMapControl(@NotNull final GridartaObjectsFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> gridartaObjectsFactory, @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 ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> archetypeChooserModel, @NotNull final MapActions mapActions) { + super(gridartaObjectsFactory, new JPanel(), autojoinLists, mapImageCache, objects, mapArchObject, isPickmap, exitTypeGameObjectMatcher, archetypeChooserModel, mapActions); } } @@ -888,7 +888,7 @@ } /** {@inheritDoc} */ - public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> testGameObjectTestMapArchObjectTestArchetypeTestMapViewBasicArchetypeChooserControl, @NotNull final SelectedSquareView<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> selectedSquareView, @NotNull final MainControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mainControl, @NotNull final EditTypes<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> editTypes, @NotNull final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype> archetypeParser, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet, @NotNull final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists, @NotNull final ToolPalette<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> toolPalette) { + public void init(@NotNull final FaceObjects faceObjects, @NotNull final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> archetypeChooserModel, @NotNull final SelectedSquareView<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> selectedSquareView, @NotNull final MainControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mainControl, @NotNull final EditTypes<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> editTypes, @NotNull final MapImageCache<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapImageCache, @NotNull final MapActions mapActions, @NotNull final ArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype> archetypeParser, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet, @NotNull final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists, @NotNull final ToolPalette<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> toolPalette) { throw new AssertionError(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |