From: <aki...@us...> - 2008-08-20 20:40:16
|
Revision: 4933 http://gridarta.svn.sourceforge.net/gridarta/?rev=4933&view=rev Author: akirschbaum Date: 2008-08-20 20:40:23 +0000 (Wed, 20 Aug 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/AbstractMainControl.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-20 20:34:41 UTC (rev 4932) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-20 20:40:23 UTC (rev 4933) @@ -88,7 +88,6 @@ import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; -import net.sf.gridarta.gui.selectedsquare.SelectedSquareControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.undo.UndoControl; import net.sf.gridarta.io.IOUtils; @@ -182,8 +181,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new CrossfireObjectsFactory(), new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(), false, CResourceLoader.getHomeFile("thumbnails")); - final SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, editTypes, mapTileListBottom, null, archetypeSet); + super(new CrossfireObjectsFactory(), new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(), false, CResourceLoader.getHomeFile("thumbnails"), null); final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView = selectedSquareControl.getSelectedSquareView(); new MapCursorControl<GameObject, MapArchObject, Archetype, CMapViewBasic>("cfeditor", gameObjectAttributesDialogFactory, mapManager, mapViewManager, selectedSquareControl, selectedSquareView); replaceDialogManager.setObjectChooser(objectChooser); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-20 20:34:41 UTC (rev 4932) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-20 20:40:23 UTC (rev 4933) @@ -95,7 +95,6 @@ import net.sf.gridarta.gui.prefs.MapValidatorPrefs; import net.sf.gridarta.gui.prefs.MiscPrefs; import net.sf.gridarta.gui.prefs.UpdatePrefs; -import net.sf.gridarta.gui.selectedsquare.SelectedSquareControl; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.undo.UndoControl; import net.sf.gridarta.gui.utils.GUIUtils; @@ -242,8 +241,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new DaimoninObjectsFactory(), new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(), true, null); - final SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, editTypes, mapTileListBottom, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), archetypeSet); + super(new DaimoninObjectsFactory(), new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView = selectedSquareControl.getSelectedSquareView(); new MapCursorControl<GameObject, MapArchObject, Archetype, CMapViewBasic>("daieditor", gameObjectAttributesDialogFactory, mapManager, mapViewManager, selectedSquareControl, selectedSquareView); replaceDialogManager.setObjectChooser(objectChooser); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-20 20:34:41 UTC (rev 4932) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-20 20:40:23 UTC (rev 4933) @@ -55,6 +55,7 @@ import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; +import net.sf.gridarta.gui.selectedsquare.SelectedSquareControl; import net.sf.gridarta.help.Help; import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapArchObject; @@ -193,6 +194,9 @@ @NotNull protected final DefaultObjectChooser<G, A, R> objectChooser; + @NotNull + protected final SelectedSquareControl<G, A, R, V> selectedSquareControl; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -205,8 +209,10 @@ * @param createDirectionPane whether the direction panel should be created * @param mapImageCacheDir the map image cache directory or * <code>null</code> to use the map directory + * @param compassIcon the icon to display in the selected square view; + * <code>null</code> to not show an icon */ - protected AbstractMainControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<G, A, R, V> mapControlFactory, final boolean createDirectionPane, @Nullable final File mapImageCacheDir) { + protected AbstractMainControl(@NotNull final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<G, A, R, V> mapControlFactory, final boolean createDirectionPane, @Nullable final File mapImageCacheDir, @Nullable final ImageIcon compassIcon) { this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -239,6 +245,7 @@ mainView = new MainView<G, A, R, V>(this, editTypes, mapManager, mapViewManager, ACTION_FACTORY, mapManagerActions.getCloseAllAction(), statusBar); replaceDialogManager = new ReplaceDialogManager<G, A, R, V>(mainView, archetypeSet, copyBuffer); objectChooser = new DefaultObjectChooser<G, A, R>(archetypeChooserControl, pickmapChooserControl); + selectedSquareControl = new SelectedSquareControl<G, A, R, V>(ACTION_FACTORY, gameObjectAttributesDialogFactory, objectChooser, mapManager, mapViewManager, editTypes, mapTileListBottom, compassIcon, archetypeSet); } /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-20 20:34:41 UTC (rev 4932) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-20 20:40:23 UTC (rev 4933) @@ -431,7 +431,7 @@ * @param mapControlFactory the map control factory instance to use */ protected TestMainControl(@NotNull final GridartaObjectsFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> gridartaObjectsFactory, @NotNull final RendererFactory<TestGameObject, TestMapArchObject, TestArchetype> rendererFactory, @NotNull final String key, @NotNull final GlobalSettings globalSettings, @NotNull final AnimationObjects<TestAnimationObject> animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final MapControlFactory<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> mapControlFactory) { - super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |