From: <aki...@us...> - 2008-07-31 20:46:40
|
Revision: 4613 http://gridarta.svn.sourceforge.net/gridarta/?rev=4613&view=rev Author: akirschbaum Date: 2008-07-31 20:46:44 +0000 (Thu, 31 Jul 2008) Log Message: ----------- Remove MainControl.getAnimationObjects(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/MainControl.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-31 20:35:27 UTC (rev 4612) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-31 20:46:44 UTC (rev 4613) @@ -442,14 +442,6 @@ return mapValidators; } - /** - * Get the Animation Objects. - * @return animationObjects - */ - public AnimationObjects<AnimationObject> getAnimationObjects() { - return animationObjects; - } - /** {@inheritDoc} */ public void validateMap(final MapModel<GameObject, MapArchObject, Archetype> map) { final ErrorCollector<GameObject, MapArchObject, Archetype> errorCollector = new DefaultErrorCollector<GameObject, MapArchObject, Archetype>(); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-07-31 20:35:27 UTC (rev 4612) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-07-31 20:46:44 UTC (rev 4613) @@ -281,6 +281,7 @@ CMainControlInstance.instance = this; globalSettings.readGlobalSettings(); animationObjects = new daieditor.gameobject.anim.AnimationObjects(); + GameObject.setAnimationObjects(animationObjects); archetypeSet = new ArchetypeSet(this, getEditTypes(), animationObjects, faceObjects); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); final SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, this, getEditTypes(), mapTileListBottom, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), archetypeSet); @@ -551,14 +552,6 @@ getMapManager().refreshCurrentMap(); } - /** - * Get the Animation Objects. - * @return animationObjects - */ - public AnimationObjects<AnimationObject> getAnimationObjects() { - return animationObjects; - } - /** Control the server. */ @ActionMethod public void controlServer() { Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-07-31 20:35:27 UTC (rev 4612) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-07-31 20:46:44 UTC (rev 4613) @@ -52,6 +52,9 @@ /** The serial version UID. */ private static final long serialVersionUID = 1; + @Nullable + private static AnimationObjects<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 @@ -89,6 +92,10 @@ /** The transparent face. */ private ImageIcon transFace; + public static void setAnimationObjects(@Nullable final AnimationObjects<AnimationObject> animationObjects) { + GameObject.animationObjects = animationObjects; + } + /** {@inheritDoc} */ public int getMultiShapeID() { return multi != null ? multi.getMultiShapeID() : 0; @@ -204,18 +211,21 @@ @Nullable String effectiveFaceObjName; if (effectiveAnimName != null) { // we have a animation - get the frame picture - final AnimationObjects<AnimationObject> animationObjects = CMainControlInstance.getInstance().getAnimationObjects(); - final AnimationObject animationObject = animationObjects.get(effectiveAnimName); - if (animationObject != null) { - noface = false; - //faceObjName = animationObjects.getAnimFrame(animnr, getDirection()); - try { - effectiveFaceObjName = animationObject.getFirstFrame(getDirection()); - } catch (final IndexOutOfBoundsException ex) { + if (animationObjects == null) { + effectiveFaceObjName = null; + } else { + final AnimationObject animationObject = animationObjects.get(effectiveAnimName); + if (animationObject != null) { + noface = false; + //faceObjName = animationObjects.getAnimFrame(animnr, getDirection()); + try { + effectiveFaceObjName = animationObject.getFirstFrame(getDirection()); + } catch (final IndexOutOfBoundsException ex) { + effectiveFaceObjName = null; + } + } else { effectiveFaceObjName = null; } - } else { - effectiveFaceObjName = null; } if (effectiveFaceObjName == null) { faceObjSource = FaceSource.FACE_NOT_FOUND; Modified: trunk/src/app/net/sf/gridarta/MainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/MainControl.java 2008-07-31 20:35:27 UTC (rev 4612) +++ trunk/src/app/net/sf/gridarta/MainControl.java 2008-07-31 20:46:44 UTC (rev 4613) @@ -26,7 +26,6 @@ import net.sf.gridarta.gameobject.ArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.GameObject; -import net.sf.gridarta.gameobject.anim.AnimationObjects; import net.sf.gridarta.gui.MainActions; import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.ObjectChooser; @@ -97,12 +96,6 @@ ArchetypeParser<G, A, R> getArchetypeParser(); /** - * Get the AnimationObjects for the available Animations. - * @return AnimationObjects - */ - AnimationObjects<?> getAnimationObjects(); - - /** * Returns the MainView of this MainControl. * @return The MainView of this MainControl. */ Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-07-31 20:35:27 UTC (rev 4612) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-07-31 20:46:44 UTC (rev 4613) @@ -437,11 +437,6 @@ } /** {@inheritDoc} */ - public AnimationObjects<?> getAnimationObjects() { - throw new AssertionError(); - } - - /** {@inheritDoc} */ public MainView<TestGameObject, TestMapArchObject, TestArchetype, TestMapViewBasic> getMainView() { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |