From: <aki...@us...> - 2008-08-21 20:48:48
|
Revision: 4956 http://gridarta.svn.sourceforge.net/gridarta/?rev=4956&view=rev Author: akirschbaum Date: 2008-08-21 20:48:52 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:45:17 UTC (rev 4955) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:48:52 UTC (rev 4956) @@ -174,7 +174,7 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - GameObject.setArchetypeSet(archetypeSet, SystemIcons.getNofaceTileIcon()); + GameObject.init(animationObjects, archetypeSet, SystemIcons.getNofaceTileIcon()); gameObjectAttributesDialogFactory.setParent(mainView); new About("cfeditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-21 20:45:17 UTC (rev 4955) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-21 20:48:52 UTC (rev 4956) @@ -26,6 +26,8 @@ import javax.swing.JList; import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.ArchetypeSet; +import net.sf.gridarta.gameobject.anim.AnimationObject; +import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.gameobjectattributespanel.ScriptTab; import net.sf.gridarta.utils.StringUtils; @@ -73,7 +75,7 @@ @Nullable private static ImageIcon noFace = null; - public static void setArchetypeSet(@Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { + public static void init(@Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { GameObject.archetypeSet = archetypeSet; GameObject.noFace = noFace; } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:45:17 UTC (rev 4955) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:48:52 UTC (rev 4956) @@ -234,7 +234,7 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - GameObject.setAnimationObjects(animationObjects, SystemIcons.getNofaceTileIcon()); + GameObject.init(animationObjects, archetypeSet, SystemIcons.getNofaceTileIcon()); gameObjectAttributesDialogFactory.setParent(mainView); new About("daieditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-21 20:45:17 UTC (rev 4955) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-21 20:48:52 UTC (rev 4956) @@ -99,7 +99,7 @@ @Nullable private static ImageIcon noFace = null; - public static void setAnimationObjects(@Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ImageIcon noFace) { + public static void init(@Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { GameObject.animationObjects = animationObjects; GameObject.noFace = noFace; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 20:58:19
|
Revision: 4957 http://gridarta.svn.sourceforge.net/gridarta/?rev=4957&view=rev Author: akirschbaum Date: 2008-08-21 20:58:24 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:48:52 UTC (rev 4956) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:58:24 UTC (rev 4957) @@ -174,7 +174,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - GameObject.init(animationObjects, archetypeSet, SystemIcons.getNofaceTileIcon()); gameObjectAttributesDialogFactory.setParent(mainView); new About("cfeditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); @@ -278,7 +277,7 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-21 20:48:52 UTC (rev 4956) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-21 20:58:24 UTC (rev 4957) @@ -25,9 +25,6 @@ import javax.swing.ImageIcon; import javax.swing.JList; import net.sf.gridarta.MapManager; -import net.sf.gridarta.gameobject.ArchetypeSet; -import net.sf.gridarta.gameobject.anim.AnimationObject; -import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.gameobjectattributespanel.ScriptTab; import net.sf.gridarta.utils.StringUtils; @@ -69,17 +66,6 @@ @NotNull private ImageIcon normalFace = noFace; - @Nullable - private static ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; - - @Nullable - private static ImageIcon noFace = null; - - public static void init(@Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { - GameObject.archetypeSet = archetypeSet; - GameObject.noFace = noFace; - } - /** {@inheritDoc} */ @Override public void propagateElevation(@NotNull final GameObject gameObject) { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:48:52 UTC (rev 4956) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:58:24 UTC (rev 4957) @@ -234,7 +234,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - GameObject.init(animationObjects, archetypeSet, SystemIcons.getNofaceTileIcon()); gameObjectAttributesDialogFactory.setParent(mainView); new About("daieditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); @@ -336,7 +335,7 @@ globalSettings.setAutoPopupDocu(false); } - net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers); + net.sf.gridarta.gameobject.GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, animationObjects, SystemIcons.getNofaceTileIcon()); copyBuffer.init(gridartaObjectsFactory.newMapArchObject(false)); mainActions.init(); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-21 20:48:52 UTC (rev 4956) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-21 20:58:24 UTC (rev 4957) @@ -27,7 +27,6 @@ import net.sf.gridarta.MapManager; import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.anim.AnimationObject; -import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.gameobjectattributespanel.ScriptTab; import org.jetbrains.annotations.NotNull; @@ -54,9 +53,6 @@ /** The serial version UID. */ private static final long serialVersionUID = 1; - @Nullable - private static AnimationObjects<? extends AnimationObject> animationObjects = null; - /** * Face name, can be from animation or face. This is determined by taking * {@link #faceName} or {@link #animName} and takes {@link #direction} into @@ -96,14 +92,6 @@ @NotNull private ImageIcon transFace = noFace; - @Nullable - private static ImageIcon noFace = null; - - public static void init(@Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { - GameObject.animationObjects = animationObjects; - GameObject.noFace = noFace; - } - /** {@inheritDoc} */ public int getMultiShapeID() { return multi != null ? multi.getMultiShapeID() : 0; Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-08-21 20:48:52 UTC (rev 4956) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-08-21 20:58:24 UTC (rev 4957) @@ -23,10 +23,13 @@ import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; +import javax.swing.ImageIcon; import javax.swing.JList; import net.sf.gridarta.MapManager; import net.sf.gridarta.archtype.ArchetypeType; import net.sf.gridarta.archtype.ArchetypeTypeSet; +import net.sf.gridarta.gameobject.anim.AnimationObject; +import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gui.GUIConstants; import net.sf.gridarta.gui.gameobjectattributespanel.ScriptTab; @@ -60,13 +63,19 @@ /** * The archetype set to use. */ - protected static ArchetypeSet<?, ?, ?> archetypeSet = null; + protected static ArchetypeSet archetypeSet = null; /** Static reference to the ArchetypeTypeSet (find syntax errors). */ protected static ArchetypeTypeSet archetypeTypeSet = null; private static GameObjectMatchers gameObjectMatchers = null; + @Nullable + protected static AnimationObjects<? extends AnimationObject> animationObjects = null; + + @Nullable + protected static ImageIcon noFace = null; + /** * If this flag is set, this Archetype is not a "real" Archetype but comes * from the artifacts file. Such Archetypes instances are not included in @@ -192,11 +201,15 @@ * @param archetypeSet the archetype set to use * @param archetypeTypeSet the archetype type set to use * @param gameObjectMatchers the instance to use + * @param animationObjects the animation objects to use + * @param noFace the image icons for game objects having no face */ - public static void initialize(@Nullable final ArchetypeSet<?, ?, ?> archetypeSet, final ArchetypeTypeSet archetypeTypeSet, final GameObjectMatchers gameObjectMatchers) { + public static void initialize(@Nullable final ArchetypeSet<?, ?, ?> archetypeSet, final ArchetypeTypeSet archetypeTypeSet, final GameObjectMatchers gameObjectMatchers, @Nullable final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ImageIcon noFace) { GameObject.archetypeSet = archetypeSet; GameObject.archetypeTypeSet = archetypeTypeSet; GameObject.gameObjectMatchers = gameObjectMatchers; + GameObject.animationObjects = animationObjects; + GameObject.noFace = noFace; } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 20:59:18
|
Revision: 4958 http://gridarta.svn.sourceforge.net/gridarta/?rev=4958&view=rev Author: akirschbaum Date: 2008-08-21 20:59:27 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:58:24 UTC (rev 4957) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) @@ -174,7 +174,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - gameObjectAttributesDialogFactory.setParent(mainView); new About("cfeditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("cfeditor", this, mapManager, mainView, "CrossfireEditor.jar"); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:58:24 UTC (rev 4957) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) @@ -234,7 +234,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - gameObjectAttributesDialogFactory.setParent(mainView); new About("daieditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("daieditor", this, mapManager, mainView, "DaimoninEditor.jar"); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 20:58:24 UTC (rev 4957) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) @@ -262,6 +262,7 @@ replaceDialogManager.setObjectChooser(objectChooser); validators = createMapValidators(); mainActions = new MainActions<G, A, R, V>(replaceDialogManager, this, validators, editTypes, archetypeSet, copyBuffer, animationObjects, ACTION_FACTORY, faceObjects, objectChooser, mapManager, mapViewManager); + gameObjectAttributesDialogFactory.setParent(mainView); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:00:29
|
Revision: 4959 http://gridarta.svn.sourceforge.net/gridarta/?rev=4959&view=rev Author: akirschbaum Date: 2008-08-21 21:00:37 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) @@ -68,7 +68,6 @@ import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; -import net.sf.gridarta.gui.About; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; @@ -174,7 +173,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - new About("cfeditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("cfeditor", this, mapManager, mainView, "CrossfireEditor.jar"); updaterManager.startup(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) @@ -75,7 +75,6 @@ import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; -import net.sf.gridarta.gui.About; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; @@ -234,7 +233,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - new About("daieditor", mainView); new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("daieditor", this, mapManager, mainView, "DaimoninEditor.jar"); updaterManager.startup(); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 20:59:27 UTC (rev 4958) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) @@ -37,6 +37,7 @@ import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.gameobject.scripts.ScriptedEvent; import net.sf.gridarta.gameobject.scripts.ScriptedEventEditor; +import net.sf.gridarta.gui.About; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.MainActions; import net.sf.gridarta.gui.MainView; @@ -263,6 +264,7 @@ validators = createMapValidators(); mainActions = new MainActions<G, A, R, V>(replaceDialogManager, this, validators, editTypes, archetypeSet, copyBuffer, animationObjects, ACTION_FACTORY, faceObjects, objectChooser, mapManager, mapViewManager); gameObjectAttributesDialogFactory.setParent(mainView); + new About(key, mainView); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:01:23
|
Revision: 4960 http://gridarta.svn.sourceforge.net/gridarta/?rev=4960&view=rev Author: akirschbaum Date: 2008-08-21 21:01:32 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:01:32 UTC (rev 4960) @@ -85,7 +85,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.undo.UndoControl; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.map.AutoValidator; import net.sf.gridarta.map.InsertionMode; @@ -173,7 +172,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("cfeditor", this, mapManager, mainView, "CrossfireEditor.jar"); updaterManager.startup(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:01:32 UTC (rev 4960) @@ -92,7 +92,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.undo.UndoControl; import net.sf.gridarta.gui.utils.GUIUtils; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.map.AutoValidator; @@ -233,7 +232,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - new UndoControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager); updaterManager = new UpdaterManager("daieditor", this, mapManager, mainView, "DaimoninEditor.jar"); updaterManager.startup(); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:00:37 UTC (rev 4959) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:01:32 UTC (rev 4960) @@ -60,6 +60,7 @@ import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; 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.help.Help; import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapArchObject; @@ -265,6 +266,7 @@ mainActions = new MainActions<G, A, R, V>(replaceDialogManager, this, validators, editTypes, archetypeSet, copyBuffer, animationObjects, ACTION_FACTORY, faceObjects, objectChooser, mapManager, mapViewManager); gameObjectAttributesDialogFactory.setParent(mainView); new About(key, mainView); + new UndoControl<G, A, R, V>(mapManager); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:04:59
|
Revision: 4961 http://gridarta.svn.sourceforge.net/gridarta/?rev=4961&view=rev Author: akirschbaum Date: 2008-08-21 21:05:00 +0000 (Thu, 21 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-21 21:01:32 UTC (rev 4960) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:05:00 UTC (rev 4961) @@ -107,7 +107,6 @@ import net.sf.gridarta.treasurelist.TreasureListsParser; import net.sf.gridarta.treasurelist.TreasureLocation; import net.sf.gridarta.treasurelist.TreasureTreeNode; -import net.sf.gridarta.updater.UpdaterManager; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.prefs.PreferencesGroup; @@ -171,9 +170,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null); - updaterManager = new UpdaterManager("cfeditor", this, mapManager, mainView, "CrossfireEditor.jar"); - updaterManager.startup(); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar"); // initialize the script-editor pad ScriptEditControlInstance.init(pythonFileFilter, ".py", mainView, new File(globalSettings.getMapDefaultFolder())); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:01:32 UTC (rev 4960) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:05:00 UTC (rev 4961) @@ -124,7 +124,6 @@ import net.sf.gridarta.treasurelist.TreasureListsParser; import net.sf.gridarta.treasurelist.TreasureLocation; import net.sf.gridarta.treasurelist.TreasureTreeNode; -import net.sf.gridarta.updater.UpdaterManager; import net.sf.japi.io.args.ArgParser; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; @@ -231,9 +230,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH)); - updaterManager = new UpdaterManager("daieditor", this, mapManager, mainView, "DaimoninEditor.jar"); - updaterManager.startup(); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar"); // initialize & load MultiPositionData.init(getConfigurationDirectory()); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:01:32 UTC (rev 4960) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:05:00 UTC (rev 4961) @@ -224,8 +224,9 @@ * <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 + * @param gridartaJarFilename the filename of the editor's .jar file */ - 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) { + 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, @NotNull final String gridartaJarFilename) { this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -267,6 +268,8 @@ gameObjectAttributesDialogFactory.setParent(mainView); new About(key, mainView); new UndoControl<G, A, R, V>(mapManager); + updaterManager = new UpdaterManager(key, this, mapManager, mainView, gridartaJarFilename); + updaterManager.startup(); } /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:01:32 UTC (rev 4960) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:05:00 UTC (rev 4961) @@ -433,7 +433,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, null); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar"); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:19:37
|
Revision: 4963 http://gridarta.svn.sourceforge.net/gridarta/?rev=4963&view=rev Author: akirschbaum Date: 2008-08-21 21:19:46 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:10:22 UTC (rev 4962) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:19:46 UTC (rev 4963) @@ -50,7 +50,6 @@ import java.util.MissingResourceException; import javax.swing.JMenu; import javax.swing.SwingUtilities; -import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.CommonConstants; @@ -68,10 +67,8 @@ import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; -import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.MapFileFilter; import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.connectionview.LockedItemsControl; @@ -112,7 +109,6 @@ import net.sf.japi.swing.prefs.PreferencesGroup; import net.sf.japi.swing.prefs.PreferencesPane; import net.sf.japi.util.ThrowableHandler; -import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.w3c.dom.Document; @@ -383,12 +379,6 @@ fileControl.openFileWanted(false); } - /** Swing FileFilter for map files. */ - private static final FileFilter mapFileFilter = new HideFileFilterProxy(MapFileFilter.getInstance()); - - /** Swing FileFilter for Python scripts. */ - public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.python"), ".py")); - /** * Returns the main view. * @return the main view Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:10:22 UTC (rev 4962) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:19:46 UTC (rev 4963) @@ -54,7 +54,6 @@ import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; -import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.CommonConstants; @@ -75,10 +74,8 @@ import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; -import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; -import net.sf.gridarta.gui.MapFileFilter; import net.sf.gridarta.gui.RecentManager; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.connectionview.LockedItemsControl; @@ -131,7 +128,6 @@ import net.sf.japi.swing.prefs.PreferencesGroup; import net.sf.japi.swing.prefs.PreferencesPane; import net.sf.japi.util.ThrowableHandler; -import net.sf.japi.util.filter.file.EndingFileFilter; import net.sf.japi.util.filter.file.Factory; import net.sf.japi.util.filter.file.GlobFileFilter; import org.apache.log4j.Logger; @@ -558,21 +554,6 @@ mapManager.refreshCurrentMap(); } - /** Swing FileFilter for map files. */ - private static final FileFilter mapFileFilter = new HideFileFilterProxy(MapFileFilter.getInstance()); - - /** Swing FileFilter for Lua scripts. */ - public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.lua"), ".lua")); - - /** Swing FileFilter for .arc files. */ - public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.arc"), ".arc")); - - /** Swing FileFilter for .anim files. */ - public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.anim"), ".anim")); - - /** Swing FileFilter for all unignored files. */ - public static final FileFilter unignoredFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.unignored"), "")); - /** * Returns the main view. * @return the main view Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:10:22 UTC (rev 4962) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:19:46 UTC (rev 4963) @@ -41,6 +41,7 @@ import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.gui.MainActions; import net.sf.gridarta.gui.MainView; +import net.sf.gridarta.gui.MapFileFilter; import net.sf.gridarta.gui.MapManagerActions; import net.sf.gridarta.gui.MapPreview; import net.sf.gridarta.gui.MapViewManager; @@ -102,6 +103,24 @@ /** Swing FileFilter for png graphics. */ public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.png"), ".png")); + /** Swing FileFilter for map files. */ + protected static final FileFilter mapFileFilter = new HideFileFilterProxy(MapFileFilter.getInstance()); + + /** Swing FileFilter for Python scripts. */ + public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.python"), ".py")); + + /** Swing FileFilter for Lua scripts. */ + public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.lua"), ".lua")); + + /** Swing FileFilter for .arc files. */ + public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.arc"), ".arc")); + + /** Swing FileFilter for .anim files. */ + public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.anim"), ".anim")); + + /** Swing FileFilter for all unignored files. */ + public static final FileFilter unignoredFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.unignored"), "")); + /** The map control factory. */ protected final MapControlFactory<G, A, R, V> mapControlFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:28:29
|
Revision: 4964 http://gridarta.svn.sourceforge.net/gridarta/?rev=4964&view=rev Author: akirschbaum Date: 2008-08-21 21:28:37 +0000 (Thu, 21 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-21 21:19:46 UTC (rev 4963) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) @@ -166,11 +166,8 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar"); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py"); - // initialize the script-editor pad - ScriptEditControlInstance.init(pythonFileFilter, ".py", mainView, new File(globalSettings.getMapDefaultFolder())); - // load the list with archtype-data from "types.xml" final XmlHelper xmlHelper; try { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:19:46 UTC (rev 4963) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) @@ -226,11 +226,8 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar"); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua"); - // initialize the script-editor pad - ScriptEditControlInstance.init(luaFileFilter, ".lua", mainView, new File(globalSettings.getMapDefaultFolder())); - // load the list with archtype-data from "types.xml" final XmlHelper xmlHelper; try { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:19:46 UTC (rev 4963) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) @@ -244,8 +244,10 @@ * @param compassIcon the icon to display in the selected square view; * <code>null</code> to not show an icon * @param gridartaJarFilename the filename of the editor's .jar file + * @param scriptFileFilter the file filter for script files + * @param scriptExtension the file extension for script files */ - 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, @NotNull final String gridartaJarFilename) { + 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension) { this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -289,6 +291,7 @@ new UndoControl<G, A, R, V>(mapManager); updaterManager = new UpdaterManager(key, this, mapManager, mainView, gridartaJarFilename); updaterManager.startup(); + ScriptEditControlInstance.init(scriptFileFilter, scriptExtension, mainView, new File(globalSettings.getMapDefaultFolder())); } /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:19:46 UTC (rev 4963) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:28:37 UTC (rev 4964) @@ -33,6 +33,7 @@ import javax.swing.ImageIcon; import javax.swing.JList; import javax.swing.JPanel; +import javax.swing.filechooser.FileFilter; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.AutojoinLists; import net.sf.gridarta.DefaultMapManager; @@ -433,7 +434,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, null, "test.jar"); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script"); } /** {@inheritDoc} */ @@ -502,6 +503,23 @@ } /** + * A {@link FileFilter} implementation for testing purposes. + */ + private static class TestFileFilter extends FileFilter { + + /** {@inheritDoc} */ + public boolean accept(final File f) { + throw new AssertionError(); + } + + /** {@inheritDoc} */ + public String getDescription() { + throw new AssertionError(); + } + + } + + /** * A {@link MapControl} implementation for testing purposes. */ private static class TestMapControl extends DefaultMapControl<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:31:02
|
Revision: 4965 http://gridarta.svn.sourceforge.net/gridarta/?rev=4965&view=rev Author: akirschbaum Date: 2008-08-21 21:31:10 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) @@ -50,7 +50,6 @@ import java.util.MissingResourceException; import javax.swing.JMenu; import javax.swing.SwingUtilities; -import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.CommonConstants; import net.sf.gridarta.EditTypes; @@ -58,7 +57,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.XmlHelper; import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; @@ -169,13 +167,6 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py"); // load the list with archtype-data from "types.xml" - final XmlHelper xmlHelper; - try { - xmlHelper = new XmlHelper(mainView); - } catch (final ParserConfigurationException ex) { - log.error("Cannot create XML parser: " + ex.getMessage()); - throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); - } final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); new ArchetypeSetSpellLoader<GameObject, MapArchObject, Archetype>().load(archetypeSet, Archetype.TYPE_SPELL, gameObjectSpells); gameObjectSpells.sort(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) @@ -54,7 +54,6 @@ import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; -import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.AbstractMainControl; import net.sf.gridarta.CommonConstants; import net.sf.gridarta.EditTypes; @@ -62,7 +61,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.XmlHelper; import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; @@ -229,13 +227,6 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua"); // load the list with archtype-data from "types.xml" - final XmlHelper xmlHelper; - try { - xmlHelper = new XmlHelper(mainView); - } catch (final ParserConfigurationException ex) { - log.error("Cannot create XML parser: " + ex.getMessage()); - throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); - } final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); gameObjectSpells.sort(); XMLSpellLoader.load(getConfigurationDirectory(), CommonConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:28:37 UTC (rev 4964) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) @@ -28,6 +28,7 @@ import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; +import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.archtype.ArchetypeTypeSet; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.ArchetypeSet; @@ -229,6 +230,9 @@ @NotNull protected final MainActions<G, A, R, V> mainActions; + @NotNull + protected final XmlHelper xmlHelper; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -292,6 +296,12 @@ updaterManager = new UpdaterManager(key, this, mapManager, mainView, gridartaJarFilename); updaterManager.startup(); ScriptEditControlInstance.init(scriptFileFilter, scriptExtension, mainView, new File(globalSettings.getMapDefaultFolder())); + try { + xmlHelper = new XmlHelper(mainView); + } catch (final ParserConfigurationException ex) { + log.error("Cannot create XML parser: " + ex.getMessage()); + throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:32:55
|
Revision: 4966 http://gridarta.svn.sourceforge.net/gridarta/?rev=4966&view=rev Author: akirschbaum Date: 2008-08-21 21:33:04 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:33:04 UTC (rev 4966) @@ -62,7 +62,6 @@ import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.LeftPanel; @@ -167,7 +166,6 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py"); // load the list with archtype-data from "types.xml" - final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); new ArchetypeSetSpellLoader<GameObject, MapArchObject, Archetype>().load(archetypeSet, Archetype.TYPE_SPELL, gameObjectSpells); gameObjectSpells.sort(); numberSpells.sort(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:33:04 UTC (rev 4966) @@ -67,7 +67,6 @@ import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; @@ -227,7 +226,6 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua"); // load the list with archtype-data from "types.xml" - final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); gameObjectSpells.sort(); XMLSpellLoader.load(getConfigurationDirectory(), CommonConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:31:10 UTC (rev 4965) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:33:04 UTC (rev 4966) @@ -36,6 +36,7 @@ import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.face.FaceObjects; +import net.sf.gridarta.gameobject.match.GameObjectMatchers; import net.sf.gridarta.gameobject.scripts.ScriptedEvent; import net.sf.gridarta.gameobject.scripts.ScriptedEventEditor; import net.sf.gridarta.gui.About; @@ -233,6 +234,9 @@ @NotNull protected final XmlHelper xmlHelper; + @NotNull + protected final GameObjectMatchers gameObjectMatchers; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -302,6 +306,7 @@ log.error("Cannot create XML parser: " + ex.getMessage()); throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } + gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:39:56
|
Revision: 4967 http://gridarta.svn.sourceforge.net/gridarta/?rev=4967&view=rev Author: akirschbaum Date: 2008-08-21 21:39:46 +0000 (Thu, 21 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-21 21:33:04 UTC (rev 4966) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 21:39:46 UTC (rev 4967) @@ -92,8 +92,6 @@ import net.sf.gridarta.map.validation.checks.MapDifficultyChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; -import net.sf.gridarta.spells.ArchetypeSetSpellLoader; -import net.sf.gridarta.spells.GameObjectSpell; import net.sf.gridarta.spells.NumberSpell; import net.sf.gridarta.spells.Spells; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; @@ -136,9 +134,6 @@ /** The Spells. */ private final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); - /** The Spells. */ - private final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells = new Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>>(); - /** The current script controller. */ private final ScriptController scriptControl; @@ -163,11 +158,9 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py"); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL); // load the list with archtype-data from "types.xml" - new ArchetypeSetSpellLoader<GameObject, MapArchObject, Archetype>().load(archetypeSet, Archetype.TYPE_SPELL, gameObjectSpells); - gameObjectSpells.sort(); numberSpells.sort(); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:33:04 UTC (rev 4966) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:39:46 UTC (rev 4967) @@ -110,8 +110,6 @@ import net.sf.gridarta.map.validation.checks.SysObjectNotOnLayerZeroChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; -import net.sf.gridarta.spells.GameObjectSpell; -import net.sf.gridarta.spells.Spells; import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; @@ -178,9 +176,6 @@ /** The Spells. */ private final daieditor.spells.Spells numberSpells = new daieditor.spells.Spells(); - /** The Spells. */ - private final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells = new Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>>(); - /** Whether to display double arches like stacked walls in stacked version. */ private boolean drawDouble; @@ -223,10 +218,9 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua"); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0); // load the list with archtype-data from "types.xml" - gameObjectSpells.sort(); XMLSpellLoader.load(getConfigurationDirectory(), CommonConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); try { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:33:04 UTC (rev 4966) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 21:39:46 UTC (rev 4967) @@ -70,6 +70,9 @@ import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapControlFactory; import net.sf.gridarta.map.validation.DelegatingMapValidator; +import net.sf.gridarta.spells.ArchetypeSetSpellLoader; +import net.sf.gridarta.spells.GameObjectSpell; +import net.sf.gridarta.spells.Spells; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.updater.UpdaterManager; import net.sf.japi.swing.ActionFactory; @@ -238,6 +241,12 @@ protected final GameObjectMatchers gameObjectMatchers; /** + * The Spells. + */ + @NotNull + protected final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); + + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory * @param rendererFactory the renderer factory @@ -254,8 +263,10 @@ * @param gridartaJarFilename the filename of the editor's .jar file * @param scriptFileFilter the file filter for script files * @param scriptExtension the file extension for script files + * @param spellType the object id for spell objects or <code>0</code> to + * not collect game objects spells */ - 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension) { + 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType) { this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -307,6 +318,10 @@ throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); + if (spellType != 0) { + new ArchetypeSetSpellLoader<G, A, R>().load(archetypeSet, spellType, gameObjectSpells); + gameObjectSpells.sort(); + } } /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:33:04 UTC (rev 4966) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 21:39:46 UTC (rev 4967) @@ -434,7 +434,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, null, "test.jar", new TestFileFilter(), ".script"); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script", 0); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 21:51:41
|
Revision: 4968 http://gridarta.svn.sourceforge.net/gridarta/?rev=4968&view=rev Author: akirschbaum Date: 2008-08-21 21:51:50 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Remove CommonConstants.SPELL_FILE from common code base since it is Daimonin only. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/IGUIConstants.java trunk/daimonin/src/daieditor/spells/Spells.java trunk/src/app/net/sf/gridarta/CommonConstants.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:39:46 UTC (rev 4967) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:51:50 UTC (rev 4968) @@ -221,7 +221,7 @@ super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0); // load the list with archtype-data from "types.xml" - XMLSpellLoader.load(getConfigurationDirectory(), CommonConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); + XMLSpellLoader.load(getConfigurationDirectory(), IGUIConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); Modified: trunk/daimonin/src/daieditor/IGUIConstants.java =================================================================== --- trunk/daimonin/src/daieditor/IGUIConstants.java 2008-08-21 21:39:46 UTC (rev 4967) +++ trunk/daimonin/src/daieditor/IGUIConstants.java 2008-08-21 21:51:50 UTC (rev 4968) @@ -86,4 +86,7 @@ String TILE_NORTH = "north.png"; + /** Name of the files the spell information (names and numbers). */ + String SPELL_FILE = "spells.xml"; + } // interface IGUIConstants Modified: trunk/daimonin/src/daieditor/spells/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 21:39:46 UTC (rev 4967) +++ trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 21:51:50 UTC (rev 4968) @@ -19,6 +19,7 @@ package daieditor.spells; +import daieditor.IGUIConstants; import java.awt.Component; import java.io.BufferedReader; import java.io.EOFException; @@ -34,7 +35,6 @@ import java.util.TreeMap; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.CommonConstants; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.spells.NumberSpell; import net.sf.japi.swing.ActionFactory; @@ -139,9 +139,9 @@ new File("resource").mkdir(); new File(baseDir).mkdir(); } - dfile = new File(baseDir, CommonConstants.SPELL_FILE); + dfile = new File(baseDir, IGUIConstants.SPELL_FILE); } else { - dfile = new File(CommonConstants.SPELL_FILE); + dfile = new File(IGUIConstants.SPELL_FILE); } try { Modified: trunk/src/app/net/sf/gridarta/CommonConstants.java =================================================================== --- trunk/src/app/net/sf/gridarta/CommonConstants.java 2008-08-21 21:39:46 UTC (rev 4967) +++ trunk/src/app/net/sf/gridarta/CommonConstants.java 2008-08-21 21:51:50 UTC (rev 4968) @@ -41,9 +41,6 @@ public static final Color INT_COLOR = new Color(74, 70, 156); - /** Name of the files the spell information (names and numbers). */ - public static final String SPELL_FILE = "spells.xml"; - /** Name of the file that contains the type definitions. */ public static final String TYPEDEF_FILE = "types.xml"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:03:00
|
Revision: 4969 http://gridarta.svn.sourceforge.net/gridarta/?rev=4969&view=rev Author: akirschbaum Date: 2008-08-21 22:03:05 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Extract unrelated code from Spells into SpellsUtils. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/spells/Spells.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/spells/SpellsUtils.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 21:51:50 UTC (rev 4968) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:03:05 UTC (rev 4969) @@ -39,6 +39,7 @@ import daieditor.map.validation.checks.ExitChecker; import daieditor.map.validation.checks.SlayingChecker; import daieditor.map.validation.checks.TilePathsChecker; +import net.sf.gridarta.spells.SpellsUtils; import java.awt.Point; import java.io.BufferedReader; import java.io.File; @@ -492,7 +493,7 @@ /** Collect Spells. */ @ActionMethod public void collectSpells() { - numberSpells.importSpellsWanted(getConfigurationDirectory(), mainView); + new SpellsUtils(IGUIConstants.SPELL_FILE).importSpellsWanted(getConfigurationDirectory(), mainView); } /** Edit an existing script. */ Modified: trunk/daimonin/src/daieditor/spells/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 21:51:50 UTC (rev 4968) +++ trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 22:03:05 UTC (rev 4969) @@ -19,28 +19,7 @@ package daieditor.spells; -import daieditor.IGUIConstants; -import java.awt.Component; -import java.io.BufferedReader; -import java.io.EOFException; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.util.Date; -import java.util.Map; -import java.util.TreeMap; -import javax.swing.JFileChooser; -import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.spells.NumberSpell; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.util.filter.file.FilenameFileFilter; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; /** * This class manages the spells and spell lists. @@ -49,132 +28,4 @@ */ public final class Spells extends net.sf.gridarta.spells.Spells<NumberSpell> { - /** The Logger for printing log messages. */ - private static final Logger log = Logger.getLogger(Spells.class); - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** File filter for filtering spellist.h files. */ - private static final FileFilter SPELLIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", "spellist.h"); - - /** - * Opens a file chooser to select the spellist file, then import spells. - * @param baseDir the directory to use - * @param parent Component the parent component for dialog boxes - */ - public static void importSpellsWanted(@NotNull final String baseDir, @NotNull final Component parent) { - // open a file chooser window - final JFileChooser fileChooser = new JFileChooser(); - fileChooser.setDialogTitle("Open CF Spellist File"); - fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); - fileChooser.setMultiSelectionEnabled(false); - fileChooser.setFileFilter(SPELLIST_H_FILE_FILTER); // apply file filter - final File cd = new File(System.getProperty("user.dir")); - final File sd = new File(cd, "../server/src/include"); - fileChooser.setCurrentDirectory(sd.exists() ? sd : cd); - - final int returnVal = fileChooser.showOpenDialog(parent); - - if (returnVal == JFileChooser.APPROVE_OPTION) { - // now import spells from selected file - final File spellfile = fileChooser.getSelectedFile(); - final int spnum = importSpells(spellfile, baseDir); - if (spnum > 0) { - // yeah it worked - ACTION_FACTORY.showMessageDialog(parent, "importSpellsSuccess", spnum); - } else { - // spell collect failed - ACTION_FACTORY.showMessageDialog(parent, "importSpellsFailed"); - } - } - } - - /** - * Read all spells from a Crossfire or Daimonin spellist file and write an - * alphabetical list into "spells.def". - * @param spellfile spellfile to read - * @param baseDir The base directory to load the spells file from. - * @return number of successfully collected spells - */ - private static int importSpells(final File spellfile, final String baseDir) { - final Map<String, String> spells = new TreeMap<String, String>(); - if (spellfile.getName().equalsIgnoreCase("spellist.h")) { - try { - final BufferedReader in = new BufferedReader(new FileReader(spellfile.getAbsolutePath())); - try { - IOUtils.readUntil(in, "spell spells", null); - IOUtils.readUntil(in, "{", null); - - int counter = 0; - for (; ;) { - IOUtils.readUntil(in, "{", "}"); - IOUtils.readUntil(in, "\"", null); - final String name = IOUtils.readUntil(in, "\"").trim(); - IOUtils.readUntil(in, "}", null); - - spells.put(name, Integer.toString(counter++)); - } - } finally { - in.close(); - } - } catch (final FileNotFoundException e) { - log.error("File '" + spellfile.getAbsolutePath() + "' not found!"); - } catch (final EOFException e) { - // Eventually expected exception, don't handle. - } catch (final IOException e) { - log.error("Cannot read file '" + spellfile.getAbsolutePath() + "'!"); - } - } - - // --------- now write the "spells.def" file --------- - if (!spells.isEmpty()) { - // FIXME: This should use DOM for writing the file. - final File dfile; - // create new file for writing (replaces old one if existent) - if (baseDir.length() > 0) { - final File dir = new File(baseDir); - if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! - // create the config dir - new File("resource").mkdir(); - new File(baseDir).mkdir(); - } - dfile = new File(baseDir, IGUIConstants.SPELL_FILE); - } else { - dfile = new File(IGUIConstants.SPELL_FILE); - } - - try { - final PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(dfile), "utf-8")); - try { - // header: - out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); - out.println("<!DOCTYPE spells SYSTEM \"spells.dtd\">"); - out.println("<!--"); - out.println(" - ##########################################################"); - out.println(" - # You may add new spells to this file, but there's no #"); - out.println(" - # need to do it because the file can be autogenerated. #"); - out.println(" - # In the editor, select menu \"Resources->Collect Spells\" #"); - out.println(" - # to generate a new version of this file. #"); - out.println(" - ##########################################################"); - out.println(" -->"); - out.println("<!-- Generated on: " + new Date() + " -->"); - out.println("<spells>"); - - final String[] spaces = {" ", " ", ""}; - for (final String name : spells.keySet()) { - final String id = spells.get(name); - out.println(" <spell id=\"" + id + '\"' + spaces[id.length() - 1] + " name=\"" + name + "\" />"); - } - out.println("</spells>"); - } finally { - out.close(); - } - } catch (final IOException e) { - log.error("Cannot write file '" + dfile.getAbsolutePath() + "'!"); - } - } - return spells.size(); - } - } // class Spells Added: trunk/src/app/net/sf/gridarta/spells/SpellsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/spells/SpellsUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/spells/SpellsUtils.java 2008-08-21 22:03:05 UTC (rev 4969) @@ -0,0 +1,190 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 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.spells; + +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.util.filter.file.FilenameFileFilter; +import net.sf.gridarta.io.IOUtils; +import javax.swing.filechooser.FileFilter; +import javax.swing.JFileChooser; +import java.awt.Component; +import java.io.File; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileNotFoundException; +import java.io.EOFException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.OutputStreamWriter; +import java.io.FileOutputStream; +import java.util.Map; +import java.util.TreeMap; +import java.util.Date; + +/** + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class SpellsUtils { + + /** The Logger for printing log messages. */ + private static final Logger log = Logger.getLogger(SpellsUtils.class); + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** File filter for filtering spellist.h files. */ + private static final FileFilter SPELLIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", "spellist.h"); + + /** + * The spell file name. + */ + @NotNull + private String spellFile; + + /** + * Creates a new instance. + * @param spellFile the spell file name + */ + public SpellsUtils(@NotNull final String spellFile) { + this.spellFile = spellFile; + } + + /** + * Opens a file chooser to select the spellist file, then import spells. + * @param baseDir the directory to use + * @param parent Component the parent component for dialog boxes + */ + public void importSpellsWanted(@NotNull final String baseDir, @NotNull final Component parent) { + // open a file chooser window + final JFileChooser fileChooser = new JFileChooser(); + fileChooser.setDialogTitle("Open CF Spellist File"); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + fileChooser.setMultiSelectionEnabled(false); + fileChooser.setFileFilter(SPELLIST_H_FILE_FILTER); // apply file filter + final File cd = new File(System.getProperty("user.dir")); + final File sd = new File(cd, "../server/src/include"); + fileChooser.setCurrentDirectory(sd.exists() ? sd : cd); + + final int returnVal = fileChooser.showOpenDialog(parent); + + if (returnVal == JFileChooser.APPROVE_OPTION) { + // now import spells from selected file + final File spellfile = fileChooser.getSelectedFile(); + final int spnum = importSpells(spellfile, baseDir); + if (spnum > 0) { + // yeah it worked + ACTION_FACTORY.showMessageDialog(parent, "importSpellsSuccess", spnum); + } else { + // spell collect failed + ACTION_FACTORY.showMessageDialog(parent, "importSpellsFailed"); + } + } + } + + /** + * Read all spells from a Crossfire or Daimonin spellist file and write an + * alphabetical list into "spells.def". + * @param spellfile spellfile to read + * @param baseDir The base directory to load the spells file from. + * @return number of successfully collected spells + */ + private int importSpells(final File spellfile, final String baseDir) { + final Map<String, String> spells = new TreeMap<String, String>(); + if (spellfile.getName().equalsIgnoreCase("spellist.h")) { + try { + final BufferedReader in = new BufferedReader(new FileReader(spellfile.getAbsolutePath())); + try { + IOUtils.readUntil(in, "spell spells", null); + IOUtils.readUntil(in, "{", null); + + int counter = 0; + for (; ;) { + IOUtils.readUntil(in, "{", "}"); + IOUtils.readUntil(in, "\"", null); + final String name = IOUtils.readUntil(in, "\"").trim(); + IOUtils.readUntil(in, "}", null); + + spells.put(name, Integer.toString(counter++)); + } + } finally { + in.close(); + } + } catch (final FileNotFoundException e) { + log.error("File '" + spellfile.getAbsolutePath() + "' not found!"); + } catch (final EOFException e) { + // Eventually expected exception, don't handle. + } catch (final IOException e) { + log.error("Cannot read file '" + spellfile.getAbsolutePath() + "'!"); + } + } + + // --------- now write the "spells.def" file --------- + if (!spells.isEmpty()) { + // FIXME: This should use DOM for writing the file. + final File dfile; + // create new file for writing (replaces old one if existent) + if (baseDir.length() > 0) { + final File dir = new File(baseDir); + if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! + // create the config dir + new File("resource").mkdir(); + new File(baseDir).mkdir(); + } + dfile = new File(baseDir, spellFile); + } else { + dfile = new File(spellFile); + } + + try { + final PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(dfile), "utf-8")); + try { + // header: + out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); + out.println("<!DOCTYPE spells SYSTEM \"spells.dtd\">"); + out.println("<!--"); + out.println(" - ##########################################################"); + out.println(" - # You may add new spells to this file, but there's no #"); + out.println(" - # need to do it because the file can be autogenerated. #"); + out.println(" - # In the editor, select menu \"Resources->Collect Spells\" #"); + out.println(" - # to generate a new version of this file. #"); + out.println(" - ##########################################################"); + out.println(" -->"); + out.println("<!-- Generated on: " + new Date() + " -->"); + out.println("<spells>"); + + final String[] spaces = {" ", " ", ""}; + for (final String name : spells.keySet()) { + final String id = spells.get(name); + out.println(" <spell id=\"" + id + '\"' + spaces[id.length() - 1] + " name=\"" + name + "\" />"); + } + out.println("</spells>"); + } finally { + out.close(); + } + } catch (final IOException e) { + log.error("Cannot write file '" + dfile.getAbsolutePath() + "'!"); + } + } + return spells.size(); + } + +} // class SpellsUtils Property changes on: trunk/src/app/net/sf/gridarta/spells/SpellsUtils.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...> - 2008-08-21 22:07:12
|
Revision: 4970 http://gridarta.svn.sourceforge.net/gridarta/?rev=4970&view=rev Author: akirschbaum Date: 2008-08-21 22:07:18 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Remove empty classes Spells. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/src/app/net/sf/gridarta/spells/Spells.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/spells/Spells.java trunk/daimonin/src/daieditor/spells/Spells.java Deleted: trunk/crossfire/src/cfeditor/spells/Spells.java =================================================================== --- trunk/crossfire/src/cfeditor/spells/Spells.java 2008-08-21 22:03:05 UTC (rev 4969) +++ trunk/crossfire/src/cfeditor/spells/Spells.java 2008-08-21 22:07:18 UTC (rev 4970) @@ -1,34 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 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 cfeditor.spells; - -import cfeditor.gameobject.Archetype; -import cfeditor.gameobject.GameObject; -import cfeditor.map.MapArchObject; -import net.sf.gridarta.spells.GameObjectSpell; - -/** - * This class manages the spells and spell lists. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo move spell related stuff from CFArchTypeList to this class. - */ -public final class Spells extends net.sf.gridarta.spells.Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> { - -} // class Spells Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:03:05 UTC (rev 4969) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:07:18 UTC (rev 4970) @@ -39,7 +39,6 @@ import daieditor.map.validation.checks.ExitChecker; import daieditor.map.validation.checks.SlayingChecker; import daieditor.map.validation.checks.TilePathsChecker; -import net.sf.gridarta.spells.SpellsUtils; import java.awt.Point; import java.io.BufferedReader; import java.io.File; @@ -111,6 +110,9 @@ import net.sf.gridarta.map.validation.checks.SysObjectNotOnLayerZeroChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; +import net.sf.gridarta.spells.NumberSpell; +import net.sf.gridarta.spells.Spells; +import net.sf.gridarta.spells.SpellsUtils; import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; @@ -175,7 +177,7 @@ private int alphaType; /** The Spells. */ - private final daieditor.spells.Spells numberSpells = new daieditor.spells.Spells(); + private final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); /** Whether to display double arches like stacked walls in stacked version. */ private boolean drawDouble; Deleted: trunk/daimonin/src/daieditor/spells/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 22:03:05 UTC (rev 4969) +++ trunk/daimonin/src/daieditor/spells/Spells.java 2008-08-21 22:07:18 UTC (rev 4970) @@ -1,31 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 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 daieditor.spells; - -import net.sf.gridarta.spells.NumberSpell; - -/** - * This class manages the spells and spell lists. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo move spell related stuff from CFArchTypeList to this class. - */ -public final class Spells extends net.sf.gridarta.spells.Spells<NumberSpell> { - -} // class Spells Modified: trunk/src/app/net/sf/gridarta/spells/Spells.java =================================================================== --- trunk/src/app/net/sf/gridarta/spells/Spells.java 2008-08-21 22:03:05 UTC (rev 4969) +++ trunk/src/app/net/sf/gridarta/spells/Spells.java 2008-08-21 22:07:18 UTC (rev 4970) @@ -29,6 +29,7 @@ /** * Common base class for spells and spell lists. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo move spell related stuff from CFArchTypeList to this class. */ public class Spells<S extends Spell> implements Iterable<S> { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:11:42
|
Revision: 4971 http://gridarta.svn.sourceforge.net/gridarta/?rev=4971&view=rev Author: akirschbaum Date: 2008-08-21 22:11:50 +0000 (Thu, 21 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-21 22:07:18 UTC (rev 4970) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) @@ -92,8 +92,6 @@ import net.sf.gridarta.map.validation.checks.MapDifficultyChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; -import net.sf.gridarta.spells.NumberSpell; -import net.sf.gridarta.spells.Spells; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.treasurelist.TreasureListsParser; @@ -131,9 +129,6 @@ /** Preferences default value for using System.exit(). */ public static final boolean PREFS_SYSTEM_EXIT_DEFAULT = true; - /** The Spells. */ - private final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); - /** The current script controller. */ private final ScriptController scriptControl; @@ -158,10 +153,8 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - // load the list with archtype-data from "types.xml" - numberSpells.sort(); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); gameObjectMatchers.readGameObjectMatchers(filename); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:07:18 UTC (rev 4970) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) @@ -110,10 +110,7 @@ import net.sf.gridarta.map.validation.checks.SysObjectNotOnLayerZeroChecker; import net.sf.gridarta.map.validation.checks.UndefinedArchetypeChecker; import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; -import net.sf.gridarta.spells.NumberSpell; -import net.sf.gridarta.spells.Spells; import net.sf.gridarta.spells.SpellsUtils; -import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.treasurelist.TreasureListsParser; @@ -176,9 +173,6 @@ /** Bit field of edit types to show transparent. */ private int alphaType; - /** The Spells. */ - private final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); - /** Whether to display double arches like stacked walls in stacked version. */ private boolean drawDouble; @@ -221,11 +215,8 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - // load the list with archtype-data from "types.xml" - XMLSpellLoader.load(getConfigurationDirectory(), IGUIConstants.SPELL_FILE, xmlHelper.getDocumentBuilder(), numberSpells); - numberSpells.sort(); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); gameObjectMatchers.readGameObjectMatchers(filename); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:07:18 UTC (rev 4970) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) @@ -72,7 +72,9 @@ import net.sf.gridarta.map.validation.DelegatingMapValidator; import net.sf.gridarta.spells.ArchetypeSetSpellLoader; import net.sf.gridarta.spells.GameObjectSpell; +import net.sf.gridarta.spells.NumberSpell; import net.sf.gridarta.spells.Spells; +import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.updater.UpdaterManager; import net.sf.japi.swing.ActionFactory; @@ -247,6 +249,12 @@ protected final Spells<GameObjectSpell<G, A, R>> gameObjectSpells = new Spells<GameObjectSpell<G, A, R>>(); /** + * The Spells. + */ + @NotNull + protected final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); + + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory * @param rendererFactory the renderer factory @@ -265,8 +273,10 @@ * @param scriptExtension the file extension for script files * @param spellType the object id for spell objects or <code>0</code> to * not collect game objects spells + * @param spellFile the spell file name to load or <code>null</code> to not + * load numbered spells */ - 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType) { + 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType, @Nullable final String spellFile) { this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -322,6 +332,10 @@ new ArchetypeSetSpellLoader<G, A, R>().load(archetypeSet, spellType, gameObjectSpells); gameObjectSpells.sort(); } + if (spellFile != null) { + XMLSpellLoader.load(getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); + numberSpells.sort(); + } } /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:07:18 UTC (rev 4970) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:11:50 UTC (rev 4971) @@ -434,7 +434,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, null, "test.jar", new TestFileFilter(), ".script", 0); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script", 0, null); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:14:44
|
Revision: 4972 http://gridarta.svn.sourceforge.net/gridarta/?rev=4972&view=rev Author: akirschbaum Date: 2008-08-21 22:14:53 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) @@ -62,7 +62,6 @@ import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; @@ -155,24 +154,6 @@ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - try { - final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); - gameObjectMatchers.readGameObjectMatchers(filename); - } catch (final FileNotFoundException ex) { - log.error("Cannot read GameObjectMatchers.xml: " + ex.getMessage()); - } - GameObjectMatchersInstance.setInstance(gameObjectMatchers); - final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("floor"); - final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("wall"); - final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcher("monster"); - if (monsterMatcher == null) { - log.fatal("GameObjectMatcher 'monster' does not exist"); - throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); - } - final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcher("below_floor"); - if (belowFloorMatcher == null) { - log.warn("GameObjectMatcher 'below_floor' does not exist"); - } DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcher("exit"); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) @@ -67,7 +67,6 @@ import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.match.GameObjectMatcher; -import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; @@ -217,24 +216,6 @@ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - try { - final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); - gameObjectMatchers.readGameObjectMatchers(filename); - } catch (final FileNotFoundException ex) { - log.error("Cannot read GameObjectMatchers.xml: " + ex.getMessage()); - } - GameObjectMatchersInstance.setInstance(gameObjectMatchers); - final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("floor"); - final GameObjectMatcher wallMatcher = gameObjectMatchers.getMatcher("wall"); - final GameObjectMatcher monsterMatcher = gameObjectMatchers.getMatcher("monster"); - if (monsterMatcher == null) { - log.fatal("GameObjectMatcher 'monster' does not exist"); - throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); - } - final GameObjectMatcher belowFloorMatcher = gameObjectMatchers.getMatcher("below_floor"); - if (belowFloorMatcher == null) { - log.warn("GameObjectMatcher 'below_floor' does not exist"); - } DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcher("exit"); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:11:50 UTC (rev 4971) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) @@ -20,6 +20,7 @@ package net.sf.gridarta; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.MissingResourceException; import java.util.ResourceBundle; @@ -36,7 +37,9 @@ import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gameobject.face.FaceObjects; +import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gameobject.match.GameObjectMatchers; +import net.sf.gridarta.gameobject.match.GameObjectMatchersInstance; import net.sf.gridarta.gameobject.scripts.ScriptedEvent; import net.sf.gridarta.gameobject.scripts.ScriptedEventEditor; import net.sf.gridarta.gui.About; @@ -65,6 +68,7 @@ import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.gui.undo.UndoControl; import net.sf.gridarta.help.Help; +import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.io.PathManager; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; @@ -254,6 +258,18 @@ @NotNull protected final Spells<NumberSpell> numberSpells = new Spells<NumberSpell>(); + @NotNull + protected final GameObjectMatcher floorMatcher; + + @NotNull + protected final GameObjectMatcher wallMatcher; + + @NotNull + protected final GameObjectMatcher monsterMatcher; + + @NotNull + protected final GameObjectMatcher belowFloorMatcher; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -336,6 +352,24 @@ XMLSpellLoader.load(getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); numberSpells.sort(); } + try { + final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), "GameObjectMatchers.xml"); + gameObjectMatchers.readGameObjectMatchers(filename); + } catch (final FileNotFoundException ex) { + log.error("Cannot read GameObjectMatchers.xml: " + ex.getMessage()); + } + GameObjectMatchersInstance.setInstance(gameObjectMatchers); + floorMatcher = gameObjectMatchers.getMatcher("floor"); + wallMatcher = gameObjectMatchers.getMatcher("wall"); + monsterMatcher = gameObjectMatchers.getMatcher("monster"); + if (monsterMatcher == null) { + log.fatal("GameObjectMatcher 'monster' does not exist"); + throw new MissingResourceException("GameObjectMatcher 'monster' does not exist", null, null); + } + belowFloorMatcher = gameObjectMatchers.getMatcher("below_floor"); + if (belowFloorMatcher == null) { + log.warn("GameObjectMatcher 'below_floor' does not exist"); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:16:52
|
Revision: 4973 http://gridarta.svn.sourceforge.net/gridarta/?rev=4973&view=rev Author: akirschbaum Date: 2008-08-21 22:17:00 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:17:00 UTC (rev 4973) @@ -47,7 +47,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.MissingResourceException; import javax.swing.JMenu; import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; @@ -61,7 +60,6 @@ import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; -import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.LeftPanel; import net.sf.gridarta.gui.MainView; @@ -70,7 +68,6 @@ import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.map.MapView; -import net.sf.gridarta.gui.map.tools.DeletionTool; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchoicedisplay.ObjectChoiceDisplay; @@ -80,7 +77,6 @@ import net.sf.gridarta.gui.prefs.UpdatePrefs; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.map.AutoValidator; -import net.sf.gridarta.map.InsertionMode; import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.validation.DelegatingMapValidator; import net.sf.gridarta.map.validation.checks.AttributeRangeChecker; @@ -154,13 +150,6 @@ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); - InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); - final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcher("exit"); - if (exitMatcher == null) { - log.fatal("GameObjectMatcher 'exit' does not exist"); - throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); - } final MapActions mapActions = new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); archetypeTypeSet.getListTable().put("event", ScriptArchUtils.getEventTypes()); Map<String, TreasureTreeNode> specialTreasureLists; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:17:00 UTC (rev 4973) @@ -50,7 +50,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import java.util.MissingResourceException; import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -66,7 +65,6 @@ import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.FaceObjectProviders; -import net.sf.gridarta.gameobject.match.GameObjectMatcher; import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; @@ -77,7 +75,6 @@ import net.sf.gridarta.gui.connectionview.LockedItemsControl; import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesModel; import net.sf.gridarta.gui.map.MapView; -import net.sf.gridarta.gui.map.tools.DeletionTool; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchoicedisplay.ObjectChoiceDisplay; @@ -88,7 +85,6 @@ import net.sf.gridarta.gui.utils.GUIUtils; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.map.AutoValidator; -import net.sf.gridarta.map.InsertionMode; import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; @@ -216,13 +212,6 @@ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); - InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); - final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcher("exit"); - if (exitMatcher == null) { - log.fatal("GameObjectMatcher 'exit' does not exist"); - throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); - } final MapActions mapActions = new MapActions(mainView, mainView, gridartaObjectsFactory, (GlobalSettingsImpl) globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); Map<String, TreasureTreeNode> specialTreasureLists; try { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:14:53 UTC (rev 4972) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:17:00 UTC (rev 4973) @@ -61,6 +61,7 @@ import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; import net.sf.gridarta.gui.map.RendererFactory; +import net.sf.gridarta.gui.map.tools.DeletionTool; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.objectchooser.DefaultObjectChooser; import net.sf.gridarta.gui.pickmapchooser.PickmapChooserControl; @@ -70,6 +71,7 @@ import net.sf.gridarta.help.Help; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.io.PathManager; +import net.sf.gridarta.map.InsertionMode; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapControlFactory; @@ -270,6 +272,9 @@ @NotNull protected final GameObjectMatcher belowFloorMatcher; + @NotNull + protected final GameObjectMatcher exitMatcher; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -370,6 +375,13 @@ if (belowFloorMatcher == null) { log.warn("GameObjectMatcher 'below_floor' does not exist"); } + DeletionTool.init(floorMatcher, wallMatcher, monsterMatcher); + InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); + exitMatcher = gameObjectMatchers.getMatcher("exit"); + if (exitMatcher == null) { + log.fatal("GameObjectMatcher 'exit' does not exist"); + throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:24:50
|
Revision: 4974 http://gridarta.svn.sourceforge.net/gridarta/?rev=4974&view=rev Author: akirschbaum Date: 2008-08-21 22:24:57 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java trunk/daimonin/src/daieditor/GlobalSettingsImpl.java trunk/daimonin/src/daieditor/MapActions.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/GlobalSettings.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java =================================================================== --- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -69,6 +69,12 @@ } /** {@inheritDoc} */ + @NotNull + public String getMediaDefaultFolder() { + throw new AssertionError("not implemented"); + } + + /** {@inheritDoc} */ public void readGlobalSettings() { imageSet = prefs.get(USE_IMAGESET, "base"); if (imageSet.equalsIgnoreCase("none")) { Modified: trunk/daimonin/src/daieditor/GlobalSettingsImpl.java =================================================================== --- trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -44,6 +44,8 @@ /** Time for an automated docu popup. */ private boolean autoPopupDocu = false; + /** {@inheritDoc} */ + @NotNull public String getMediaDefaultFolder() { return mediaDir; } Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -37,6 +37,7 @@ import javax.swing.filechooser.FileFilter; import net.sf.gridarta.CommonConstants; import net.sf.gridarta.CurrentMapListener; +import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; @@ -119,7 +120,7 @@ /** The global settings instance. */ @NotNull - private final GlobalSettingsImpl globalSettings; + private final GlobalSettings globalSettings; /** The map manager. */ private final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager; Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -19,7 +19,6 @@ package daieditor.gui.map; -import daieditor.GlobalSettingsImpl; import daieditor.gameobject.Archetype; import daieditor.gameobject.GameObject; import daieditor.map.MapArchObject; @@ -51,6 +50,7 @@ import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; import net.sf.gridarta.Size2D; @@ -86,7 +86,7 @@ * The global settings instance. */ @NotNull - private final GlobalSettingsImpl globalSettings; + private final GlobalSettings globalSettings; private final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl; @@ -166,7 +166,7 @@ * @param mapControl The level whose properties are shown/edited. * @param mapFileFilter the Swing file filter to use */ - private MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<?, MapArchObject, ?, ?> mapManager, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettingsImpl globalSettings, final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl, final FileFilter mapFileFilter) { + private MapPropertiesDialog(@NotNull final JFrame helpParent, @NotNull final MapManager<?, MapArchObject, ?, ?> mapManager, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettings globalSettings, final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl, final FileFilter mapFileFilter) { okButton.setDefaultCapable(true); setOptions(new Object[] {helpButton, okButton, restoreButton, cancelButton}); @@ -571,7 +571,7 @@ * @param level map to show dialog about * @param mapFileFilter the Swing file filter to use */ - public static void showDialog(final Component parent, final JFrame helpParent, @NotNull final MapManager<?, MapArchObject, ?, ?> mapManager, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettingsImpl globalSettings, final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> level, final FileFilter mapFileFilter) { + public static void showDialog(final Component parent, final JFrame helpParent, @NotNull final MapManager<?, MapArchObject, ?, ?> mapManager, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettings globalSettings, final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> level, final FileFilter mapFileFilter) { final MapPropertiesDialog pane = new MapPropertiesDialog(helpParent, mapManager, gridartaObjectsFactory, globalSettings, level, mapFileFilter); final JDialog dialog = pane.createDialog(parent, ACTION_FACTORY.format("mapTitle", level.getMapModel().getMapArchObject().getMapDisplayName(), level.getMapFileName())); pane.dialog = dialog; Modified: trunk/src/app/net/sf/gridarta/GlobalSettings.java =================================================================== --- trunk/src/app/net/sf/gridarta/GlobalSettings.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/src/app/net/sf/gridarta/GlobalSettings.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -85,4 +85,7 @@ @NotNull File getPickmapDir(); + @NotNull + String getMediaDefaultFolder(); + } // interface GlobalSettings Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:17:00 UTC (rev 4973) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:24:57 UTC (rev 4974) @@ -994,6 +994,12 @@ throw new AssertionError(); } + /** {@inheritDoc} */ + @NotNull + public String getMediaDefaultFolder() { + throw new AssertionError(); + } + } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:36:46
|
Revision: 4975 http://gridarta.svn.sourceforge.net/gridarta/?rev=4975&view=rev Author: akirschbaum Date: 2008-08-21 22:36:51 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/MapActions.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/MapActions.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/MapActions.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-21 22:24:57 UTC (rev 4974) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -149,9 +149,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - - final MapActions mapActions = new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); - archetypeTypeSet.getListTable().put("event", ScriptArchUtils.getEventTypes()); Map<String, TreasureTreeNode> specialTreasureLists; try { final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(getConfigurationDirectory(), "TreasureLists.xml")); @@ -252,6 +249,14 @@ /** {@inheritDoc} */ @NotNull @Override + protected MapActions init1() { + archetypeTypeSet.getListTable().put("event", ScriptArchUtils.getEventTypes()); + return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators = new DelegatingMapValidator<GameObject, MapArchObject, Archetype>(); final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker = new AttributeRangeChecker<GameObject, MapArchObject, Archetype>(); Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -198,7 +198,7 @@ updateActions(); } - /** Set the state of all actions. */ + /** {@inheritDoc} */ public void updateMenuState() { aAutoJoin.setSelected(autoJoin); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -211,8 +211,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - - final MapActions mapActions = new MapActions(mainView, mainView, gridartaObjectsFactory, (GlobalSettingsImpl) globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); Map<String, TreasureTreeNode> specialTreasureLists; try { final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(getConfigurationDirectory(), "TreasureLists.xml")); @@ -331,6 +329,13 @@ /** {@inheritDoc} */ @NotNull @Override + protected MapActions init1() { + return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected DelegatingMapValidator<GameObject, MapArchObject, Archetype> createMapValidators() { final DelegatingMapValidator<GameObject, MapArchObject, Archetype> mapValidators = new DelegatingMapValidator<GameObject, MapArchObject, Archetype>(); final CustomTypeChecker<GameObject, MapArchObject, Archetype> customTypeChecker = new CustomTypeChecker<GameObject, MapArchObject, Archetype>(); Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -152,7 +152,7 @@ * @param mapFileFilter the Swing file filter to use * @param selectedSquareView the selected square vuew to use */ - public MapActions(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettingsImpl globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, final GameObjectMatcher exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { + public MapActions(@NotNull final Component parent, @NotNull final JFrame helpParent, @NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, final GameObjectMatcher exitMatcher, final FileFilter mapFileFilter, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { this.parent = parent; this.helpParent = helpParent; this.gridartaObjectsFactory = gridartaObjectsFactory; @@ -194,7 +194,7 @@ updateActions(); } - /** Set the state of all actions. */ + /** {@inheritDoc} */ public void updateMenuState() { aAutoJoin.setSelected(autoJoin); } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -134,6 +134,12 @@ /** Swing FileFilter for all unignored files. */ public static final FileFilter unignoredFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.unignored"), "")); + /** + * The gridarta objects factory. + */ + @NotNull + protected final GridartaObjectsFactory<G, A, R, V> gridartaObjectsFactory; + /** The map control factory. */ protected final MapControlFactory<G, A, R, V> mapControlFactory; @@ -275,6 +281,9 @@ @NotNull protected final GameObjectMatcher exitMatcher; + @NotNull + protected final MapActions mapActions; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -298,6 +307,7 @@ * load numbered spells */ 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType, @Nullable final String spellFile) { + this.gridartaObjectsFactory = gridartaObjectsFactory; this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; final DefaultMapManager<G, A, R, V> tmpMapManager = new DefaultMapManager<G, A, R, V>(this, key, gridartaObjectsFactory, mapControlFactory, globalSettings); @@ -382,8 +392,12 @@ log.fatal("GameObjectMatcher 'exit' does not exist"); throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); } + mapActions = init1(); } + @NotNull + protected abstract MapActions init1(); + /** * Initializes the map validators. * @return A MapValidator that delegates to other map validators. Modified: trunk/src/app/net/sf/gridarta/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/MapActions.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/src/app/net/sf/gridarta/MapActions.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -32,4 +32,9 @@ */ boolean isAutoJoin(); + /** + * Sets the state of all actions. + */ + void updateMenuState(); + } // interface MapActions Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:24:57 UTC (rev 4974) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:36:51 UTC (rev 4975) @@ -496,6 +496,13 @@ /** {@inheritDoc} */ @NotNull @Override + protected MapActions init1() { + throw new AssertionError(); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected DelegatingMapValidator<TestGameObject, TestMapArchObject, TestArchetype> createMapValidators() { throw new AssertionError(); } @@ -966,6 +973,11 @@ return false; } + /** {@inheritDoc} */ + public void updateMenuState() { + throw new AssertionError(); + } + } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:39:08
|
Revision: 4976 http://gridarta.svn.sourceforge.net/gridarta/?rev=4976&view=rev Author: akirschbaum Date: 2008-08-21 22:39:16 +0000 (Thu, 21 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:39:16 UTC (rev 4976) @@ -44,9 +44,7 @@ import java.io.FileReader; import java.io.IOException; import java.lang.reflect.InvocationTargetException; -import java.util.Collections; import java.util.List; -import java.util.Map; import javax.swing.JMenu; import javax.swing.SwingUtilities; import net.sf.gridarta.AbstractMainControl; @@ -89,9 +87,7 @@ import net.sf.gridarta.map.validation.checks.UnsetSlayingChecker; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; -import net.sf.gridarta.treasurelist.TreasureListsParser; import net.sf.gridarta.treasurelist.TreasureLocation; -import net.sf.gridarta.treasurelist.TreasureTreeNode; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.prefs.PreferencesGroup; @@ -99,8 +95,6 @@ import net.sf.japi.util.ThrowableHandler; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; /** * The main controller of the level editor. Basically the main application. @@ -149,17 +143,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - Map<String, TreasureTreeNode> specialTreasureLists; - try { - final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(getConfigurationDirectory(), "TreasureLists.xml")); - specialTreasureLists = TreasureListsParser.parseTreasureLists(specialTreasureListsDocument); - } catch (final IOException ex) { - log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } catch (final SAXException ex) { - log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } treasureListTree = new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE) ); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:39:16 UTC (rev 4976) @@ -47,9 +47,7 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.Map; import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -108,9 +106,7 @@ import net.sf.gridarta.spells.SpellsUtils; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; import net.sf.gridarta.treasurelist.CFTreasureListTree; -import net.sf.gridarta.treasurelist.TreasureListsParser; import net.sf.gridarta.treasurelist.TreasureLocation; -import net.sf.gridarta.treasurelist.TreasureTreeNode; import net.sf.japi.io.args.ArgParser; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; @@ -122,8 +118,6 @@ import net.sf.japi.util.filter.file.GlobFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; /** * The main controller of the level editor. Basically the main application. @@ -211,17 +205,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - Map<String, TreasureTreeNode> specialTreasureLists; - try { - final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(getConfigurationDirectory(), "TreasureLists.xml")); - specialTreasureLists = TreasureListsParser.parseTreasureLists(specialTreasureListsDocument); - } catch (final IOException ex) { - log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } catch (final SAXException ex) { - log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); - specialTreasureLists = Collections.emptyMap(); - } treasureListTree = new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE), new TreasureLocation(globalSettings.getMapDefaultFolder(), null) Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:36:51 UTC (rev 4975) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:39:16 UTC (rev 4976) @@ -22,6 +22,8 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.util.Collections; +import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.prefs.Preferences; @@ -82,6 +84,8 @@ import net.sf.gridarta.spells.Spells; import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; +import net.sf.gridarta.treasurelist.TreasureListsParser; +import net.sf.gridarta.treasurelist.TreasureTreeNode; import net.sf.gridarta.updater.UpdaterManager; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ActionMethod; @@ -90,6 +94,8 @@ import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; /** * MainControl is a central class that's used for access on global data @@ -284,6 +290,9 @@ @NotNull protected final MapActions mapActions; + @NotNull + protected Map<String, TreasureTreeNode> specialTreasureLists; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -393,6 +402,16 @@ throw new MissingResourceException("GameObjectMatcher 'exit' does not exist", null, null); } mapActions = init1(); + try { + final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(getConfigurationDirectory(), "TreasureLists.xml")); + specialTreasureLists = TreasureListsParser.parseTreasureLists(specialTreasureListsDocument); + } catch (final IOException ex) { + log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); + specialTreasureLists = Collections.emptyMap(); + } catch (final SAXException ex) { + log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); + specialTreasureLists = Collections.emptyMap(); + } } @NotNull This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 22:43:18
|
Revision: 4977 http://gridarta.svn.sourceforge.net/gridarta/?rev=4977&view=rev Author: akirschbaum Date: 2008-08-21 22:43:26 +0000 (Thu, 21 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-21 22:39:16 UTC (rev 4976) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-21 22:43:26 UTC (rev 4977) @@ -124,9 +124,6 @@ /** Preferences default for auto validation. */ private static final boolean PREFS_VALIDATOR_AUTO_DEFAULT = true; - /** The treasure lists. */ - private final CFTreasureListTree<GameObject, MapArchObject, Archetype> treasureListTree; - @NotNull private final GameObjectAttributesControl gameObjectAttributesControl; @@ -143,9 +140,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - treasureListTree = new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, - new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE) - ); final ArchetypeAttributeParser<GameObject, MapArchObject, Archetype> archetypeAttributeParser = new ArchetypeAttributeParser<GameObject, MapArchObject, Archetype>(Archetype.TYPE_EVENT_CONNECTOR, false, globalSettings, mapFileFilter, pythonFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, 0, archetypeTypeSet, treasureListTree); final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); @@ -232,6 +226,15 @@ /** {@inheritDoc} */ @NotNull @Override + protected CFTreasureListTree<GameObject, MapArchObject, Archetype> createTreasureListTree() { + return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, + new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE) + ); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected MapActions init1() { archetypeTypeSet.getListTable().put("event", ScriptArchUtils.getEventTypes()); return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:39:16 UTC (rev 4976) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 22:43:26 UTC (rev 4977) @@ -186,9 +186,6 @@ /** The ViewGameObjectMatcherManager for alpha. */ private final ViewGameObjectMatcherManager vaommAlpha = new ViewGameObjectMatcherManager(moaomAlpha); - /** The treasure lists. */ - private final CFTreasureListTree<GameObject, MapArchObject, Archetype> treasureListTree; - @NotNull private final GameObjectAttributesControl gameObjectAttributesControl; @@ -205,10 +202,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - treasureListTree = new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, - new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE), - new TreasureLocation(globalSettings.getMapDefaultFolder(), null) - ); final ArchetypeAttributeParser<GameObject, MapArchObject, Archetype> archetypeAttributeParser = new ArchetypeAttributeParser<GameObject, MapArchObject, Archetype>(0, true, globalSettings, mapFileFilter, luaFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, -1, archetypeTypeSet, treasureListTree); final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); @@ -312,6 +305,16 @@ /** {@inheritDoc} */ @NotNull @Override + protected CFTreasureListTree<GameObject, MapArchObject, Archetype> createTreasureListTree() { + return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(mainView, archetypeSet, specialTreasureLists, + new TreasureLocation(getCollectedDirectory(), IGUIConstants.TREASURES_FILE), + new TreasureLocation(globalSettings.getMapDefaultFolder(), null) + ); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected MapActions init1() { return new MapActions(mainView, mainView, gridartaObjectsFactory, globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView); } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:39:16 UTC (rev 4976) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 22:43:26 UTC (rev 4977) @@ -84,6 +84,7 @@ import net.sf.gridarta.spells.Spells; import net.sf.gridarta.spells.XMLSpellLoader; import net.sf.gridarta.textedit.scripteditor.ScriptEditControlInstance; +import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.treasurelist.TreasureListsParser; import net.sf.gridarta.treasurelist.TreasureTreeNode; import net.sf.gridarta.updater.UpdaterManager; @@ -293,6 +294,10 @@ @NotNull protected Map<String, TreasureTreeNode> specialTreasureLists; + /** The treasure lists. */ + @NotNull + protected final CFTreasureListTree<G, A, R> treasureListTree; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -412,9 +417,13 @@ log.warn("Cannot read TreasureLists.xml: " + ex.getMessage()); specialTreasureLists = Collections.emptyMap(); } + treasureListTree = createTreasureListTree(); } @NotNull + protected abstract CFTreasureListTree<G, A, R> createTreasureListTree(); + + @NotNull protected abstract MapActions init1(); /** Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:39:16 UTC (rev 4976) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 22:43:26 UTC (rev 4977) @@ -46,6 +46,7 @@ import net.sf.gridarta.MapImageCache; import net.sf.gridarta.MapManager; import net.sf.gridarta.Size2D; +import net.sf.gridarta.treasurelist.CFTreasureListTree; import net.sf.gridarta.data.NamedTreeNode; import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.AbstractArchetypeSet; @@ -496,6 +497,13 @@ /** {@inheritDoc} */ @NotNull @Override + protected CFTreasureListTree<TestGameObject, TestMapArchObject, TestArchetype> createTreasureListTree() { + throw new AssertionError(); + } + + /** {@inheritDoc} */ + @NotNull + @Override protected MapActions init1() { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-21 23:04:13
|
Revision: 4978 http://gridarta.svn.sourceforge.net/gridarta/?rev=4978&view=rev Author: akirschbaum Date: 2008-08-21 23:04:21 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/MapActions.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -60,7 +60,7 @@ /** The archetype set. */ @NotNull - private final ArchetypeSet<?, ?, Archetype> archetypeSet; + private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; /** The archetype chooser to add parsed archetypes to. */ private final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl; @@ -74,7 +74,7 @@ * @param animationObjects the animation objects instance to use * @param archetypeSet the archetype set */ - public ArchetypeParser(final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet<?, ?, Archetype> archetypeSet) { + public ArchetypeParser(final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory, final ArchetypeChooserControl<GameObject, MapArchObject, Archetype, CMapViewBasic> archetypeChooserControl, final AnimationObjects<?> animationObjects, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.archetypeChooserControl = archetypeChooserControl; this.animationObjects = animationObjects; @@ -254,7 +254,7 @@ archetype.addObjectText(thisLine); final String animName = thisLine.substring(10).trim(); archetype.setAnimName(animName); - //arch.setAnimNr(mainControl.animationObjects.findAnimObject(animName)); // probably not needed, but better not delete it yet + //arch.setAnimNr(animationObjects.findAnimObject(animName)); // probably not needed, but better not delete it yet } else if (thisLine.equals("anim")) { animflag = true; animText = new StringBuilder(); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -78,6 +78,8 @@ @NotNull private final GlobalSettings globalSettings; + /** The edit types instance. */ + @NotNull private final EditTypes<GameObject, MapArchObject, Archetype, CMapViewBasic> editTypes; @NotNull @@ -96,7 +98,7 @@ /** * Create the ArchetypeSet. * @param mainControl reference to CMainControl - * @param globalSettings the global settigns instance + * @param globalSettings the global settings instance * @param editTypes the edit types instance * @param animationObjects the animations to use * @param faceObjects the FaceObjects instance to use Modified: trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -58,7 +58,7 @@ /** Preferences. */ private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - /** The global settings instance to use. */ + /** The global settings instance. */ private final GlobalSettingsImpl globalSettings; /** TextField for arch directory path. */ @@ -81,7 +81,7 @@ /** * Create a ResPrefs pane. - * @param globalSettings the global settings instance to use + * @param globalSettings the global settings instance */ public ResPrefs(final GlobalSettingsImpl globalSettings) { setListLabelText(ACTION_FACTORY.getString("prefsRes.title")); Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -264,6 +264,7 @@ } } + /** {@inheritDoc} */ public boolean isAutoJoin() { return autoJoin; } Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -153,7 +153,7 @@ mapGrid.addMapGridListener(mapGridListener); } - /** @inheritDoc} */ + /** {@inheritDoc} */ @Override public void closeNotify() { mapGrid.removeMapGridListener(mapGridListener); @@ -249,6 +249,7 @@ return image; } + /** {@inheritDoc} */ @Override public void paintComponent(final Graphics g) { paintComponent2((Graphics2D) g); @@ -502,11 +503,13 @@ } /** {@inheritDoc} */ + @Override public void setErroneousArchObjects(final Map<GameObject, ValidationError<GameObject, MapArchObject, Archetype>> erroneousArchObjects) { //XXX: save erroneousArchObjects } /** {@inheritDoc} */ + @Override public void setErroneousMapSquares(final Map<MapSquare<GameObject, MapArchObject, Archetype>, ValidationError<GameObject, MapArchObject, Archetype>> erroneousMapSquares) { this.erroneousMapSquares = erroneousMapSquares; } Modified: trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2008-08-21 22:43:26 UTC (rev 4977) +++ trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2008-08-21 23:04:21 UTC (rev 4978) @@ -221,9 +221,10 @@ public void closeNotify() { } - /** @inheritDoc} */ + /** {@inheritDoc} */ @Override public Rectangle getTileBounds(final Point p) { throw new IllegalStateException(); } + } // class SimpleLevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-22 07:38:22
|
Revision: 4979 http://gridarta.svn.sourceforge.net/gridarta/?rev=4979&view=rev Author: akirschbaum Date: 2008-08-22 07:38:27 +0000 (Fri, 22 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-21 23:04:21 UTC (rev 4978) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) @@ -54,7 +54,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; @@ -139,8 +138,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null); - final ArchetypeAttributeParser<GameObject, MapArchObject, Archetype> archetypeAttributeParser = new ArchetypeAttributeParser<GameObject, MapArchObject, Archetype>(Archetype.TYPE_EVENT_CONNECTOR, false, globalSettings, mapFileFilter, pythonFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, 0, archetypeTypeSet, treasureListTree); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0); final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-21 23:04:21 UTC (rev 4978) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) @@ -58,7 +58,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; @@ -201,8 +200,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { - super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE); - final ArchetypeAttributeParser<GameObject, MapArchObject, Archetype> archetypeAttributeParser = new ArchetypeAttributeParser<GameObject, MapArchObject, Archetype>(0, true, globalSettings, mapFileFilter, luaFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, -1, archetypeTypeSet, treasureListTree); + super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1); final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-21 23:04:21 UTC (rev 4978) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) @@ -32,6 +32,7 @@ import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; +import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeSet; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.ArchetypeSet; @@ -298,6 +299,9 @@ @NotNull protected final CFTreasureListTree<G, A, R> treasureListTree; + @NotNull + protected final ArchetypeAttributeParser<G, A, R> archetypeAttributeParser; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -319,8 +323,11 @@ * not collect game objects spells * @param spellFile the spell file name to load or <code>null</code> to not * load numbered spells + * @param typeNoEventConnector the object type to event game objects + * @param includeFaceText whether face names are included in the object + * @param undefinedSpellIndex the index for no spell */ - 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType, @Nullable final String spellFile) { + 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, @NotNull final String gridartaJarFilename, @NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final int spellType, @Nullable final String spellFile, final int typeNoEventConnector, final boolean includeFaceText, final int undefinedSpellIndex) { this.gridartaObjectsFactory = gridartaObjectsFactory; this.globalSettings = globalSettings; this.mapControlFactory = mapControlFactory; @@ -418,6 +425,7 @@ specialTreasureLists = Collections.emptyMap(); } treasureListTree = createTreasureListTree(); + archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(typeNoEventConnector, includeFaceText, globalSettings, mapFileFilter, luaFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, undefinedSpellIndex, archetypeTypeSet, treasureListTree); } @NotNull Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-21 23:04:21 UTC (rev 4978) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-08-22 07:38:27 UTC (rev 4979) @@ -435,7 +435,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, null, "test.jar", new TestFileFilter(), ".script", 0, null); + super(gridartaObjectsFactory, rendererFactory, key, globalSettings, animationObjects, faceObjects, mapControlFactory, true, null, null, "test.jar", new TestFileFilter(), ".script", 0, null, -1, false, 0); } /** {@inheritDoc} */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-22 07:40:12
|
Revision: 4980 http://gridarta.svn.sourceforge.net/gridarta/?rev=4980&view=rev Author: akirschbaum Date: 2008-08-22 07:40:20 +0000 (Fri, 22 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) @@ -54,7 +54,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; @@ -139,7 +138,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0); - final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) @@ -58,7 +58,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.FaceObjectProviders; @@ -201,7 +200,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1); - final ArchetypeTypeParser<GameObject, MapArchObject, Archetype> archetypeTypeParser = new ArchetypeTypeParser<GameObject, MapArchObject, Archetype>(archetypeAttributeParser); final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 07:38:27 UTC (rev 4979) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) @@ -33,6 +33,7 @@ import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.archtype.ArchetypeAttributeParser; +import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSet; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.ArchetypeSet; @@ -302,6 +303,9 @@ @NotNull protected final ArchetypeAttributeParser<G, A, R> archetypeAttributeParser; + @NotNull + protected final ArchetypeTypeParser<G, A, R> archetypeTypeParser; + /** * Creates a new instance. * @param gridartaObjectsFactory the gridarta objects factory @@ -426,6 +430,7 @@ } treasureListTree = createTreasureListTree(); archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(typeNoEventConnector, includeFaceText, globalSettings, mapFileFilter, luaFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, undefinedSpellIndex, archetypeTypeSet, treasureListTree); + archetypeTypeParser = new ArchetypeTypeParser<G, A, R>(archetypeAttributeParser); } @NotNull This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-08-22 07:42:07
|
Revision: 4981 http://gridarta.svn.sourceforge.net/gridarta/?rev=4981&view=rev Author: akirschbaum Date: 2008-08-22 07:42:16 +0000 (Fri, 22 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 Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-22 07:42:16 UTC (rev 4981) @@ -54,7 +54,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.LeftPanel; @@ -138,7 +137,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), false, CResourceLoader.getHomeFile("thumbnails"), null, "DaimoninEditor.jar", pythonFileFilter, ".py", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0); - final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); archetypeTypeSetParser.loadTypesFromXML(filename); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-22 07:42:16 UTC (rev 4981) @@ -58,7 +58,6 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.GridartaObjectsFactory; import net.sf.gridarta.MapManager; -import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.match.MutableOrGameObjectMatcher; @@ -200,7 +199,6 @@ */ public CMainControl(@NotNull final GridartaObjectsFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> gridartaObjectsFactory) { super(gridartaObjectsFactory, new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new FaceObjects(), new DefaultMapControlFactory(gridartaObjectsFactory), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "CrossfireEditor.jar", luaFileFilter, ".lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1); - final ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype> archetypeTypeSetParser = new ArchetypeTypeSetParser<GameObject, MapArchObject, Archetype>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); try { final String filename = IOUtils.getResourceURLAsString(getConfigurationDirectory(), CommonConstants.TYPEDEF_FILE); archetypeTypeSetParser.loadTypesFromXML(filename); Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 07:40:20 UTC (rev 4980) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-08-22 07:42:16 UTC (rev 4981) @@ -35,6 +35,7 @@ import net.sf.gridarta.archtype.ArchetypeAttributeParser; import net.sf.gridarta.archtype.ArchetypeTypeParser; import net.sf.gridarta.archtype.ArchetypeTypeSet; +import net.sf.gridarta.archtype.ArchetypeTypeSetParser; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.GameObject; @@ -305,6 +306,9 @@ @NotNull protected final ArchetypeTypeParser<G, A, R> archetypeTypeParser; + + @NotNull + protected final ArchetypeTypeSetParser<G, A, R> archetypeTypeSetParser; /** * Creates a new instance. @@ -431,6 +435,7 @@ treasureListTree = createTreasureListTree(); archetypeAttributeParser = new ArchetypeAttributeParser<G, A, R>(typeNoEventConnector, includeFaceText, globalSettings, mapFileFilter, luaFileFilter, faceObjects, animationObjects, numberSpells, gameObjectSpells, undefinedSpellIndex, archetypeTypeSet, treasureListTree); archetypeTypeParser = new ArchetypeTypeParser<G, A, R>(archetypeAttributeParser); + archetypeTypeSetParser = new ArchetypeTypeSetParser<G, A, R>(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath(), archetypeTypeSet, archetypeTypeParser); } @NotNull This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |