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. |