From: <aki...@us...> - 2008-08-08 18:50:21
|
Revision: 4803 http://gridarta.svn.sourceforge.net/gridarta/?rev=4803&view=rev Author: akirschbaum Date: 2008-08-08 18:50:21 +0000 (Fri, 08 Aug 2008) Log Message: ----------- Replace assert statement with @NotNull annotation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gui/map/MapRenderer.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-08 18:32:52 UTC (rev 4802) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-08-08 18:50:21 UTC (rev 4803) @@ -229,7 +229,6 @@ ScriptedEventEditor.setGlobalSettings(globalSettings); final AnimationObjects<AnimationObject> animationObjects = new cfeditor.gameobject.anim.AnimationObjects(); archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, ((GlobalSettingsImpl) globalSettings).getImageSet(), gridartaObjectsFactory); - GameObject.setArchetypeSet(archetypeSet); ScriptedEvent.setArchetypeSet(archetypeSet); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); ACTION_FACTORY.createActions(true, this, "createNew", "open", "options", "exit", "newScript", "editScript", "zoom", "gc", "onlineHelp", "tod", "about"); @@ -249,6 +248,7 @@ replaceDialogManager.setObjectChooser(objectChooser); mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, this, editTypes, archetypeSet, copyBuffer, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser, mapManager); SystemIcons.init(); + GameObject.setArchetypeSet(archetypeSet, SystemIcons.getNofaceTileIcon()); createMapImageCache(CResourceLoader.getHomeFile("thumbnails"), SystemIcons.getDefaultIcon(), SystemIcons.getDefaultPreview(), new StatusBar<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager, archetypeSet, faceObjects)); mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, editTypes, mapManager, ACTION_FACTORY, mapManagerActions.getCloseAllAction(), statusBar); new About("cfeditor", mainView); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-08 18:32:52 UTC (rev 4802) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-08-08 18:50:21 UTC (rev 4803) @@ -64,13 +64,18 @@ private ScriptArchData scriptArchData = new ScriptArchData(this); /** The normal face. */ - private ImageIcon normalFace; + @NotNull + private ImageIcon normalFace = noFace; @Nullable private static ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; - public static void setArchetypeSet(@Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + @Nullable + private static ImageIcon noFace = null; + + public static void setArchetypeSet(@Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ImageIcon noFace) { GameObject.archetypeSet = archetypeSet; + GameObject.noFace = noFace; } /** {@inheritDoc} */ @@ -127,6 +132,7 @@ * Returns the normal face for this GameObject. * @return The normal face for this GameObject. */ + @NotNull public ImageIcon getNormalImage() { return normalFace; } Modified: trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-08-08 18:32:52 UTC (rev 4802) +++ trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-08-08 18:50:21 UTC (rev 4803) @@ -189,7 +189,6 @@ continue; } final ImageIcon img = node.getNormalImage(); - assert img != null; if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { offset.x = 0; offset.y = 0; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-08-08 18:32:52 UTC (rev 4802) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-08-08 18:50:21 UTC (rev 4803) @@ -288,7 +288,6 @@ ScriptArchEditor.setGlobalSettings(globalSettings, this); ScriptedEventEditor.setGlobalSettings(globalSettings); final AnimationObjects<AnimationObject> animationObjects = new daieditor.gameobject.anim.AnimationObjects(); - GameObject.setAnimationObjects(animationObjects); archetypeSet = new ArchetypeSet(this, globalSettings, editTypes, animationObjects, faceObjects, gridartaObjectsFactory); GameObject.setArchetypeSet(archetypeSet); ScriptedEvent.setArchetypeSet(archetypeSet); @@ -312,6 +311,7 @@ replaceDialogManager.setObjectChooser(objectChooser); mainActions = new MainActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(replaceDialogManager, this, editTypes, archetypeSet, copyBuffer, pickmapChooserControl, animationObjects, ACTION_FACTORY, faceObjects, objectChooser, mapManager); SystemIcons.init(); + GameObject.setAnimationObjects(animationObjects, SystemIcons.getNofaceTileIcon()); createMapImageCache(null, SystemIcons.getDefaultIcon(), SystemIcons.getDefaultPreview(), new StatusBar<GameObject, MapArchObject, Archetype, CMapViewBasic>(mapManager, archetypeSet, faceObjects)); mainView = new MainView<GameObject, MapArchObject, Archetype, CMapViewBasic>(this, editTypes, mapManager, ACTION_FACTORY, mapManagerActions.getCloseAllAction(), statusBar); new About("daieditor", mainView); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-08 18:32:52 UTC (rev 4802) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-08-08 18:50:21 UTC (rev 4803) @@ -88,13 +88,19 @@ private boolean noface; /** The normal face. */ - private ImageIcon normalFace; + @NotNull + private ImageIcon normalFace = noFace; /** The transparent face. */ - private ImageIcon transFace; + @NotNull + private ImageIcon transFace = noFace; - public static void setAnimationObjects(@Nullable final AnimationObjects<AnimationObject> animationObjects) { + @Nullable + private static ImageIcon noFace = null; + + public static void setAnimationObjects(@Nullable final AnimationObjects<AnimationObject> animationObjects, @NotNull final ImageIcon noFace) { GameObject.animationObjects = animationObjects; + GameObject.noFace = noFace; } @Nullable @@ -270,6 +276,7 @@ * Returns the normal face for this GameObject. * @return The normal face for this GameObject. */ + @NotNull public ImageIcon getNormalImage() { return normalFace; } @@ -278,6 +285,7 @@ * Returns a transparent variant of the face for this GameObject. * @return The transparent face for this GameObject. */ + @NotNull public ImageIcon getTransparentImage() { return transFace; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |