From: <aki...@us...> - 2010-06-10 06:41:14
|
Revision: 8325 http://gridarta.svn.sourceforge.net/gridarta/?rev=8325&view=rev Author: akirschbaum Date: 2010-06-10 06:41:08 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 06:39:09 UTC (rev 8324) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) @@ -91,7 +91,7 @@ /** * Creates a new instance. - * @param archDirectory the "arch" directory + * @param archDirectory the "arch" directory to read * @param collectedDirectory the collected directory * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use @@ -139,7 +139,7 @@ * <code>arch/</code> directory tree. * @param errorViewCollector the error view collector for reporting errors * @param archetypeParser the archetype parser to use - * @param path the base directory relative path for <code>f</code> + * @param path the base directory relative path of <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder * @param panelName the panel to add archetypes to Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 06:39:09 UTC (rev 8324) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) @@ -139,7 +139,7 @@ * <code>arch/</code> directory tree. * @param errorViewCollector the error view collector for reporting errors * @param archetypeParser the archetype parser to use - * @param path the base directory relative path for <code>f</code> + * @param path the base directory relative path of <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder * @param panelName the panel to add archetypes to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 06:55:29
|
Revision: 8326 http://gridarta.svn.sourceforge.net/gridarta/?rev=8326&view=rev Author: akirschbaum Date: 2010-06-10 06:55:22 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Remove AbstractResourcesReader classes. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/AbstractResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/AbstractResourcesReader.java Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/AbstractResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/AbstractResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/AbstractResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -1,58 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.var.atrinik.resource; - -import java.io.File; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.var.atrinik.model.archetype.Archetype; -import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; -import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * Loader for archetype files. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - */ -public abstract class AbstractResourcesReader extends net.sf.gridarta.model.resource.AbstractResourcesReader<GameObject, MapArchObject, Archetype> { - - /** - * Creates a new instance. - * @param collectedDirectory the collected directory - * @param animationObjects the animation objects instance - * @param faceObjects the face objects instance - */ - protected AbstractResourcesReader(@NotNull final File collectedDirectory, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { - super(collectedDirectory, animationObjects, faceObjects); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected String generateFaceName(@NotNull final String name) { - return name.substring(0, name.length() - 4); - } - -} // class AbstractResourcesReader Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.var.atrinik.IGUIConstants; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; @@ -50,7 +51,7 @@ * Loads all resources from collected files. * @author Andreas Kirschbaum */ -public class CollectedResourcesReader extends AbstractResourcesReader { +public class CollectedResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -90,7 +91,7 @@ * @param animationObjects the animation objects instance */ public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { - super(collectedDirectory, animationObjects, faceObjects); + super(collectedDirectory, null, animationObjects, faceObjects); this.collectedDirectory = collectedDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -40,6 +40,7 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.io.AnimationObjectsReader; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; @@ -52,7 +53,7 @@ * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader { +public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -100,7 +101,7 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, animationObjects, faceObjects); + super(collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; Deleted: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/AbstractResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -1,90 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.var.crossfire.resource; - -import java.io.File; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.var.crossfire.model.archetype.Archetype; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * Loader for archetype files. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - */ -public abstract class AbstractResourcesReader extends net.sf.gridarta.model.resource.AbstractResourcesReader<GameObject, MapArchObject, Archetype> { - - /** - * The archetype set to update. - */ - @NotNull - private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; - - /** - * Creates a new instance. - * @param collectedDirectory the collected directory - * @param archetypeSet the archetype set to update - * @param faceObjects the face objects instance - * @param animationObjects the animation objects instance faces - */ - protected AbstractResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { - super(collectedDirectory, animationObjects, faceObjects); - this.archetypeSet = archetypeSet; - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected String generateFaceName(@NotNull final String name) { - if (archetypeSet.getImageSet() != null) { - // we have to snip out the image set information here from - // the 'name', and the ".png": (e.g. blocked.base.111.png -> blocked.111) - int firstDot = 0; - int secondDot = 0; - for (int t = 0; t < name.length() && secondDot == 0; t++) { - if (name.charAt(t) == '.') { - if (firstDot == 0) { - firstDot = t; - } else { - secondDot = t; - } - } - } - - if (firstDot != 0 && secondDot != 0) { - return name.substring(0, firstDot) + name.substring(secondDot, name.length() - 4); - } else { - return name.substring(0, name.length() - 4); - } - } - - // no image set: we need only cut off the ".png" - return name.substring(0, name.length() - 4); - } - -} // class AbstractResourcesReader Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.var.crossfire.IGUIConstants; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; @@ -52,7 +53,7 @@ * Loads all resources from collected files. * @author Andreas Kirschbaum */ -public class CollectedResourcesReader extends AbstractResourcesReader { +public class CollectedResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -106,7 +107,7 @@ * @param smoothFaces the smooth faces to update */ public CollectedResourcesReader(@NotNull final File configurationDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final SmoothFaces smoothFaces) { - super(collectedDirectory, archetypeSet, faceObjects, animationObjects); + super(collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); this.configurationDirectory = configurationDirectory; this.collectedDirectory = collectedDirectory; this.archetypeSet = archetypeSet; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -39,6 +39,7 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.io.AnimationObjectsReader; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; @@ -50,7 +51,7 @@ * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader { +public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -98,7 +99,7 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, archetypeSet, faceObjects, animationObjects); + super(collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); this.archDirectory = archDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; Deleted: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/AbstractResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/AbstractResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/AbstractResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -1,58 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.var.daimonin.resource; - -import java.io.File; -import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.var.daimonin.model.archetype.Archetype; -import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; -import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * Loader for archetype files. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author Andreas Kirschbaum - */ -public abstract class AbstractResourcesReader extends net.sf.gridarta.model.resource.AbstractResourcesReader<GameObject, MapArchObject, Archetype> { - - /** - * Creates a new instance. - * @param collectedDirectory the collected directory - * @param animationObjects the animation objects instance - * @param faceObjects the face objects instance - */ - protected AbstractResourcesReader(@NotNull final File collectedDirectory, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { - super(collectedDirectory, animationObjects, faceObjects); - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override - protected String generateFaceName(@NotNull final String name) { - return name.substring(0, name.length() - 4); - } - -} // class AbstractResourcesReader Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.utils.IOUtils; import net.sf.gridarta.var.daimonin.IGUIConstants; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; @@ -50,7 +51,7 @@ * Loads all resources from collected files. * @author Andreas Kirschbaum */ -public class CollectedResourcesReader extends AbstractResourcesReader { +public class CollectedResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -90,7 +91,7 @@ * @param animationObjects the animation objects instance */ public CollectedResourcesReader(@NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects) { - super(collectedDirectory, animationObjects, faceObjects); + super(collectedDirectory, null, animationObjects, faceObjects); this.collectedDirectory = collectedDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -40,6 +40,7 @@ import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.io.AnimationObjectsReader; +import net.sf.gridarta.model.resource.AbstractResourcesReader; import net.sf.gridarta.utils.Pair; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -52,7 +53,7 @@ * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader { +public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { /** * The logger for printing log messages. @@ -100,7 +101,7 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, animationObjects, faceObjects); + super(collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-10 06:41:08 UTC (rev 8325) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) @@ -50,6 +50,7 @@ import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Abstract base class for archetype set loader classes. @@ -77,6 +78,13 @@ private final File collectedDirectory; /** + * The current image set. Set to <code>null</code> if no explicit image set + * is used. + */ + @Nullable + private final String imageSet; + + /** * The animation objects instance. */ @NotNull @@ -91,11 +99,13 @@ /** * Creates a new instance. * @param collectedDirectory the collected directory + * @param imageSet the active image set or <code>null</code> * @param animationObjects the animation objects instance * @param faceObjects the face objects instance */ - protected AbstractResourcesReader(@NotNull final File collectedDirectory, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + protected AbstractResourcesReader(@NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { this.collectedDirectory = collectedDirectory; + this.imageSet = imageSet; this.animationObjects = animationObjects; this.faceObjects = faceObjects; } @@ -169,8 +179,33 @@ * @return facename generated from <var>name</var> */ @NotNull - protected abstract String generateFaceName(@NotNull final String name); + private String generateFaceName(@NotNull final String name) { + if (imageSet != null) { + // we have to snip out the image set information here from + // the 'name', and the ".png": (e.g. blocked.base.111.png -> blocked.111) + int firstDot = 0; + int secondDot = 0; + for (int t = 0; t < name.length() && secondDot == 0; t++) { + if (name.charAt(t) == '.') { + if (firstDot == 0) { + firstDot = t; + } else { + secondDot = t; + } + } + } + if (firstDot != 0 && secondDot != 0) { + return name.substring(0, firstDot) + name.substring(secondDot, name.length() - 4); + } else { + return name.substring(0, name.length() - 4); + } + } + + // no image set: we need only cut off the ".png" + return name.substring(0, name.length() - 4); + } + /** * Reads the resources. * @param errorView the error view for reporting problems This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:02:31
|
Revision: 8327 http://gridarta.svn.sourceforge.net/gridarta/?rev=8327&view=rev Author: akirschbaum Date: 2010-06-10 07:02:25 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Extract code into functions. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) @@ -156,7 +156,7 @@ final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels - if (!(folderLevel == 1 && name.equalsIgnoreCase("dev"))) { + if (isValidEntry(folderLevel, name)) { final String[] entries = f.list(); if (entries != null) { Arrays.sort(entries); @@ -201,6 +201,16 @@ } /** + * Returns whether a file name should be processed. + * @param folderLevel the folder level + * @param name the base name of the file name + * @return whether the entry is valid and shoudl be processed + */ + private boolean isValidEntry(final int folderLevel, final String name) { + return folderLevel != 1 || !name.equalsIgnoreCase("dev"); + } + + /** * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) @@ -150,7 +150,7 @@ final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels - if (!name.equalsIgnoreCase("cvs") && !name.equalsIgnoreCase("dev") && !name.startsWith(".")) { + if (isValidEntry(folderLevel, name)) { final String[] entries = f.list(); if (entries != null) { Arrays.sort(entries); @@ -197,6 +197,16 @@ } /** + * Returns whether a file name should be processed. + * @param folderLevel the folder level + * @param name the base name of the file name + * @return whether the entry is valid and shoudl be processed + */ + private boolean isValidEntry(final int folderLevel, final String name) { + return !name.equalsIgnoreCase("cvs") && !name.equalsIgnoreCase("dev") && !name.startsWith("."); + } + + /** * Parsing face files (*.face). I think such files are no longer used and so * is this code. * @param errorView the error view for reporting errors Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 06:55:22 UTC (rev 8326) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) @@ -156,7 +156,7 @@ final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels - if (!(folderLevel == 1 && name.equalsIgnoreCase("dev"))) { + if (isValidEntry(folderLevel, name)) { final String[] entries = f.list(); if (entries != null) { Arrays.sort(entries); @@ -201,6 +201,16 @@ } /** + * Returns whether a file name should be processed. + * @param folderLevel the folder level + * @param name the base name of the file name + * @return whether the entry is valid and shoudl be processed + */ + private boolean isValidEntry(final int folderLevel, final String name) { + return folderLevel != 1 || !name.equalsIgnoreCase("dev"); + } + + /** * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:04:57
|
Revision: 8328 http://gridarta.svn.sourceforge.net/gridarta/?rev=8328&view=rev Author: akirschbaum Date: 2010-06-10 07:04:51 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Remove unused parameters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) @@ -121,7 +121,7 @@ final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); addPNGFace(new File(archDirectory, "dev/editor/bug.101.png").getAbsolutePath(), "/dev/editor", "bug.101.png", errorView, archFaceProvider); final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", false, invObjects, archFaceProvider, errorView, animFiles); + loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); if (log.isInfoEnabled()) { log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); @@ -145,14 +145,12 @@ * @param folderLevel level of the folder * @param panelName the panel to add archetypes to * @param folderName the folder to add archetypes to - * @param noPanel set this to true if the file should be omitted from the - * panel. * @param invObjects collects all inventory objects * @param archFaceProvider the arch face provider to add to * @param errorView the error view to use * @param animFiles the found animation files */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -164,7 +162,7 @@ final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; final String newPath = path.length() == 0 ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, archFaceProvider, errorView, animFiles); + loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); } } else { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); @@ -214,9 +212,9 @@ * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, - * String, File, int, String, String, boolean, List, ArchFaceProvider, - * ErrorView, Collection)}. Do not invoke this method if - * <code>loadArchetypesFromFiles()</code> wasn't invoked. + * String, File, int, String, String, List, ArchFaceProvider, ErrorView, + * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> + * wasn't invoked. * @param errorViewCollector the error view collector for reporting errors * @param animFiles the animation files */ Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) @@ -117,7 +117,7 @@ final int animationObjectsSize = animationObjects.size(); final int archetypeCount = archetypeSet.getArchetypeCount(); final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", false, invObjects, archFaceProvider, errorView); + loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView); if (log.isInfoEnabled()) { log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); } @@ -140,13 +140,11 @@ * @param folderLevel level of the folder * @param panelName the panel to add archetypes to * @param folderName the folder to add archetypes to - * @param noPanel set this to true if the file should be omitted from the - * panel. * @param invObjects collects all inventory objects * @param archFaceProvider the arch face provider to add to * @param errorView the error view to use */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView) { + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -158,7 +156,7 @@ final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; final String newPath = path.length() == 0 ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, false, invObjects, archFaceProvider, errorView); + loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView); } } else { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:02:25 UTC (rev 8327) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) @@ -121,7 +121,7 @@ final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); addPNGFace(new File(archDirectory, "dev/editor/bug.101.png").getAbsolutePath(), "/dev/editor", "bug.101.png", errorView, archFaceProvider); final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", false, invObjects, archFaceProvider, errorView, animFiles); + loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); if (log.isInfoEnabled()) { log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); @@ -145,14 +145,12 @@ * @param folderLevel level of the folder * @param panelName the panel to add archetypes to * @param folderName the folder to add archetypes to - * @param noPanel set this to true if the file should be omitted from the - * panel. * @param invObjects collects all inventory objects * @param archFaceProvider the arch face provider to add to * @param errorView the error view to use * @param animFiles the found animation files */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -164,7 +162,7 @@ final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; final String newPath = path.length() == 0 ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, archFaceProvider, errorView, animFiles); + loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); } } else { errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); @@ -214,9 +212,9 @@ * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, - * String, File, int, String, String, boolean, List, ArchFaceProvider, - * ErrorView, Collection)}. Do not invoke this method if - * <code>loadArchetypesFromFiles()</code> wasn't invoked. + * String, File, int, String, String, List, ArchFaceProvider, ErrorView, + * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> + * wasn't invoked. * @param errorViewCollector the error view collector for reporting errors * @param animFiles the animation files */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:08:31
|
Revision: 8329 http://gridarta.svn.sourceforge.net/gridarta/?rev=8329&view=rev Author: akirschbaum Date: 2010-06-10 07:08:24 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Extract code into functions. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:08:24 UTC (rev 8329) @@ -191,7 +191,9 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); + if (isValidAnimationFile(name)) { + addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); + } } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } @@ -199,6 +201,15 @@ } /** + * Returns whether an animation file name should be processed. + * @param name the base name of the animation file name + * @return whether the file is valid and should be processed + */ + private boolean isValidAnimationFile(final String name) { + return true; + } + + /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:08:24 UTC (rev 8329) @@ -185,7 +185,7 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { + if (isValidAnimationFile(name)) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } } else if (FileFilters.faceFileFilter.accept(f)) { @@ -195,6 +195,15 @@ } /** + * Returns whether an animation file name should be processed. + * @param name the base name of the animation file name + * @return whether the file is valid and should be processed + */ + private boolean isValidAnimationFile(final String name) { + return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); + } + + /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:04:51 UTC (rev 8328) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:08:24 UTC (rev 8329) @@ -191,7 +191,9 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); + if (isValidAnimationFile(name)) { + addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); + } } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } @@ -199,6 +201,15 @@ } /** + * Returns whether an animation file name should be processed. + * @param name the base name of the animation file name + * @return whether the file is valid and should be processed + */ + private boolean isValidAnimationFile(final String name) { + return true; + } + + /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:10:03
|
Revision: 8330 http://gridarta.svn.sourceforge.net/gridarta/?rev=8330&view=rev Author: akirschbaum Date: 2010-06-10 07:09:56 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Unify code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:08:24 UTC (rev 8329) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:09:56 UTC (rev 8330) @@ -206,7 +206,7 @@ * @return whether the file is valid and should be processed */ private boolean isValidAnimationFile(final String name) { - return true; + return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:08:24 UTC (rev 8329) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:09:56 UTC (rev 8330) @@ -206,7 +206,7 @@ * @return whether the file is valid and should be processed */ private boolean isValidAnimationFile(final String name) { - return true; + return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:11:22
|
Revision: 8331 http://gridarta.svn.sourceforge.net/gridarta/?rev=8331&view=rev Author: akirschbaum Date: 2010-06-10 07:11:15 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Inline functions. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:09:56 UTC (rev 8330) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:11:15 UTC (rev 8331) @@ -191,7 +191,7 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - if (isValidAnimationFile(name)) { + if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } } else if (FileFilters.animFileFilter.accept(f)) { @@ -201,15 +201,6 @@ } /** - * Returns whether an animation file name should be processed. - * @param name the base name of the animation file name - * @return whether the file is valid and should be processed - */ - private boolean isValidAnimationFile(final String name) { - return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); - } - - /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:09:56 UTC (rev 8330) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:11:15 UTC (rev 8331) @@ -185,7 +185,7 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - if (isValidAnimationFile(name)) { + if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } } else if (FileFilters.faceFileFilter.accept(f)) { @@ -195,15 +195,6 @@ } /** - * Returns whether an animation file name should be processed. - * @param name the base name of the animation file name - * @return whether the file is valid and should be processed - */ - private boolean isValidAnimationFile(final String name) { - return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); - } - - /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:09:56 UTC (rev 8330) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:11:15 UTC (rev 8331) @@ -191,7 +191,7 @@ new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } } else if (FileFilters.pngFileFilter.accept(f)) { - if (isValidAnimationFile(name)) { + if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } } else if (FileFilters.animFileFilter.accept(f)) { @@ -201,15 +201,6 @@ } /** - * Returns whether an animation file name should be processed. - * @param name the base name of the animation file name - * @return whether the file is valid and should be processed - */ - private boolean isValidAnimationFile(final String name) { - return archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + "."); - } - - /** * Returns whether a file name should be processed. * @param folderLevel the folder level * @param name the base name of the file name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:38:54
|
Revision: 8335 http://gridarta.svn.sourceforge.net/gridarta/?rev=8335&view=rev Author: akirschbaum Date: 2010-06-10 07:38:47 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Add support for "*.face" files in arch directory. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-10 07:35:54 UTC (rev 8334) +++ trunk/atrinik/ChangeLog 2010-06-10 07:38:47 UTC (rev 8335) @@ -1,3 +1,7 @@ +2010-06-10 Andreas Kirschbaum + + * Add support for "*.face" files in arch directory. + 2010-06-09 Andreas Kirschbaum * Do not crash when reverting a resized map. Properly revert Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:35:54 UTC (rev 8334) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:38:47 UTC (rev 8335) @@ -24,6 +24,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -194,6 +195,8 @@ if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } + } else if (FileFilters.faceFileFilter.accept(f)) { + parseDefFace(errorView, f.getAbsolutePath(), path); } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } @@ -211,6 +214,38 @@ } /** + * Loads a .face file. + * @param errorView the error view for reporting errors + * @param path the base directory relative path of <code>filename</code> + * @param filename filename + */ + private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { + final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); + try { + final FileInputStream fis = new FileInputStream(path); + try { + final InputStreamReader isr = new InputStreamReader(fis); + try { + final Reader in = new BufferedReader(isr); + try { + AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); + } finally { + in.close(); + } + } finally { + isr.close(); + } + } finally { + fis.close(); + } + } catch (final IOException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); + } catch (final AnimationParseException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); + } + } + + /** * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-10 07:35:54 UTC (rev 8334) +++ trunk/daimonin/ChangeLog 2010-06-10 07:38:47 UTC (rev 8335) @@ -1,3 +1,7 @@ +2010-06-10 Andreas Kirschbaum + + * Add support for "*.face" files in arch directory. + 2010-06-09 Andreas Kirschbaum * Do not crash when reverting a resized map. Properly revert Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:35:54 UTC (rev 8334) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:38:47 UTC (rev 8335) @@ -24,6 +24,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -194,6 +195,8 @@ if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } + } else if (FileFilters.faceFileFilter.accept(f)) { + parseDefFace(errorView, f.getAbsolutePath(), path); } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } @@ -211,6 +214,38 @@ } /** + * Loads a .face file. + * @param errorView the error view for reporting errors + * @param path the base directory relative path of <code>filename</code> + * @param filename filename + */ + private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { + final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); + try { + final FileInputStream fis = new FileInputStream(path); + try { + final InputStreamReader isr = new InputStreamReader(fis); + try { + final Reader in = new BufferedReader(isr); + try { + AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); + } finally { + in.close(); + } + } finally { + isr.close(); + } + } finally { + fis.close(); + } + } catch (final IOException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); + } catch (final AnimationParseException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); + } + } + + /** * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:44:06
|
Revision: 8336 http://gridarta.svn.sourceforge.net/gridarta/?rev=8336&view=rev Author: akirschbaum Date: 2010-06-10 07:44:00 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:38:47 UTC (rev 8335) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:44:00 UTC (rev 8336) @@ -151,7 +151,7 @@ * @param errorView the error view to use * @param animFiles the found animation files */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:38:47 UTC (rev 8335) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:44:00 UTC (rev 8336) @@ -151,7 +151,7 @@ * @param errorView the error view to use * @param animFiles the found animation files */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 07:57:29
|
Revision: 8337 http://gridarta.svn.sourceforge.net/gridarta/?rev=8337&view=rev Author: akirschbaum Date: 2010-06-10 07:57:21 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Rename FileFilters into GuiFileFilters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -27,7 +27,7 @@ import java.util.regex.Pattern; import javax.swing.JOptionPane; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -210,7 +210,7 @@ @NotNull @Override public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); } /** @@ -539,7 +539,7 @@ @NotNull @Override public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -170,7 +170,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { + if (GuiFileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -191,13 +191,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (FileFilters.pngFileFilter.accept(f)) { + } else if (GuiFileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (FileFilters.faceFileFilter.accept(f)) { + } else if (GuiFileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { + } else if (GuiFileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -22,7 +22,7 @@ import java.awt.Component; import java.util.regex.Pattern; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -160,7 +160,7 @@ @NotNull @Override public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); } /** @@ -406,7 +406,7 @@ @NotNull @Override public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return mainControl.createGUIMainControl(FileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapControlFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -169,7 +169,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { + if (GuiFileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -190,13 +190,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (FileFilters.pngFileFilter.accept(f)) { + } else if (GuiFileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (FileFilters.faceFileFilter.accept(f)) { + } else if (GuiFileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { + } else if (GuiFileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -27,7 +27,7 @@ import java.util.regex.Pattern; import javax.swing.JOptionPane; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewFactory; import net.sf.gridarta.gui.map.mapview.MapViewsManager; @@ -211,7 +211,7 @@ @NotNull @Override public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences) { - return new DefaultMainControl<GameObject, MapArchObject, Archetype>(FileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); + return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, scriptModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, attributeRangeChecker, pluginParameterFactory, validatorPreferences); } /** @@ -540,7 +540,7 @@ @NotNull @Override public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final ScriptExecutor<GameObject, MapArchObject, Archetype> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapControlFactory<GameObject, MapArchObject, Archetype> mapControlFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final ScriptModel<GameObject, MapArchObject, Archetype> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final AttributeRangeChecker<GameObject, MapArchObject, Archetype> attributeRangeChecker, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { - return mainControl.createGUIMainControl(FileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); + return mainControl.createGUIMainControl(GuiFileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapControlFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, scriptExecutor, scriptParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, scriptModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, attributeRangeChecker, pluginParameterFactory); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -170,7 +170,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { + if (GuiFileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -191,13 +191,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (FileFilters.pngFileFilter.accept(f)) { + } else if (GuiFileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (FileFilters.faceFileFilter.accept(f)) { + } else if (GuiFileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { + } else if (GuiFileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Deleted: trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -1,81 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.gui.io; - -import javax.swing.filechooser.FileFilter; -import net.sf.gridarta.gui.utils.HideFileFilterProxy; -import net.sf.gridarta.gui.utils.MapFileFilter; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.util.filter.file.EndingFileFilter; - -/** - * Utility class defining {@link FileFilter}s. - * @author Andreas Kirschbaum - */ -public class FileFilters { - - /** - * Action Builder. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** - * Private constructor to prevent instantiation. - */ - private FileFilters() { - } - - /** - * Swing FileFilter for map files. - */ - public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); - - /** - * Swing FileFilter for Python scripts. - */ - public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.python"), ".py")); - - /** - * Swing FileFilter for Lua scripts. - */ - public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.lua"), ".lua")); - - /** - * Swing FileFilter for .arc files. - */ - public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.arc"), ".arc")); - - /** - * Swing FileFilter for .anim files. - */ - public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.anim"), ".anim")); - - /** - * Swing FileFilter for .face files. - */ - public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.face"), ".face")); - - /** - * Swing FileFilter for png graphics. - */ - public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.png"), ".png")); - -} // class FileFilters Copied: trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java (from rev 8335, trunk/src/app/net/sf/gridarta/gui/io/FileFilters.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -0,0 +1,81 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.gui.io; + +import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.gui.utils.HideFileFilterProxy; +import net.sf.gridarta.gui.utils.MapFileFilter; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.util.filter.file.EndingFileFilter; + +/** + * Utility class defining {@link FileFilter}s. + * @author Andreas Kirschbaum + */ +public class GuiFileFilters { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * Private constructor to prevent instantiation. + */ + private GuiFileFilters() { + } + + /** + * Swing FileFilter for map files. + */ + public static final FileFilter mapFileFilter = new HideFileFilterProxy(new MapFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.maps"), ".lua", ".py", ".txt", ".text")); + + /** + * Swing FileFilter for Python scripts. + */ + public static final FileFilter pythonFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.python"), ".py")); + + /** + * Swing FileFilter for Lua scripts. + */ + public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.lua"), ".lua")); + + /** + * Swing FileFilter for .arc files. + */ + public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.arc"), ".arc")); + + /** + * Swing FileFilter for .anim files. + */ + public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.anim"), ".anim")); + + /** + * Swing FileFilter for .face files. + */ + public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.face"), ".face")); + + /** + * Swing FileFilter for png graphics. + */ + public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.png"), ".png")); + +} // class FileFilters Property changes on: trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -24,7 +24,7 @@ import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JOptionPane; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -89,7 +89,7 @@ fileChooser.setMultiSelectionEnabled(false); fileChooser.setSelectedFile(file); // set a file filter for "*.png" files - fileChooser.setFileFilter(FileFilters.pngFileFilter); + fileChooser.setFileFilter(GuiFileFilters.pngFileFilter); FileChooserUtils.sanitizeCurrentDirectory(fileChooser); final int returnVal = fileChooser.showSaveDialog(component); Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -34,7 +34,7 @@ import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.WindowConstants; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -233,7 +233,7 @@ @ActionMethod public void zoomSave() throws IOException, OutOfMemoryError { final JFileChooser chooser = new JFileChooser(); - chooser.setFileFilter(FileFilters.pngFileFilter); + chooser.setFileFilter(GuiFileFilters.pngFileFilter); if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) { final File file = chooser.getSelectedFile(); if (!file.exists() || ACTION_BUILDER.showQuestionDialog(this, "overwriteOtherFile", file)) { Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -32,7 +32,7 @@ import javax.swing.filechooser.FileFilter; import javax.xml.parsers.ParserConfigurationException; import net.sf.gridarta.gui.filter.FilterControl; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.renderer.RendererFactory; import net.sf.gridarta.gui.scripts.DefaultScriptArchEditor; import net.sf.gridarta.gui.scripts.ScriptArchDataUtils; @@ -356,7 +356,7 @@ * @return the new instance */ public GUIMainControl<G, A, R> createGUIMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, final boolean createDirectionPane, @NotNull final AbstractMapManager<G, A, R> mapManager, @NotNull final MapManager<G, A, R> pickmapManager, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final MapControlFactory<G, A, R> mapControlFactory, @Nullable final ImageIcon compassIcon, @NotNull final String gridartaJarFilename, @NotNull final int[] lockedItemsTypeNumbers, final boolean autoValidatorDefault, @Nullable final String spellFile, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final ErrorView errorView, @NotNull final CacheFiles cacheFiles, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<G, A, R> rendererFactory, @NotNull final FilterControl<G, A, R> filterControl, @NotNull final ScriptExecutor<G, A, R> scriptExecutor, @NotNull final ScriptParameters scriptParameters, @NotNull final FaceObjects faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<G, A, R> topmostInsertionMode, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final SystemIcons systemIcons, final int undefinedSpellIndex, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<G, A, R> mapReaderFactory, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final String scriptsDir, @NotNull final ScriptModel<G, A, R> scriptModel, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeChooserModel<G, A, R> archetypeChooserModel, final boolean allowRandomMapParameters, @NotNull final ScriptedEventEditor<G, A, R> scriptedEventEditor, @NotNull final Direction[] directionMap, @NotNull final AbstractResources<G, A, R> resources, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final PluginParameterFactory<G, A, R> pluginParameterFactory) { - return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, FileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); + return new GUIMainControl<G, A, R>(createDirectionPane, mapManager, pickmapManager, archetypeSet, faceObjects, globalSettings, mapViewSettings, mapControlFactory, mapReaderFactory, mapArchObjectFactory, treasureTree, archetypeTypeSet, compassIcon, gridartaJarFilename, GuiFileFilters.mapFileFilter, scriptFileFilter, scriptExtension, validators, resources, gameObjectMatchers, errorView, attributeRangeChecker, lockedItemsTypeNumbers, scriptsDir, scriptModel, archetypeChooserModel, animationObjects, scriptArchEditor, scriptedEventEditor, scriptArchData, scriptArchDataUtils, scriptArchUtils, autoValidatorDefault, spellFile, allowRandomMapParameters, directionMap, editorFactory, faceObjectProviders, pluginParameterFactory, gameObjectFactory, pathManager, cacheFiles, gameObjectSpells, numberSpells, undefinedSpellIndex, systemIcons, configSourceFactory, topmostInsertionMode, rendererFactory, filterControl, scriptExecutor, scriptParameters); } } // class DefaultMainControl Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-10 07:44:00 UTC (rev 8336) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-10 07:57:21 UTC (rev 8337) @@ -58,7 +58,7 @@ import net.sf.gridarta.gui.gameobjectattributespanel.GameObjectAttributesTab; import net.sf.gridarta.gui.gameobjectattributespanel.MsgTextTab; import net.sf.gridarta.gui.gameobjectattributespanel.TextEditorTab; -import net.sf.gridarta.gui.io.FileFilters; +import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.mainwindow.GameObjectTab; import net.sf.gridarta.gui.mainwindow.WarningsTab; import net.sf.gridarta.gui.map.MapFileActions; @@ -479,7 +479,7 @@ scriptEditControl.setTextAreaDefaults(textAreaDefaults); scriptedEventEditor.setScriptEditControl(scriptEditControl); scriptArchEditor.setScriptEditControl(scriptEditControl); - fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, FileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); + fileControl = new DefaultFileControl<G, A, R>(globalSettings, archetypeSet, mapImageCache, mapManager, mapViewsManager, mainViewFrame, GuiFileFilters.mapFileFilter, scriptFileFilter, newMapDialogFactory, scriptExtension, scriptEditControl); pickmapChooserControl.setFileControl(fileControl); mapViewsManager.setFileControl(fileControl); final GameObjectMatcher floorMatcher = gameObjectMatchers.getMatcher("system_floor", "floor"); @@ -518,7 +518,7 @@ final Action exitAction = ActionUtils.newAction(ACTION_BUILDER, "Other", this, "exit"); final MapFolderTreeActions<G, A, R> mapFolderTreeActions = new MapFolderTreeActions<G, A, R>(mapFolderTree, newMapDialogFactory, "createPickmapFolder", "deletePickmapFolder", "confirmDeletePickmapFolder", "deletePickmapFolderNotEmpty"); //noinspection ResultOfObjectAllocationIgnored - new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, FileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); + new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, GuiFileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); //noinspection ResultOfObjectAllocationIgnored new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 08:11:26
|
Revision: 8338 http://gridarta.svn.sourceforge.net/gridarta/?rev=8338&view=rev Author: akirschbaum Date: 2010-06-10 08:11:15 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Extract FileFilters from GuiFileFilters. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/utils.iml Added Paths: ----------- trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java trunk/utils/src/test/net/sf/gridarta/gui/ trunk/utils/src/test/net/sf/gridarta/gui/utils/ trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.GuiFileFilters; +import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -170,7 +170,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (GuiFileFilters.arcFileFilter.accept(f)) { + if (FileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -191,13 +191,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (GuiFileFilters.pngFileFilter.accept(f)) { + } else if (FileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (GuiFileFilters.faceFileFilter.accept(f)) { + } else if (FileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (GuiFileFilters.animFileFilter.accept(f)) { + } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.GuiFileFilters; +import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -169,7 +169,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (GuiFileFilters.arcFileFilter.accept(f)) { + if (FileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -190,13 +190,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (GuiFileFilters.pngFileFilter.accept(f)) { + } else if (FileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (GuiFileFilters.faceFileFilter.accept(f)) { + } else if (FileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (GuiFileFilters.animFileFilter.accept(f)) { + } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.io.GuiFileFilters; +import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; @@ -170,7 +170,7 @@ } } } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (GuiFileFilters.arcFileFilter.accept(f)) { + if (FileFilters.arcFileFilter.accept(f)) { try { final FileInputStream fis = new FileInputStream(f); try { @@ -191,13 +191,13 @@ } catch (final IOException ex) { new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); } - } else if (GuiFileFilters.pngFileFilter.accept(f)) { + } else if (FileFilters.pngFileFilter.accept(f)) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); } - } else if (GuiFileFilters.faceFileFilter.accept(f)) { + } else if (FileFilters.faceFileFilter.accept(f)) { parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (GuiFileFilters.animFileFilter.accept(f)) { + } else if (FileFilters.animFileFilter.accept(f)) { animFiles.add(new Pair<String, File>(path, f)); } } Modified: trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/src/app/net/sf/gridarta/gui/io/GuiFileFilters.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -58,24 +58,4 @@ */ public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.lua"), ".lua")); - /** - * Swing FileFilter for .arc files. - */ - public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.arc"), ".arc")); - - /** - * Swing FileFilter for .anim files. - */ - public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.anim"), ".anim")); - - /** - * Swing FileFilter for .face files. - */ - public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.face"), ".face")); - - /** - * Swing FileFilter for png graphics. - */ - public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.png"), ".png")); - } // class FileFilters Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -24,7 +24,7 @@ import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JOptionPane; -import net.sf.gridarta.gui.io.GuiFileFilters; +import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -89,7 +89,7 @@ fileChooser.setMultiSelectionEnabled(false); fileChooser.setSelectedFile(file); // set a file filter for "*.png" files - fileChooser.setFileFilter(GuiFileFilters.pngFileFilter); + fileChooser.setFileFilter(FileFilters.pngFileFilter); FileChooserUtils.sanitizeCurrentDirectory(fileChooser); final int returnVal = fileChooser.showSaveDialog(component); Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -34,7 +34,7 @@ import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.WindowConstants; -import net.sf.gridarta.gui.io.GuiFileFilters; +import net.sf.gridarta.gui.utils.FileFilters; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.action.ActionMethod; @@ -233,7 +233,7 @@ @ActionMethod public void zoomSave() throws IOException, OutOfMemoryError { final JFileChooser chooser = new JFileChooser(); - chooser.setFileFilter(GuiFileFilters.pngFileFilter); + chooser.setFileFilter(FileFilters.pngFileFilter); if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) { final File file = chooser.getSelectedFile(); if (!file.exists() || ACTION_BUILDER.showQuestionDialog(this, "overwriteOtherFile", file)) { Deleted: trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -1,85 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.gui.utils; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import javax.swing.filechooser.FileFilter; -import net.sf.japi.util.filter.file.AbstractFileFilter; - -/** - * A FileFilter that wraps another FileFilter and filters out CVS and .xvpics - * files. The description and other filtering are taken from the wrapped file - * filter. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class HideFileFilterProxy extends AbstractFileFilter { - - /** - * The other file filter. - */ - private final FileFilter other; - - /** - * The default rejected directory names. - */ - private static final Collection<String> REJECTED_DIRECTORY_NAMES = Arrays.asList("CVS"); - - /** - * The rejected directory names. - */ - private final Collection<String> rejectedDirectoryNames = new ArrayList<String>(); - - /** - * Create a HideFileFilterProxy. - * @param other FileFilter to wrap - */ - public HideFileFilterProxy(final FileFilter other) { - this.other = other; - rejectedDirectoryNames.addAll(REJECTED_DIRECTORY_NAMES); - } - - /** - * {@inheritDoc} Returns the description from the {@link #other} - * FileFilter. - */ - @Override - public String getDescription() { - return other.getDescription(); - } - - /** - * {@inheritDoc} First checks whether the file should be hidden, if not, - * checks the other FileFilter. - */ - @SuppressWarnings({ "ParameterNameDiffersFromOverriddenParameter" }) - @Override - public boolean accept(final File pathName) { - if (pathName.getName().startsWith(".")) { - return false; - } - // XXX suppression for Bug in IDEA - //noinspection RedundantCast - return !(pathName.isDirectory() && rejectedDirectoryNames.contains(pathName.getName())) && ((java.io.FileFilter) other).accept(pathName); - } - -} // class HideFileFilterProxy Deleted: trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -1,109 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.gui.utils; - -import java.io.File; -import javax.swing.filechooser.FileFilter; -import net.sf.japi.util.filter.file.AbstractFileFilter; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test for {@link HideFileFilterProxy}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class HideFileFilterProxyTest { - - /** - * Object Under Test: A HideFileFilterProxy. - */ - private FileFilter oUT; - - /** - * Test case for {@link HideFileFilterProxy#HideFileFilterProxy(FileFilter)}. - */ - @Test - public void testHideFileFilterProxy() { - oUT = new HideFileFilterProxy(new MockFileFilter(true)); - } - - /** - * Test case for {@link HideFileFilterProxy#getDescription()}. - */ - @Test - public void testGetDescription() { - oUT = new HideFileFilterProxy(new MockFileFilter(true)); - Assert.assertEquals("MOCK", oUT.getDescription()); - } - - /** - * Test case for {@link HideFileFilterProxy#accept(File)}. - */ - @Test - public void testAccept() { - oUT = new HideFileFilterProxy(new MockFileFilter(true)); - Assert.assertTrue(oUT.accept(new File("foobar"))); - //Assert.assertFalse(oUT.accept(new File("CVS"))); - Assert.assertFalse(oUT.accept(new File(".svn"))); - oUT = new HideFileFilterProxy(new MockFileFilter(false)); - Assert.assertFalse(oUT.accept(new File("foobar"))); - //Assert.assertFalse(oUT.accept(new File("CVS"))); - Assert.assertFalse(oUT.accept(new File(".svn"))); - } - - /** - * Mock File Filter that's used as parent file filter for the - * HideFileFilterProxy under test. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ - private static class MockFileFilter extends AbstractFileFilter { - - /** - * Whether this file filter will accept or reject files. - */ - private final boolean accepts; - - /** - * Create a MockFileFilter. - * @param accepts Whether this file filter will accept or reject files. - */ - private MockFileFilter(final boolean accepts) { - this.accepts = accepts; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean accept(final File f) { - return accepts; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return "MOCK"; - } - - } // class MockFileFilter - -} // class HideFileFilterProxyTest Added: trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -0,0 +1,64 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.gui.utils; + +import javax.swing.filechooser.FileFilter; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.util.filter.file.EndingFileFilter; + +/** + * Utility class defining {@link FileFilter}s. + * @author Andreas Kirschbaum + */ +public class FileFilters { + + /** + * Action Builder. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * Private constructor to prevent instantiation. + */ + private FileFilters() { + } + + /** + * Swing FileFilter for .arc files. + */ + public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.arc"), ".arc")); + + /** + * Swing FileFilter for .anim files. + */ + public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.anim"), ".anim")); + + /** + * Swing FileFilter for .face files. + */ + public static final FileFilter faceFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.face"), ".face")); + + /** + * Swing FileFilter for png graphics. + */ + public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_BUILDER.getString("fileDialog.filter.png"), ".png")); + +} // class FileFilters Property changes on: trunk/utils/src/app/net/sf/gridarta/gui/utils/FileFilters.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java (from rev 8335, trunk/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java) =================================================================== --- trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java (rev 0) +++ trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -0,0 +1,85 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.gui.utils; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import javax.swing.filechooser.FileFilter; +import net.sf.japi.util.filter.file.AbstractFileFilter; + +/** + * A FileFilter that wraps another FileFilter and filters out CVS and .xvpics + * files. The description and other filtering are taken from the wrapped file + * filter. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class HideFileFilterProxy extends AbstractFileFilter { + + /** + * The other file filter. + */ + private final FileFilter other; + + /** + * The default rejected directory names. + */ + private static final Collection<String> REJECTED_DIRECTORY_NAMES = Arrays.asList("CVS"); + + /** + * The rejected directory names. + */ + private final Collection<String> rejectedDirectoryNames = new ArrayList<String>(); + + /** + * Create a HideFileFilterProxy. + * @param other FileFilter to wrap + */ + public HideFileFilterProxy(final FileFilter other) { + this.other = other; + rejectedDirectoryNames.addAll(REJECTED_DIRECTORY_NAMES); + } + + /** + * {@inheritDoc} Returns the description from the {@link #other} + * FileFilter. + */ + @Override + public String getDescription() { + return other.getDescription(); + } + + /** + * {@inheritDoc} First checks whether the file should be hidden, if not, + * checks the other FileFilter. + */ + @SuppressWarnings({ "ParameterNameDiffersFromOverriddenParameter" }) + @Override + public boolean accept(final File pathName) { + if (pathName.getName().startsWith(".")) { + return false; + } + // XXX suppression for Bug in IDEA + //noinspection RedundantCast + return !(pathName.isDirectory() && rejectedDirectoryNames.contains(pathName.getName())) && ((java.io.FileFilter) other).accept(pathName); + } + +} // class HideFileFilterProxy Property changes on: trunk/utils/src/app/net/sf/gridarta/gui/utils/HideFileFilterProxy.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java (from rev 8335, trunk/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java) =================================================================== --- trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java (rev 0) +++ trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java 2010-06-10 08:11:15 UTC (rev 8338) @@ -0,0 +1,109 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.gui.utils; + +import java.io.File; +import javax.swing.filechooser.FileFilter; +import net.sf.japi.util.filter.file.AbstractFileFilter; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test for {@link HideFileFilterProxy}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class HideFileFilterProxyTest { + + /** + * Object Under Test: A HideFileFilterProxy. + */ + private FileFilter oUT; + + /** + * Test case for {@link HideFileFilterProxy#HideFileFilterProxy(FileFilter)}. + */ + @Test + public void testHideFileFilterProxy() { + oUT = new HideFileFilterProxy(new MockFileFilter(true)); + } + + /** + * Test case for {@link HideFileFilterProxy#getDescription()}. + */ + @Test + public void testGetDescription() { + oUT = new HideFileFilterProxy(new MockFileFilter(true)); + Assert.assertEquals("MOCK", oUT.getDescription()); + } + + /** + * Test case for {@link HideFileFilterProxy#accept(File)}. + */ + @Test + public void testAccept() { + oUT = new HideFileFilterProxy(new MockFileFilter(true)); + Assert.assertTrue(oUT.accept(new File("foobar"))); + //Assert.assertFalse(oUT.accept(new File("CVS"))); + Assert.assertFalse(oUT.accept(new File(".svn"))); + oUT = new HideFileFilterProxy(new MockFileFilter(false)); + Assert.assertFalse(oUT.accept(new File("foobar"))); + //Assert.assertFalse(oUT.accept(new File("CVS"))); + Assert.assertFalse(oUT.accept(new File(".svn"))); + } + + /** + * Mock File Filter that's used as parent file filter for the + * HideFileFilterProxy under test. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ + private static class MockFileFilter extends AbstractFileFilter { + + /** + * Whether this file filter will accept or reject files. + */ + private final boolean accepts; + + /** + * Create a MockFileFilter. + * @param accepts Whether this file filter will accept or reject files. + */ + private MockFileFilter(final boolean accepts) { + this.accepts = accepts; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean accept(final File f) { + return accepts; + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() { + return "MOCK"; + } + + } // class MockFileFilter + +} // class HideFileFilterProxyTest Property changes on: trunk/utils/src/test/net/sf/gridarta/gui/utils/HideFileFilterProxyTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/utils.iml =================================================================== --- trunk/utils.iml 2010-06-10 07:57:21 UTC (rev 8337) +++ trunk/utils.iml 2010-06-10 08:11:15 UTC (rev 8338) @@ -43,6 +43,15 @@ <SOURCES /> </library> </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/japi-lib-util-trunk-1379.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> </component> </module> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 08:19:23
|
Revision: 8340 http://gridarta.svn.sourceforge.net/gridarta/?rev=8340&view=rev Author: akirschbaum Date: 2010-06-10 08:19:15 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Move code to common code base. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/CollectedResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -103,7 +103,7 @@ */ @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { archetypeSet.setLoadedFromArchive(true); // load from the collected files Map<String, String> animations = null; try { Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/resource/FilesResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -19,73 +19,34 @@ package net.sf.gridarta.var.atrinik.resource; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; -import net.sf.gridarta.model.io.AnimationObjectsReader; -import net.sf.gridarta.model.resource.AbstractResourcesReader; -import net.sf.gridarta.utils.Pair; +import net.sf.gridarta.model.resource.AbstractFilesResourcesReader; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { +public class FilesResourcesReader extends AbstractFilesResourcesReader<GameObject, MapArchObject, Archetype> { /** - * The logger for printing log messages. - */ - private static final Category log = Logger.getLogger(FilesResourcesReader.class); - - /** * The "arch" directory to read. */ @NotNull private final File archDirectory; /** - * The {@link ArchetypeSet} to update. - */ - @NotNull - private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; - - /** - * The {@link AbstractArchetypeParser} to use. - */ - @NotNull - private final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser; - - /** - * The {@link AnimationObjects} to use. - */ - @NotNull - private final AnimationObjects animationObjects; - - /** * The {@link ArchFaceProvider} to use. */ @NotNull @@ -102,11 +63,8 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, null, animationObjects, faceObjects); + super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; - this.archetypeSet = archetypeSet; - this.archetypeParser = archetypeParser; - this.animationObjects = animationObjects; this.archFaceProvider = archFaceProvider; } @@ -115,158 +73,17 @@ */ @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { - archetypeSet.setLoadedFromArchive(false); - final int animationObjectsSize = animationObjects.size(); - final int archetypeCount = archetypeSet.getArchetypeCount(); - final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { addPNGFace(new File(archDirectory, "dev/editor/bug.101.png").getAbsolutePath(), "/dev/editor", "bug.101.png", errorView, archFaceProvider); - final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); - loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); - if (log.isInfoEnabled()) { - log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + (archetypeSet.getArchetypeCount() - archetypeCount) + " archetypes from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + archFaceProvider.size() + " faces from '" + archDirectory + "'."); - } - return archFaceProvider; + return super.read(errorView, invObjects); } /** - * Loads all archetypes and faces by recursing through the - * <code>arch/</code> directory tree. - * @param errorViewCollector the error view collector for reporting errors - * @param archetypeParser the archetype parser to use - * @param path the base directory relative path of <code>f</code> - * @param f file path where we currently are - * @param folderLevel level of the folder - * @param panelName the panel to add archetypes to - * @param folderName the folder to add archetypes to - * @param invObjects collects all inventory objects - * @param archFaceProvider the arch face provider to add to - * @param errorView the error view to use - * @param animFiles the found animation files + * {@inheritDoc} */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { - final String name = f.getName(); - if (f.isDirectory()) { - // now, setup the arch panels - if (isValidEntry(folderLevel, name)) { - final String[] entries = f.list(); - if (entries != null) { - Arrays.sort(entries); - final String thisPanelName = folderLevel == 1 ? name : panelName; - final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; - final String newPath = path.length() == 0 ? "" : path + "/" + name; - for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); - } - } else { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); - } - } - } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { - try { - final FileInputStream fis = new FileInputStream(f); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final BufferedReader in = new BufferedReader(isr); - try { - archetypeParser.parseArchetypeFromStream(in, null, null, null, panelName, folderName, "", invObjects, new ErrorViewCollector(errorView, f)); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); - } - } else if (FileFilters.pngFileFilter.accept(f)) { - if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { - addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); - } - } else if (FileFilters.faceFileFilter.accept(f)) { - parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { - animFiles.add(new Pair<String, File>(path, f)); - } - } - } - - /** - * Returns whether a file name should be processed. - * @param folderLevel the folder level - * @param name the base name of the file name - * @return whether the entry is valid and shoudl be processed - */ - private boolean isValidEntry(final int folderLevel, final String name) { + @Override + protected boolean isValidEntry(final int folderLevel, final String name) { return folderLevel != 1 || !name.equalsIgnoreCase("dev"); } - /** - * Loads a .face file. - * @param errorView the error view for reporting errors - * @param path the base directory relative path of <code>filename</code> - * @param filename filename - */ - private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { - final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); - try { - final FileInputStream fis = new FileInputStream(path); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final Reader in = new BufferedReader(isr); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); - } - } - - /** - * This method loads animations that are separately defined by looping - * through all files that were previously collected by {@link - * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, - * String, File, int, String, String, List, ArchFaceProvider, ErrorView, - * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> - * wasn't invoked. - * @param errorViewCollector the error view collector for reporting errors - * @param animFiles the animation files - */ - private void loadAnimationsFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Iterable<Pair<String, File>> animFiles) { - for (final Pair<String, File> pair : animFiles) { - final String animPath = pair.getFirst(); - final File animFile = pair.getSecond(); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_ENTRY_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage() + ", " + animFile); - } - } - } - } // class FilesResourcesReader Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/CollectedResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -121,7 +121,7 @@ */ @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { archetypeSet.setLoadedFromArchive(true); Map<String, String> animations = null; try { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/resource/FilesResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -19,79 +19,25 @@ package net.sf.gridarta.var.crossfire.resource; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; -import net.sf.gridarta.model.errorview.ErrorView; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; -import net.sf.gridarta.model.face.FaceProvider; -import net.sf.gridarta.model.io.AnimationObjectsReader; -import net.sf.gridarta.model.resource.AbstractResourcesReader; -import net.sf.gridarta.utils.Pair; +import net.sf.gridarta.model.resource.AbstractFilesResourcesReader; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { +public class FilesResourcesReader extends AbstractFilesResourcesReader<GameObject, MapArchObject, Archetype> { /** - * The logger for printing log messages. - */ - private static final Category log = Logger.getLogger(FilesResourcesReader.class); - - /** - * The "arch" directory to read. - */ - @NotNull - private final File archDirectory; - - /** - * The {@link ArchetypeSet} to update. - */ - @NotNull - private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; - - /** - * The {@link AbstractArchetypeParser} to use. - */ - @NotNull - private final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser; - - /** - * The {@link AnimationObjects} to use. - */ - @NotNull - private final AnimationObjects animationObjects; - - /** - * The {@link ArchFaceProvider} to use. - */ - @NotNull - private final ArchFaceProvider archFaceProvider; - - /** * Creates a new instance. * @param archDirectory the "arch" directory to read * @param collectedDirectory the collected directory @@ -102,170 +48,15 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); - this.archDirectory = archDirectory; - this.archetypeSet = archetypeSet; - this.archetypeParser = archetypeParser; - this.animationObjects = animationObjects; - this.archFaceProvider = archFaceProvider; + super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, archetypeSet.getImageSet(), animationObjects, faceObjects); } /** * {@inheritDoc} */ - @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { - archetypeSet.setLoadedFromArchive(false); - final int animationObjectsSize = animationObjects.size(); - final int archetypeCount = archetypeSet.getArchetypeCount(); - final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); - final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); - loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); - if (log.isInfoEnabled()) { - log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + (archetypeSet.getArchetypeCount() - archetypeCount) + " archetypes from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + archFaceProvider.size() + " faces from '" + archDirectory + "'."); - } - return archFaceProvider; - } - - /** - * Loads all archetypes and faces by recursing through the - * <code>arch/</code> directory tree. - * @param errorViewCollector the error view collector for reporting errors - * @param archetypeParser the archetype parser to use - * @param path the base directory relative path of <code>f</code> - * @param f file path where we currently are - * @param folderLevel level of the folder - * @param panelName the panel to add archetypes to - * @param folderName the folder to add archetypes to - * @param invObjects collects all inventory objects - * @param archFaceProvider the arch face provider to add to - * @param errorView the error view to use - * @param animFiles the found animation files - */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { - final String name = f.getName(); - if (f.isDirectory()) { - // now, setup the arch panels - if (isValidEntry(folderLevel, name)) { - final String[] entries = f.list(); - if (entries != null) { - Arrays.sort(entries); - final String thisPanelName = folderLevel == 1 ? name : panelName; - final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; - final String newPath = path.length() == 0 ? "" : path + "/" + name; - for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); - } - } else { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); - } - } - } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { - try { - final FileInputStream fis = new FileInputStream(f); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final BufferedReader in = new BufferedReader(isr); - try { - archetypeParser.parseArchetypeFromStream(in, null, null, null, panelName, folderName, "", invObjects, new ErrorViewCollector(errorView, f)); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); - } - } else if (FileFilters.pngFileFilter.accept(f)) { - if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { - addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); - } - } else if (FileFilters.faceFileFilter.accept(f)) { - parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { - animFiles.add(new Pair<String, File>(path, f)); - } - } - } - - /** - * Returns whether a file name should be processed. - * @param folderLevel the folder level - * @param name the base name of the file name - * @return whether the entry is valid and shoudl be processed - */ - private boolean isValidEntry(final int folderLevel, final String name) { + protected boolean isValidEntry(final int folderLevel, final String name) { return !name.equalsIgnoreCase("cvs") && !name.equalsIgnoreCase("dev") && !name.startsWith("."); } - /** - * Loads a .face file. - * @param errorView the error view for reporting errors - * @param path the base directory relative path of <code>filename</code> - * @param filename filename - */ - private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { - final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); - try { - final FileInputStream fis = new FileInputStream(path); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final Reader in = new BufferedReader(isr); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); - } - } - - /** - * This method loads animations that are separately defined by looping - * through all files that were previously collected by {@link - * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, - * String, File, int, String, String, List, ArchFaceProvider, ErrorView, - * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> - * wasn't invoked. - * @param errorViewCollector the error view collector for reporting errors - * @param animFiles the animation files - */ - private void loadAnimationsFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Iterable<Pair<String, File>> animFiles) { - for (final Pair<String, File> pair : animFiles) { - final String animPath = pair.getFirst(); - final File animFile = pair.getSecond(); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_ENTRY_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage() + ", " + animFile); - } - } - } - } // class FilesResourcesReader Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/CollectedResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -103,7 +103,7 @@ */ @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { archetypeSet.setLoadedFromArchive(true); // load from the collected files Map<String, String> animations = null; try { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/resource/FilesResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -19,73 +19,34 @@ package net.sf.gridarta.var.daimonin.resource; -import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.List; -import net.sf.gridarta.gui.utils.FileFilters; import net.sf.gridarta.model.anim.AnimationObjects; -import net.sf.gridarta.model.anim.AnimationParseException; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.errorview.ErrorView; -import net.sf.gridarta.model.errorview.ErrorViewCategory; -import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.FaceObjects; import net.sf.gridarta.model.face.FaceProvider; -import net.sf.gridarta.model.io.AnimationObjectsReader; -import net.sf.gridarta.model.resource.AbstractResourcesReader; -import net.sf.gridarta.utils.Pair; +import net.sf.gridarta.model.resource.AbstractFilesResourcesReader; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** * Loads all resources from individual files. * @author Andreas Kirschbaum */ -public class FilesResourcesReader extends AbstractResourcesReader<GameObject, MapArchObject, Archetype> { +public class FilesResourcesReader extends AbstractFilesResourcesReader<GameObject, MapArchObject, Archetype> { /** - * The logger for printing log messages. - */ - private static final Category log = Logger.getLogger(FilesResourcesReader.class); - - /** * The "arch" directory to read. */ @NotNull private final File archDirectory; /** - * The {@link ArchetypeSet} to update. - */ - @NotNull - private final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet; - - /** - * The {@link AbstractArchetypeParser} to use. - */ - @NotNull - private final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser; - - /** - * The {@link AnimationObjects} to use. - */ - @NotNull - private final AnimationObjects animationObjects; - - /** * The {@link ArchFaceProvider} to use. */ @NotNull @@ -102,11 +63,8 @@ * @param archFaceProvider the arch face provider to use */ public FilesResourcesReader(@NotNull final File archDirectory, @NotNull final File collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects animationObjects, @NotNull final ArchFaceProvider archFaceProvider) { - super(collectedDirectory, null, animationObjects, faceObjects); + super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); this.archDirectory = archDirectory; - this.archetypeSet = archetypeSet; - this.archetypeParser = archetypeParser; - this.animationObjects = animationObjects; this.archFaceProvider = archFaceProvider; } @@ -115,158 +73,17 @@ */ @NotNull @Override - protected FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { - archetypeSet.setLoadedFromArchive(false); - final int animationObjectsSize = animationObjects.size(); - final int archetypeCount = archetypeSet.getArchetypeCount(); - final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<GameObject> invObjects) { addPNGFace(new File(archDirectory, "dev/editor/bug.101.png").getAbsolutePath(), "/dev/editor", "bug.101.png", errorView, archFaceProvider); - final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); - loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); - loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); - if (log.isInfoEnabled()) { - log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + (archetypeSet.getArchetypeCount() - archetypeCount) + " archetypes from '" + archDirectory + "'."); - } - if (log.isInfoEnabled()) { - log.info("Loaded " + archFaceProvider.size() + " faces from '" + archDirectory + "'."); - } - return archFaceProvider; + return super.read(errorView, invObjects); } /** - * Loads all archetypes and faces by recursing through the - * <code>arch/</code> directory tree. - * @param errorViewCollector the error view collector for reporting errors - * @param archetypeParser the archetype parser to use - * @param path the base directory relative path of <code>f</code> - * @param f file path where we currently are - * @param folderLevel level of the folder - * @param panelName the panel to add archetypes to - * @param folderName the folder to add archetypes to - * @param invObjects collects all inventory objects - * @param archFaceProvider the arch face provider to add to - * @param errorView the error view to use - * @param animFiles the found animation files + * {@inheritDoc} */ - private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<GameObject> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { - final String name = f.getName(); - if (f.isDirectory()) { - // now, setup the arch panels - if (isValidEntry(folderLevel, name)) { - final String[] entries = f.list(); - if (entries != null) { - Arrays.sort(entries); - final String thisPanelName = folderLevel == 1 ? name : panelName; - final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; - final String newPath = path.length() == 0 ? "" : path + "/" + name; - for (final String entry : entries) { - loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); - } - } else { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); - } - } - } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! - if (FileFilters.arcFileFilter.accept(f)) { - try { - final FileInputStream fis = new FileInputStream(f); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final BufferedReader in = new BufferedReader(isr); - try { - archetypeParser.parseArchetypeFromStream(in, null, null, null, panelName, folderName, "", invObjects, new ErrorViewCollector(errorView, f)); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); - } - } else if (FileFilters.pngFileFilter.accept(f)) { - if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { - addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); - } - } else if (FileFilters.faceFileFilter.accept(f)) { - parseDefFace(errorView, f.getAbsolutePath(), path); - } else if (FileFilters.animFileFilter.accept(f)) { - animFiles.add(new Pair<String, File>(path, f)); - } - } - } - - /** - * Returns whether a file name should be processed. - * @param folderLevel the folder level - * @param name the base name of the file name - * @return whether the entry is valid and shoudl be processed - */ - private boolean isValidEntry(final int folderLevel, final String name) { + @Override + protected boolean isValidEntry(final int folderLevel, final String name) { return folderLevel != 1 || !name.equalsIgnoreCase("dev"); } - /** - * Loads a .face file. - * @param errorView the error view for reporting errors - * @param path the base directory relative path of <code>filename</code> - * @param filename filename - */ - private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { - final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); - try { - final FileInputStream fis = new FileInputStream(path); - try { - final InputStreamReader isr = new InputStreamReader(fis); - try { - final Reader in = new BufferedReader(isr); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); - } finally { - in.close(); - } - } finally { - isr.close(); - } - } finally { - fis.close(); - } - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); - } - } - - /** - * This method loads animations that are separately defined by looping - * through all files that were previously collected by {@link - * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, - * String, File, int, String, String, List, ArchFaceProvider, ErrorView, - * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> - * wasn't invoked. - * @param errorViewCollector the error view collector for reporting errors - * @param animFiles the animation files - */ - private void loadAnimationsFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Iterable<Pair<String, File>> animFiles) { - for (final Pair<String, File> pair : animFiles) { - final String animPath = pair.getFirst(); - final File animFile = pair.getSecond(); - try { - AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); - } catch (final IOException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); - } catch (final AnimationParseException ex) { - errorViewCollector.addWarning(ErrorViewCategory.ANIM_ENTRY_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage() + ", " + animFile); - } - } - } - } // class FilesResourcesReader Added: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -0,0 +1,271 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.model.resource; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import net.sf.gridarta.gui.utils.FileFilters; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.AnimationParseException; +import net.sf.gridarta.model.archetype.AbstractArchetypeParser; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.errorview.ErrorView; +import net.sf.gridarta.model.errorview.ErrorViewCategory; +import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.face.FaceProvider; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.AnimationObjectsReader; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.utils.Pair; +import org.apache.log4j.Category; +import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Abstract base class for {@link AbstractResourcesReader + * AbstractResourcesReaders} that read from individual files. + * @author Andreas Kirschbaum + */ +public abstract class AbstractFilesResourcesReader<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractResourcesReader<G, A, R> { + + /** + * The logger for printing log messages. + */ + private static final Category log = Logger.getLogger(AbstractFilesResourcesReader.class); + + /** + * The "arch" directory to read. + */ + @NotNull + private final File archDirectory; + + /** + * The {@link ArchetypeSet} to update. + */ + @NotNull + private final ArchetypeSet<G, A, R> archetypeSet; + + /** + * The {@link AbstractArchetypeParser} to use. + */ + @NotNull + private final AbstractArchetypeParser<G, A, R, ?> archetypeParser; + + /** + * The {@link AnimationObjects} to use. + */ + @NotNull + private final AnimationObjects animationObjects; + + /** + * The {@link ArchFaceProvider} to use. + */ + @NotNull + private final ArchFaceProvider archFaceProvider; + + /** + * Creates a new instance. + * @param archDirectory the "arch" directory to read + * @param archetypeSet the archetype set to update + * @param archetypeParser the archetype parser to use + * @param archFaceProvider the arch face provider to use + * @param collectedDirectory the collected directory + * @param imageSet the active image set or <code>null</code> + * @param animationObjects the animation objects instance + * @param faceObjects the face objects instance + */ + protected AbstractFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + super(collectedDirectory, imageSet, animationObjects, faceObjects); + this.archDirectory = archDirectory; + this.archetypeSet = archetypeSet; + this.archetypeParser = archetypeParser; + this.archFaceProvider = archFaceProvider; + this.animationObjects = animationObjects; + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<G> invObjects) { + archetypeSet.setLoadedFromArchive(false); + final int animationObjectsSize = animationObjects.size(); + final int archetypeCount = archetypeSet.getArchetypeCount(); + final Collection<Pair<String, File>> animFiles = new ArrayList<Pair<String, File>>(); + final ErrorViewCollector archDirectoryErrorViewCollector = new ErrorViewCollector(errorView, archDirectory); + loadArchetypesFromFiles(archDirectoryErrorViewCollector, archetypeParser, "", archDirectory, 0, "default", "default", invObjects, archFaceProvider, errorView, animFiles); + loadAnimationsFromFiles(archDirectoryErrorViewCollector, animFiles); + if (log.isInfoEnabled()) { + log.info("Loaded " + (animationObjects.size() - animationObjectsSize) + " animations from '" + archDirectory + "'."); + } + if (log.isInfoEnabled()) { + log.info("Loaded " + (archetypeSet.getArchetypeCount() - archetypeCount) + " archetypes from '" + archDirectory + "'."); + } + if (log.isInfoEnabled()) { + log.info("Loaded " + archFaceProvider.size() + " faces from '" + archDirectory + "'."); + } + return archFaceProvider; + } + + /** + * Loads all archetypes and faces by recursing through the + * <code>arch/</code> directory tree. + * @param errorViewCollector the error view collector for reporting errors + * @param archetypeParser the archetype parser to use + * @param path the base directory relative path of <code>f</code> + * @param f file path where we currently are + * @param folderLevel level of the folder + * @param panelName the panel to add archetypes to + * @param folderName the folder to add archetypes to + * @param invObjects collects all inventory objects + * @param archFaceProvider the arch face provider to add to + * @param errorView the error view to use + * @param animFiles the found animation files + */ + private void loadArchetypesFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List<G> invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection<Pair<String, File>> animFiles) { + final String name = f.getName(); + if (f.isDirectory()) { + // now, setup the arch panels + if (isValidEntry(folderLevel, name)) { + final String[] entries = f.list(); + if (entries != null) { + Arrays.sort(entries); + final String thisPanelName = folderLevel == 1 ? name : panelName; + final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; + final String newPath = path.length() == 0 ? "" : path + "/" + name; + for (final String entry : entries) { + loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); + } + } else { + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_DIR_INVALID, f.getPath()); + } + } + } else if (f.isFile()) { // watch out for stuff that's not a file and not a directory!!! + if (FileFilters.arcFileFilter.accept(f)) { + try { + final FileInputStream fis = new FileInputStream(f); + try { + final InputStreamReader isr = new InputStreamReader(fis); + try { + final BufferedReader in = new BufferedReader(isr); + try { + archetypeParser.parseArchetypeFromStream(in, null, null, null, panelName, folderName, "", invObjects, new ErrorViewCollector(errorView, f)); + } finally { + in.close(); + } + } finally { + isr.close(); + } + } finally { + fis.close(); + } + } catch (final IOException ex) { + new ErrorViewCollector(errorView, f).addWarning(ErrorViewCategory.ARCHETYPE_FILE_INVALID, ex.getMessage()); + } + } else if (FileFilters.pngFileFilter.accept(f)) { + if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { + addPNGFace(f.getAbsolutePath(), path, name, errorView, archFaceProvider); + } + } else if (FileFilters.faceFileFilter.accept(f)) { + parseDefFace(errorView, f.getAbsolutePath(), path); + } else if (FileFilters.animFileFilter.accept(f)) { + animFiles.add(new Pair<String, File>(path, f)); + } + } + } + + /** + * Loads a .face file. + * @param errorView the error view for reporting errors + * @param path the base directory relative path of <code>filename</code> + * @param filename filename + */ + private void parseDefFace(@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename) { + final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, new File(path)); + try { + final FileInputStream fis = new FileInputStream(path); + try { + final InputStreamReader isr = new InputStreamReader(fis); + try { + final Reader in = new BufferedReader(isr); + try { + AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, in, "animation ", true, filename, null); + } finally { + in.close(); + } + } finally { + isr.close(); + } + } finally { + fis.close(); + } + } catch (final IOException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, ex.getMessage()); + } catch (final AnimationParseException ex) { + errorViewCollector.addWarning(ErrorViewCategory.FACE_FILE_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage()); + } + } + + /** + * This method loads animations that are separately defined by looping + * through all files that were previously collected by {@link + * #loadArchetypesFromFiles(ErrorViewCollector, AbstractArchetypeParser, + * String, File, int, String, String, List, ArchFaceProvider, ErrorView, + * Collection)}. Do not invoke this method if <code>loadArchetypesFromFiles()</code> + * wasn't invoked. + * @param errorViewCollector the error view collector for reporting errors + * @param animFiles the animation files + */ + private void loadAnimationsFromFiles(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Iterable<Pair<String, File>> animFiles) { + for (final Pair<String, File> pair : animFiles) { + final String animPath = pair.getFirst(); + final File animFile = pair.getSecond(); + try { + AnimationObjectsReader.loadAnimations(animationObjects, errorViewCollector, animPath, animFile, "anim ", false); + } catch (final IOException ex) { + errorViewCollector.addWarning(ErrorViewCategory.ANIM_FILE_INVALID, ex.getMessage() + ", " + animFile); + } catch (final AnimationParseException ex) { + errorViewCollector.addWarning(ErrorViewCategory.ANIM_ENTRY_INVALID, "line " + ex.getLineNumber() + ": parsing error: " + ex.getMessage() + ", " + animFile); + } + } + } + + /** + * Returns whether a file name should be processed. + * @param folderLevel the folder level + * @param name the base name of the file name + * @return whether the entry is valid and should be processed + */ + protected abstract boolean isValidEntry(final int folderLevel, final String name); + +} // class AbstractFilesResourcesReader Property changes on: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-10 08:11:55 UTC (rev 8339) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractResourcesReader.java 2010-06-10 08:19:15 UTC (rev 8340) @@ -213,7 +213,7 @@ * @return the face provider for accessing the read faces */ @NotNull - protected abstract FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<G> invObjects); + public abstract FaceProvider read(@NotNull final ErrorView errorView, @NotNull final List<G> invObjects); /** * Loads animations from a file. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-10 18:03:03
|
Revision: 8345 http://gridarta.svn.sourceforge.net/gridarta/?rev=8345&view=rev Author: akirschbaum Date: 2010-06-10 18:02:56 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Fix path names in face and animation chooser. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/resource/ trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-10 18:01:26 UTC (rev 8344) +++ trunk/atrinik/ChangeLog 2010-06-10 18:02:56 UTC (rev 8345) @@ -1,5 +1,7 @@ 2010-06-10 Andreas Kirschbaum + * Fix path names in face and animation chooser. + * Add support for "*.face" files in arch directory. 2010-06-09 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-10 18:01:26 UTC (rev 8344) +++ trunk/crossfire/ChangeLog 2010-06-10 18:02:56 UTC (rev 8345) @@ -1,5 +1,7 @@ 2010-06-10 Andreas Kirschbaum + * Fix path names in face and animation chooser. + * Add support for "*.anim" files in arch directory. 2010-06-09 Andreas Kirschbaum Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-10 18:01:26 UTC (rev 8344) +++ trunk/daimonin/ChangeLog 2010-06-10 18:02:56 UTC (rev 8345) @@ -1,5 +1,7 @@ 2010-06-10 Andreas Kirschbaum + * Fix path names in face and animation chooser. + * Add support for "*.face" files in arch directory. 2010-06-09 Andreas Kirschbaum Modified: trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-06-10 18:01:26 UTC (rev 8344) +++ trunk/model/src/app/net/sf/gridarta/model/resource/AbstractFilesResourcesReader.java 2010-06-10 18:02:56 UTC (rev 8345) @@ -162,7 +162,7 @@ Arrays.sort(entries); final String thisPanelName = folderLevel == 1 ? name : panelName; final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; - final String newPath = path.length() == 0 ? "" : path + "/" + name; + final String newPath = folderLevel == 0 ? "" : path + "/" + name; for (final String entry : entries) { loadArchetypesFromFiles(errorViewCollector, archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, invObjects, archFaceProvider, errorView, animFiles); } Added: trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java 2010-06-10 18:02:56 UTC (rev 8345) @@ -0,0 +1,186 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.model.resource; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; +import net.sf.gridarta.model.anim.AnimationObject; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; +import net.sf.gridarta.model.archetype.AbstractArchetypeParser; +import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.archetype.TestArchetypeBuilder; +import net.sf.gridarta.model.archetype.TestArchetypeFactory; +import net.sf.gridarta.model.archetype.TestArchetypeParser; +import net.sf.gridarta.model.archetype.TestArchetypeSet; +import net.sf.gridarta.model.errorview.ErrorView; +import net.sf.gridarta.model.errorview.TestErrorView; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.DefaultFaceObjects; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.gameobject.TestGameObjectFactory; +import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import org.jetbrains.annotations.NotNull; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link AbstractFilesResourcesReader}. + * @author Andreas Kirschbaum + */ +public class AbstractFilesResourcesReaderTest { + + /** + * checks that animations read from .anim files have correct path names. + * @throws IOException if the test fails + */ + @Test + public void testAnimationPaths() throws IOException { + final File tmpDirectory = File.createTempFile("gridarta", null); + try { + Assert.assertTrue(tmpDirectory.delete()); + Assert.assertTrue(tmpDirectory.mkdir()); + final File archDirectory = new File(tmpDirectory, "archetypes"); + Assert.assertTrue(archDirectory.mkdir()); + final File collectedDirectory = new File(tmpDirectory, "collected"); + Assert.assertTrue(collectedDirectory.mkdir()); + createAnimationFile(archDirectory, "anim1"); + createAnimationFile(new File(archDirectory, "p"), "anim2"); + createAnimationFile(new File(new File(new File(archDirectory, "p"), "q"), "r"), "anim3"); + + final AnimationObjects animationObjects = readAnimations(archDirectory, collectedDirectory); + + Assert.assertEquals(3, animationObjects.size()); + final AnimationObject anim1 = animationObjects.get("anim1"); + final AnimationObject anim2 = animationObjects.get("anim2"); + final AnimationObject anim3 = animationObjects.get("anim3"); + Assert.assertNotNull(anim1); + Assert.assertNotNull(anim2); + Assert.assertNotNull(anim3); + Assert.assertEquals("anim1", anim1.getAnimName()); + Assert.assertEquals("anim2", anim2.getAnimName()); + Assert.assertEquals("anim3", anim3.getAnimName()); + Assert.assertEquals("/anim1", anim1.getPath()); + Assert.assertEquals("/p/anim2", anim2.getPath()); + Assert.assertEquals("/p/q/r/anim3", anim3.getPath()); + } finally { + delete(tmpDirectory); + } + } + + /** + * Reads resources from individual files. + * @param archDirectory the arch directory + * @param collectedDirectory the collected directory + * @return the animation objects instance + */ + @NotNull + private static AnimationObjects readAnimations(@NotNull final File archDirectory, @NotNull final File collectedDirectory) { + final ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> archetypeFactory = new TestArchetypeFactory(); + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects faceObjects = new DefaultFaceObjects(new File(collectedDirectory, "gridarta.0").getPath(), new File(collectedDirectory, "facetree").getPath(), Pattern.compile(""), "", archFaceProvider); + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); + final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = new TestArchetypeSet(archetypeFactory, new File(collectedDirectory, "archetypes").getPath(), faceObjectProviders); + final AnimationObjects animationObjects = new DefaultAnimationObjects(new File(collectedDirectory, "animtree").getPath()); + final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); + final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); + final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, ?> archetypeParser = new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); + final AbstractResourcesReader<TestGameObject, TestMapArchObject, TestArchetype> filesResourcesReader = new TestFilesResourcesReader(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, null, animationObjects, faceObjects); + final List<TestGameObject> invObjects = new ArrayList<TestGameObject>(); + final ErrorView errorView = new TestErrorView(); + filesResourcesReader.read(errorView, invObjects); + return animationObjects; + } + + /** + * Creates a new .anim file. + * @param directory the directory to create the file in; will be created if + * it does not yet exist + * @param animName the name of the animation + * @throws IOException if an I/O error occurs + */ + private static void createAnimationFile(@NotNull final File directory, @NotNull final String animName) throws IOException { + if (!directory.isDirectory()) { + Assert.assertTrue(directory.mkdirs()); + } + + final File file = new File(directory, animName + ".anim"); + Assert.assertFalse(file.exists()); + final OutputStream fileOutputStream = new FileOutputStream(file); + try { + final Writer outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF-8"); + try { + final Writer bufferedWriter = new BufferedWriter(outputStreamWriter); + try { + bufferedWriter.append("anim ").append(animName).append("\n"); + bufferedWriter.append("face1\n"); + bufferedWriter.append("face2\n"); + bufferedWriter.append("mina\n"); + } finally { + bufferedWriter.close(); + } + } finally { + outputStreamWriter.close(); + } + } finally { + fileOutputStream.close(); + } + } + + /** + * Recursively deletes a directory. + * @param file the file or directory to delete + */ + private static void delete(@NotNull final File file) { + //noinspection ResultOfMethodCallIgnored + file.delete(); + + if (file.isDirectory()) { + final File[] files = file.listFiles(); + if (files != null) { + for (final File subFile : files) { + delete(subFile); + } + } + } + + if (file.exists()) { + Assert.assertTrue(file.delete()); + } + } + +} // class AbstractFilesResourcesReaderTest Property changes on: trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.java 2010-06-10 18:02:56 UTC (rev 8345) @@ -0,0 +1,60 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.model.resource; + +import java.io.File; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.archetype.AbstractArchetypeParser; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * An {@link AbstractFilesResourcesReader} for regression tests. + * @author Andreas Kirschbaum + */ +public class TestFilesResourcesReader extends AbstractFilesResourcesReader<TestGameObject, TestMapArchObject, TestArchetype> { + + /** + * Creates a new instance. + * @param archDirectory the "arch" directory to read + * @param archetypeSet the archetype set to update + * @param archetypeParser the archetype parser to use + * @param archFaceProvider the arch face provider to use + * @param collectedDirectory the collected directory + * @param imageSet the active image set or <code>null</code> + * @param animationObjects the animation objects instance + * @param faceObjects the face objects instance + */ + public TestFilesResourcesReader(@NotNull final File archDirectory, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet, @NotNull final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects) { + super(archDirectory, archetypeSet, archetypeParser, archFaceProvider, collectedDirectory, imageSet, animationObjects, faceObjects); + } + + @Override + protected boolean isValidEntry(final int folderLevel, final String name) { + return true; + } + +} // class TestFilesResourcesReader Property changes on: trunk/model/src/test/net/sf/gridarta/model/resource/TestFilesResourcesReader.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...> - 2010-06-10 18:16:55
|
Revision: 8346 http://gridarta.svn.sourceforge.net/gridarta/?rev=8346&view=rev Author: akirschbaum Date: 2010-06-10 18:16:49 +0000 (Thu, 10 Jun 2010) Log Message: ----------- Move preferences module to separate directory. Modified Paths: -------------- trunk/atrinik/build.xml trunk/crossfire/build.xml trunk/preferences.iml Added Paths: ----------- trunk/preferences/ trunk/preferences/src/ trunk/preferences/src/app/ trunk/preferences/src/app/net/ trunk/preferences/src/app/net/sf/ trunk/preferences/src/app/net/sf/gridarta/ trunk/preferences/src/app/net/sf/gridarta/preferences/ trunk/preferences/src/test/ Removed Paths: ------------- trunk/src/app/net/sf/gridarta/preferences/ Modified: trunk/atrinik/build.xml =================================================================== --- trunk/atrinik/build.xml 2010-06-10 18:02:56 UTC (rev 8345) +++ trunk/atrinik/build.xml 2010-06-10 18:16:49 UTC (rev 8346) @@ -92,7 +92,7 @@ <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> + <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> <classpath> <fileset dir="${lib.dir}" includes="*.jar"/> <fileset dir="../lib/" includes="*.jar"/> @@ -119,6 +119,7 @@ <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> + <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> </copy> <copy todir="${build.dir.production}"> <fileset dir="${src.dir}" includes="**/*.properties"/> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2010-06-10 18:02:56 UTC (rev 8345) +++ trunk/crossfire/build.xml 2010-06-10 18:16:49 UTC (rev 8346) @@ -90,7 +90,7 @@ <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> + <javac srcdir="${src.dir}:../src/app:../textedit/src/app:../utils/src/app:../model/src/app:../preferences/src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> <classpath> <fileset dir="${lib.dir}" includes="*.jar"/> <fileset dir="../lib/" includes="*.jar"/> @@ -130,6 +130,7 @@ <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../model/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> + <fileset dir="../preferences/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../resource"> <include name="icons/**"/> <include name="log4j.properties"/> @@ -188,6 +189,9 @@ <packageset dir="../model/src/app" defaultexcludes="yes"> <include name="**"/> </packageset> + <packageset dir="../preferences/src/app" defaultexcludes="yes"> + <include name="**"/> + </packageset> <tag name="todo" description="Todo:"/> <tag name="used" description="Manually marked as used." enabled="false"/> <tag name="fixme" description="Fixme:"/> Modified: trunk/preferences.iml =================================================================== --- trunk/preferences.iml 2010-06-10 18:02:56 UTC (rev 8345) +++ trunk/preferences.iml 2010-06-10 18:16:49 UTC (rev 8346) @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="true"> - <content url="file://$MODULE_DIR$/src/app/net/sf/gridarta/preferences"> - <sourceFolder url="file://$MODULE_DIR$/src/app/net/sf/gridarta/preferences" isTestSource="false" packagePrefix="net.sf.gridarta.preferences" /> + <content url="file://$MODULE_DIR$/preferences"> + <sourceFolder url="file://$MODULE_DIR$/preferences/src/app" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/preferences/src/test" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-12 08:00:52
|
Revision: 8347 http://gridarta.svn.sourceforge.net/gridarta/?rev=8347&view=rev Author: akirschbaum Date: 2010-06-12 08:00:42 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Include version and build number in build.number. Modified Paths: -------------- trunk/atrinik/build.xml trunk/crossfire/build.xml trunk/daimonin/build.xml trunk/gridarta.ipr Modified: trunk/atrinik/build.xml =================================================================== --- trunk/atrinik/build.xml 2010-06-10 18:16:49 UTC (rev 8346) +++ trunk/atrinik/build.xml 2010-06-12 08:00:42 UTC (rev 8347) @@ -67,8 +67,10 @@ <tstamp> <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> </tstamp> - <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false"/> - <property name="build.number" value="unknown"/> + <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> + <property name="build.svnversion" value="unknown"/> + <property name="build.version" value="Gridzilla"/> + <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> <echoproperties destfile="build.properties"> <propertyset negate="true"> <propertyref prefix="user.ftp"/> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2010-06-10 18:16:49 UTC (rev 8346) +++ trunk/crossfire/build.xml 2010-06-12 08:00:42 UTC (rev 8347) @@ -64,13 +64,17 @@ <tstamp> <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> </tstamp> - <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false"/> - <property name="build.number" value="unknown"/> + <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> + <property name="build.svnversion" value="unknown"/> + <property name="build.version" value="Gridzilla"/> + <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> <echoproperties destfile="build.properties"> <propertyset> <propertyref prefix="build.developer"/> <propertyref prefix="build.number"/> <propertyref prefix="build.tstamp"/> + <propertyref prefix="build.svnversion"/> + <propertyref prefix="build.version"/> </propertyset> </echoproperties> </target> Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2010-06-10 18:16:49 UTC (rev 8346) +++ trunk/daimonin/build.xml 2010-06-12 08:00:42 UTC (rev 8347) @@ -67,8 +67,10 @@ <tstamp> <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> </tstamp> - <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false"/> - <property name="build.number" value="unknown"/> + <exec executable="svnversion" outputproperty="build.svnversion" failifexecutionfails="false"/> + <property name="build.svnversion" value="unknown"/> + <property name="build.version" value="Gridzilla"/> + <property name="build.number" value="${build.version} (revision ${build.svnversion})"/> <echoproperties destfile="build.properties"> <propertyset negate="true"> <propertyref prefix="user.ftp"/> Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-10 18:16:49 UTC (rev 8346) +++ trunk/gridarta.ipr 2010-06-12 08:00:42 UTC (rev 8347) @@ -1206,6 +1206,7 @@ <w>gridarta</w> <w>gridarta's</w> <w>gridder</w> + <w>gridzilla</w> <w>guildmaster</w> <w>hotkey</w> <w>hprof</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-12 14:22:46
|
Revision: 8355 http://gridarta.svn.sourceforge.net/gridarta/?rev=8355&view=rev Author: akirschbaum Date: 2010-06-12 14:22:40 +0000 (Sat, 12 Jun 2010) Log Message: ----------- Add missing resource keys. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-12 14:16:06 UTC (rev 8354) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-12 14:22:40 UTC (rev 8355) @@ -48,6 +48,10 @@ # and run for the first time. docuVersion=1 +# Supported image set. The values must match the image file names: +# <name>.<image set name>.111 +availableImageSets= + # The default archetype directory. archDirectoryDefault=../arch Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-12 14:16:06 UTC (rev 8354) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-12 14:22:40 UTC (rev 8355) @@ -48,6 +48,10 @@ # and run for the first time. docuVersion=1 +# Supported image set. The values must match the image file names: +# <name>.<image set name>.111 +availableImageSets= + # The default archetype directory. archDirectoryDefault=../arch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-13 09:33:01
|
Revision: 8365 http://gridarta.svn.sourceforge.net/gridarta/?rev=8365&view=rev Author: akirschbaum Date: 2010-06-13 09:32:51 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Add ChangeLog entry for release 0.8. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-13 06:39:16 UTC (rev 8364) +++ trunk/atrinik/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) @@ -1,3 +1,7 @@ +2010-06-13 Andreas Kirschbaum + + * Release 0.8. + 2010-06-10 Andreas Kirschbaum * Fix path names in face and animation chooser. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-13 06:39:16 UTC (rev 8364) +++ trunk/crossfire/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) @@ -1,3 +1,7 @@ +2010-06-13 Andreas Kirschbaum + + * Release 0.8. + 2010-06-12 Andreas Kirschbaum * Collect resources. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-13 06:39:16 UTC (rev 8364) +++ trunk/daimonin/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) @@ -1,3 +1,7 @@ +2010-06-13 Andreas Kirschbaum + + * Release 0.8. + 2010-06-10 Andreas Kirschbaum * Fix path names in face and animation chooser. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-13 10:39:07
|
Revision: 8366 http://gridarta.svn.sourceforge.net/gridarta/?rev=8366&view=rev Author: akirschbaum Date: 2010-06-13 10:39:00 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Fix cursor position after mouse-clicks into script editor. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) +++ trunk/atrinik/ChangeLog 2010-06-13 10:39:00 UTC (rev 8366) @@ -1,5 +1,7 @@ 2010-06-13 Andreas Kirschbaum + * Fix cursor position after mouse-clicks into script editor. + * Release 0.8. 2010-06-10 Andreas Kirschbaum Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) +++ trunk/crossfire/ChangeLog 2010-06-13 10:39:00 UTC (rev 8366) @@ -1,5 +1,7 @@ 2010-06-13 Andreas Kirschbaum + * Fix cursor position after mouse-clicks into script editor. + * Release 0.8. 2010-06-12 Andreas Kirschbaum Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-13 09:32:51 UTC (rev 8365) +++ trunk/daimonin/ChangeLog 2010-06-13 10:39:00 UTC (rev 8366) @@ -1,5 +1,7 @@ 2010-06-13 Andreas Kirschbaum + * Fix cursor position after mouse-clicks into script editor. + * Release 0.8. 2010-06-10 Andreas Kirschbaum Modified: trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2010-06-13 09:32:51 UTC (rev 8365) +++ trunk/textedit/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2010-06-13 10:39:00 UTC (rev 8366) @@ -1666,7 +1666,7 @@ switch (e.getClickCount()) { case 1: - doSingleClick(e, line); + doSingleClick(e, dot); break; case 2: doDoubleClick(line, offset, dot); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-13 11:14:20
|
Revision: 8379 http://gridarta.svn.sourceforge.net/gridarta/?rev=8379&view=rev Author: akirschbaum Date: 2010-06-13 11:14:14 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Move ErrorEntry into correct module and package. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/errorview/ErrorEntry.java Removed Paths: ------------- trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorEntry.java Deleted: trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorEntry.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorEntry.java 2010-06-13 11:12:28 UTC (rev 8378) +++ trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorEntry.java 2010-06-13 11:14:14 UTC (rev 8379) @@ -1,61 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 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.model.errorview; - -import javax.swing.tree.DefaultMutableTreeNode; -import javax.swing.tree.DefaultTreeModel; -import javax.swing.tree.MutableTreeNode; -import org.jetbrains.annotations.NotNull; - -/** - * An entry in a {@link net.sf.gridarta.gui.errorview.DefaultErrorView}. - * @author Andreas Kirschbaum - */ -public class ErrorEntry extends DefaultMutableTreeNode { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** - * The {@link DefaultTreeModel} this instance belongs to. - */ - @NotNull - private final DefaultTreeModel treeModel; - - /** - * Creates a new instance. - * @param treeModel the tree model this instance belongs to - * @param name the name - * @param allowsChildren whether this node allows children - */ - public ErrorEntry(@NotNull final DefaultTreeModel treeModel, @NotNull final String name, final boolean allowsChildren) { - super(name, allowsChildren); - this.treeModel = treeModel; - } - - @Override - public void add(@NotNull final MutableTreeNode newChild) { - super.add(newChild); - treeModel.nodesWereInserted(this, new int[] { getChildCount() - 1, }); - } - -} // class ErrorEntry Modified: trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-13 11:12:28 UTC (rev 8378) +++ trunk/src/app/net/sf/gridarta/gui/errorview/DefaultErrorView.java 2010-06-13 11:14:14 UTC (rev 8379) @@ -33,7 +33,6 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; -import net.sf.gridarta.model.errorview.ErrorEntry; import net.sf.gridarta.model.errorview.ErrorView; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.japi.swing.action.ActionBuilder; Copied: trunk/src/app/net/sf/gridarta/gui/errorview/ErrorEntry.java (from rev 8364, trunk/model/src/app/net/sf/gridarta/model/errorview/ErrorEntry.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/errorview/ErrorEntry.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/errorview/ErrorEntry.java 2010-06-13 11:14:14 UTC (rev 8379) @@ -0,0 +1,61 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 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.gui.errorview; + +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.MutableTreeNode; +import org.jetbrains.annotations.NotNull; + +/** + * An entry in a {@link net.sf.gridarta.gui.errorview.DefaultErrorView}. + * @author Andreas Kirschbaum + */ +public class ErrorEntry extends DefaultMutableTreeNode { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link DefaultTreeModel} this instance belongs to. + */ + @NotNull + private final DefaultTreeModel treeModel; + + /** + * Creates a new instance. + * @param treeModel the tree model this instance belongs to + * @param name the name + * @param allowsChildren whether this node allows children + */ + public ErrorEntry(@NotNull final DefaultTreeModel treeModel, @NotNull final String name, final boolean allowsChildren) { + super(name, allowsChildren); + this.treeModel = treeModel; + } + + @Override + public void add(@NotNull final MutableTreeNode newChild) { + super.add(newChild); + treeModel.nodesWereInserted(this, new int[] { getChildCount() - 1, }); + } + +} // class ErrorEntry Property changes on: trunk/src/app/net/sf/gridarta/gui/errorview/ErrorEntry.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...> - 2010-06-13 11:29:13
|
Revision: 8381 http://gridarta.svn.sourceforge.net/gridarta/?rev=8381&view=rev Author: akirschbaum Date: 2010-06-13 11:29:06 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Clean up code for choosing the default image directory. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java Modified: trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2010-06-13 11:21:42 UTC (rev 8380) +++ trunk/model/src/app/net/sf/gridarta/model/settings/DefaultGlobalSettings.java 2010-06-13 11:29:06 UTC (rev 8381) @@ -230,6 +230,7 @@ mapsDirectory = new File(preferences.get(MAP_DIRECTORY_KEY, mapsDirectoryDefault)); mediaDirectory = new File(preferences.get(MEDIA_DIRECTORY_KEY, mediaDirectoryDefault)); imageSet = preferences.get(IMAGE_SET_KEY, imageSetDefault); + imageDirectory = mapsDirectory; configSource = configSourceFactory.getConfigSource(preferences.get(CONFIG_SOURCE_KEY, "")); final int documentationVersion = ActionBuilderUtils.getInt(ACTION_BUILDER, "docuVersion", 0); if (documentationVersion > 0 && preferences.getInt(DOCUMENTATION_VERSION_KEY, 0) < documentationVersion) { Modified: trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2010-06-13 11:21:42 UTC (rev 8380) +++ trunk/model/src/app/net/sf/gridarta/model/settings/GlobalSettings.java 2010-06-13 11:29:06 UTC (rev 8381) @@ -74,7 +74,8 @@ void setMapsDirectory(@NotNull File mapsDirectory); /** - * Sets the directory to save created image to. + * Sets the directory to save created image to. It defaults to {@link + * #getMapsDirectory()} and is not retained across editor restarts. * @param imageDirectory the image directory */ void setImageDirectory(@NotNull File imageDirectory); Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-13 11:21:42 UTC (rev 8380) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/ImageCreator2.java 2010-06-13 11:29:06 UTC (rev 8381) @@ -77,10 +77,6 @@ * @param component the parent component to use */ public void createImage(@NotNull final MapModel<G, A, R> mapModel, @NotNull final Component component) { - if (globalSettings.getImageDirectory() == null) { - globalSettings.setImageDirectory(globalSettings.getMapsDirectory()); - } - final File mapFile = mapModel.getMapFile(); final File file = new File(globalSettings.getImageDirectory(), mapFile == null ? "image" : mapFile.getName() + ".png"); final JFileChooser fileChooser = new JFileChooser(globalSettings.getImageDirectory()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-13 21:09:39
|
Revision: 8387 http://gridarta.svn.sourceforge.net/gridarta/?rev=8387&view=rev Author: akirschbaum Date: 2010-06-13 21:09:33 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Simplify resource directories. Modified Paths: -------------- trunk/atrinik/build.xml trunk/crossfire/build.xml trunk/daimonin/build.xml Added Paths: ----------- trunk/atrinik/resource/resource/ trunk/atrinik/resource/resource/HelpFiles/ trunk/crossfire/resource/resource/ trunk/crossfire/resource/resource/HelpFiles/ trunk/crossfire/resource/resource/conf/ trunk/daimonin/resource/resource/ trunk/daimonin/resource/resource/HelpFiles/ Removed Paths: ------------- trunk/atrinik/resource/HelpFiles/ trunk/crossfire/resource/HelpFiles/ trunk/crossfire/resource/conf/ trunk/daimonin/resource/HelpFiles/ Modified: trunk/atrinik/build.xml =================================================================== --- trunk/atrinik/build.xml 2010-06-13 12:40:13 UTC (rev 8386) +++ trunk/atrinik/build.xml 2010-06-13 21:09:33 UTC (rev 8387) @@ -109,12 +109,10 @@ <copy todir="${build.dir.production}"> <fileset dir="${resource.dir}"> <include name="icons/**/*.*"/> + <include name="resource/**"/> <include name="system/**/*.*"/> <exclude name="**/.xvpics/**"/> </fileset> - <fileset dir="."> - <include name="${resource.dir}/HelpFiles/**"/> - </fileset> </copy> <copy todir="${build.dir.production}"> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2010-06-13 12:40:13 UTC (rev 8386) +++ trunk/crossfire/build.xml 2010-06-13 21:09:33 UTC (rev 8387) @@ -124,12 +124,9 @@ </fileset> <fileset dir="${resource.dir}"> <include name="icons/**"/> + <include name="resource/**"/> <include name="system/**"/> </fileset> - <fileset dir="."> - <include name="${resource.dir}/HelpFiles/**"/> - <include name="${resource.dir}/conf/**"/> - </fileset> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../textedit/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> <fileset dir="../utils/src/app" excludes="**/*.java,**/package.html,**/overview.html"/> Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2010-06-13 12:40:13 UTC (rev 8386) +++ trunk/daimonin/build.xml 2010-06-13 21:09:33 UTC (rev 8387) @@ -109,12 +109,10 @@ <copy todir="${build.dir.production}"> <fileset dir="${resource.dir}"> <include name="icons/**/*.*"/> + <include name="resource/**"/> <include name="system/**/*.*"/> <exclude name="**/.xvpics/**"/> </fileset> - <fileset dir="."> - <include name="${resource.dir}/HelpFiles/**"/> - </fileset> </copy> <copy todir="${build.dir.production}"> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-14 17:27:27
|
Revision: 8391 http://gridarta.svn.sourceforge.net/gridarta/?rev=8391&view=rev Author: akirschbaum Date: 2010-06-14 17:27:20 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Update top-level build file. Modified Paths: -------------- trunk/INSTALL trunk/build.xml trunk/project.properties Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - classes dest developer.properties docs gridarta.iws out + classes dest developer.properties docs gridarta.iws out AtrinikEditor.jar CrossfireEditor.jar DaimoninEditor.jar Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-06-13 23:34:24 UTC (rev 8390) +++ trunk/INSTALL 2010-06-14 17:27:20 UTC (rev 8391) @@ -21,22 +21,11 @@ How to Build ------------ -Change to the directory of the version you want to build and run "ant". -To find out options about building Gridarta, run "ant -projecthelp". +Run "ant" to build the editor. This builds AtrinikEditor.jar, +CrossfireEditor.jar, and DaimoninEditor.jar. To find out options about building +Gridarta, run "ant -projecthelp". -Example: Building Gridarta4Atrinik -cd atrinik/ -ant -Example: Building Gridarta4Crossfire -cd crossfire/ -ant - -Example: Building Gridarta4Daimonin -cd daimonin/ -ant - - How to Run ---------- java -jar AtrinikEditor.jar @@ -47,4 +36,4 @@ How to Generate Documentation (Javadoc) --------------------------------------- Change to the main directory and run "ant javadoc". The documentation will be -placed in dest/doc/api/. +placed in dest/doc/dev/api/. Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-13 23:34:24 UTC (rev 8390) +++ trunk/build.xml 2010-06-14 17:27:20 UTC (rev 8391) @@ -18,7 +18,7 @@ --> <!DOCTYPE project [<!ENTITY catalogForAnt SYSTEM "src/doc/dtd/catalogForAnt.xml">]> -<project default="compile"> +<project default="jar"> <description> Build file for Gridarta - 2D MMORPG Map Editor. @@ -83,41 +83,398 @@ <delete dir="dest"/> <delete dir="dist"/> <delete file="src/doc/dev/SafeCopy.java.xhtml"/> + <delete file="src/doc/dev/changelog.xml"/> <delete dir="docs"/> <delete dir="classes"/> + <delete file="AtrinikEditor.jar"/> + <delete file="CrossfireEditor.jar"/> + <delete file="DaimoninEditor.jar"/> </target> - <target name="compile" description="Compiles the Gridarta sources."> - <mkdir dir="dest/app"/> - <javac srcdir="src/app:textedit/src/app:utils/src/app:model/src/app:atrinik/src/app:crossfire/src/app:daimonin/src/app:preferences/src/app" destdir="dest/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <target name="jar" description="Creates AtrinikEditor.jar, CrossfireEditor.jar, and DaimoninEditor.jar" depends="jar-atrinik,jar-crossfire,jar-daimonin"/> + + <target name="jar-atrinik" description="Creates AtrinikEditor.jar" depends="compile-atrinik,init-properties"> + <jar destfile="AtrinikEditor.jar" index="true"> + <fileset dir="dest/atrinik/app"/> + <fileset dir="dest/gridarta/app"/> + <fileset dir="dest/model/app"/> + <fileset dir="dest/preferences/app"/> + <fileset dir="dest/textedit/app"/> + <fileset dir="dest/utils/app"/> + <fileset dir="dest" includes="build.properties"/> + <fileset file="COPYING"/> + <fileset dir="atrinik/lib"> + <include name="*-LICENSE"/> + </fileset> + <fileset dir="lib"> + <include name="bsh-LICENSE"/> + <include name="japi.jar-LICENSE"/> + <include name="java-getopt-1.0.13.jar-LICENSE"/> + <include name="jdom.jar-LICENSE"/> + <include name="log4j-1.2.13.jar-LICENSE"/> + </fileset> + <fileset dir="resource"/> + <fileset dir="atrinik/resource"/> + <zipfileset src="lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/java-getopt-1.0.13.jar"/> + <zipfileset src="lib/jdom.jar"/> + <zipfileset src="lib/log4j-1.2.13.jar"/> + <zipgroupfileset dir="lib/" includes="japi-*.jar"/> + <manifest> + <attribute name="Main-Class" value="net.sf.gridarta.var.atrinik.maincontrol.AtrinikEditor"/> + <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> + </manifest> + </jar> + </target> + + <target name="jar-crossfire" description="Creates CrossfireEditor.jar" depends="compile-crossfire,init-properties"> + <jar destfile="CrossfireEditor.jar" index="true"> + <fileset dir="dest/crossfire/app"/> + <fileset dir="dest/gridarta/app"/> + <fileset dir="dest/model/app"/> + <fileset dir="dest/preferences/app"/> + <fileset dir="dest/textedit/app"/> + <fileset dir="dest/utils/app"/> + <fileset dir="dest" includes="build.properties"/> + <fileset file="COPYING"/> + <fileset dir="crossfire/lib"> + <include name="*-LICENSE"/> + </fileset> + <fileset dir="lib"> + <include name="bsh-LICENSE"/> + <include name="japi.jar-LICENSE"/> + <include name="java-getopt-1.0.13.jar-LICENSE"/> + <include name="jdom.jar-LICENSE"/> + <include name="log4j-1.2.13.jar-LICENSE"/> + </fileset> + <fileset dir="resource"/> + <fileset dir="crossfire/resource"/> + <zipfileset src="lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/java-getopt-1.0.13.jar"/> + <zipfileset src="lib/jdom.jar" excludes="META-INF/**"/> + <zipfileset src="lib/log4j-1.2.13.jar"/> + <zipgroupfileset dir="lib/" includes="japi-*.jar"/> + <manifest> + <attribute name="Main-Class" value="net.sf.gridarta.var.crossfire.maincontrol.CrossfireEditor"/> + <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> + </manifest> + </jar> + </target> + + <target name="jar-daimonin" description="Creates DaimoninEditor.jar" depends="compile-daimonin,init-properties"> + <jar destfile="DaimoninEditor.jar" index="true"> + <fileset dir="dest/daimonin/app"/> + <fileset dir="dest/gridarta/app"/> + <fileset dir="dest/model/app"/> + <fileset dir="dest/textedit/app"/> + <fileset dir="dest/utils/app"/> + <fileset dir="dest" includes="build.properties"/> + <fileset file="COPYING"/> + <fileset dir="daimonin/lib"> + <include name="*-LICENSE"/> + </fileset> + <fileset dir="lib"> + <include name="bsh-LICENSE"/> + <include name="japi.jar-LICENSE"/> + <include name="java-getopt-1.0.13.jar-LICENSE"/> + <include name="jdom.jar-LICENSE"/> + <include name="log4j-1.2.13.jar-LICENSE"/> + </fileset> + <fileset dir="resource"/> + <fileset dir="daimonin/resource"/> + <zipfileset src="lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="lib/java-getopt-1.0.13.jar"/> + <zipfileset src="lib/jdom.jar"/> + <zipfileset src="lib/log4j-1.2.13.jar"/> + <zipgroupfileset dir="lib/" includes="japi-*.jar"/> + <manifest> + <attribute name="Main-Class" value="net.sf.gridarta.var.daimonin.maincontrol.DaimoninEditor"/> + <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> + </manifest> + </jar> + </target> + + <target name="init-properties"> + <property file="developer.properties"/> + <property name="build.source.version" value="1.5"/> + <property name="build.target.version" value="${build.source.version}"/> + <property name="build.source.encoding" value="utf-8"/> + <property name="debug" value="false"/> + <property name="build.developer" value="unknown"/> + <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> + <property name="javac.fork" value="no"/> + <tstamp> + <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> + </tstamp> + <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false"/> + <property name="build.number" value="unknown"/> + <echoproperties destfile="dest/build.properties"> + <propertyset> + <propertyref prefix="build.developer"/> + <propertyref prefix="build.number"/> + <propertyref prefix="build.tstamp"/> + <propertyref prefix="svnversion"/> + </propertyset> + </echoproperties> + </target> + + <target name="compile-atrinik" description="Compiles the atrinik module." depends="compile-gridarta,compile-model,compile-preferences,compile-utils"> + <mkdir dir="dest/atrinik/app"/> + <javac srcdir="atrinik/src/app" destdir="dest/atrinik/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> <classpath> <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="bsh-classgen-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-commands-2.0b4.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> + <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/gridarta/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/atrinik/test"/> + <javac srcdir="atrinik/src/test" destdir="dest/atrinik/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/atrinik/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/atrinik/app"> + <fileset dir="atrinik/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="compile-crossfire" description="Compiles the crossfire module." depends="compile-gridarta,compile-model,compile-preferences,compile-utils"> + <mkdir dir="dest/crossfire/app"/> + <javac srcdir="crossfire/src/app" destdir="dest/crossfire/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> + <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/gridarta/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/preferences/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/crossfire/test"/> + <javac srcdir="crossfire/src/test" destdir="dest/crossfire/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/crossfire/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/crossfire/app"> + <fileset dir="crossfire/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="compile-daimonin" description="Compiles the daimonin module." depends="compile-gridarta,compile-model,compile-utils"> + <mkdir dir="dest/daimonin/app"/> + <javac srcdir="daimonin/src/app" destdir="dest/daimonin/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> + <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/gridarta/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/daimonin/test"/> + <javac srcdir="daimonin/src/test" destdir="dest/daimonin/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/daimonin/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/daimonin/app"> + <fileset dir="daimonin/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="compile-gridarta" description="Compiles the gridarta module." depends="compile-model,compile-textedit,compile-utils"> + <mkdir dir="dest/gridarta/app"/> + <javac srcdir="src/app" destdir="dest/gridarta/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> <fileset dir="lib" includes="bsh-core-2.0b4.jar"/> <fileset dir="lib" includes="bsh-util-2.0b4.jar"/> - <fileset dir="lib" includes="japi-lib-lang-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-swing-about-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-extlib-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-swing-tod-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> <fileset dir="lib" includes="java-getopt-1.0.13.jar"/> <fileset dir="lib" includes="jdom.jar"/> <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/textedit/app"/> + <pathelement location="dest/utils/app"/> </classpath> <compilerarg line="${javac.args}"/> </javac> - <copy todir="dest/app"> + <mkdir dir="dest/gridarta/test"/> + <javac srcdir="src/test" destdir="dest/gridarta/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/gridarta/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/gridarta/app"> <fileset dir="src/app" includes="**/*.properties,cfpython_menu.def"/> </copy> </target> - <target name="doc" depends="editorialDoc, apiDoc" description="Creates project documentation."/> + <target name="compile-model" description="Compiles the model module." depends="compile-utils"> + <mkdir dir="dest/model/app"/> + <javac srcdir="model/src/app" destdir="dest/model/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> + <fileset dir="lib" includes="jdom.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/model/test"/> + <javac srcdir="model/src/test" destdir="dest/model/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/model/app"> + <fileset dir="model/src/app" includes="**/*.properties"/> + </copy> + </target> + <target name="compile-preferences" description="Compiles the preferences module."> + <mkdir dir="dest/preferences/app"/> + <javac srcdir="preferences/src/app" destdir="dest/preferences/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/preferences/test"/> + <javac srcdir="preferences/src/test" destdir="dest/preferences/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/preferences/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/preferences/app"> + <fileset dir="preferences/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="compile-textedit" description="Compiles the textedit module." depends="compile-utils"> + <mkdir dir="dest/textedit/app"/> + <javac srcdir="textedit/src/app" destdir="dest/textedit/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/textedit/test"/> + <javac srcdir="textedit/src/test" destdir="dest/textedit/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/textedit/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/textedit/app"> + <fileset dir="textedit/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="compile-utils" description="Compiles the utils module."> + <mkdir dir="dest/utils/app"/> + <javac srcdir="utils/src/app" destdir="dest/utils/app" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="${debug}"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <mkdir dir="dest/utils/test"/> + <javac srcdir="utils/src/test" destdir="dest/utils/test" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <classpath> + <fileset dir="lib" includes="annotations.jar"/> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/utils/app"/> + </classpath> + <compilerarg line="${javac.args}"/> + </javac> + <copy todir="dest/utils/app"> + <fileset dir="utils/src/app" includes="**/*.properties"/> + </copy> + </target> + + <target name="doc" depends="editorialDoc,apiDoc" description="Creates project documentation."/> + <target name="java2html" description="Converts documentation java sources to XHTML."> <taskdef name="java2html" classpath="lib/java2html.jar" classname="de.java2html.anttasks.Java2HtmlTask"/> <java2html srcdir="src/doc" destdir="src/doc" includes="**/*.java" outputformat="xhtml11" tabs="4" style="eclipse" addlineanchors="true" includedocumentfooter="true" includedocumentheader="true" lineanchorprefix="line" showdefaulttitle="true" showfilename="true" showlinenumbers="true" showtableborder="true"/> @@ -157,45 +514,50 @@ <target name="apiDoc" description="Creates public javadoc documentation."> <mkdir dir="dest/doc/api/${project.version}"/> - <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html"/> --> - <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess"/> --> - <javadoc destdir="dest/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> + <copy todir="dest/doc/api/${project.version}" file="src/doc/copyright.xhtml"/> + <copy todir="dest/doc/api/${project.version}" file="src/doc/dev/api/.htaccess"/> + <javadoc destdir="dest/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.xhtml">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="bsh-classgen-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-commands-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-core-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-util-2.0b4.jar"/> - <fileset dir="lib" includes="japi-lib-lang-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-about-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-extlib-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-tod-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> - <fileset dir="lib" includes="java-getopt-1.0.13.jar"/> - <fileset dir="lib" includes="jdom.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> + <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> + <fileset dir="crossfire/lib" includes="*.jar" excludes="*.jar-LICENSE"/> + <fileset dir="lib" includes="*.jar" excludes="*.jar-LICENSE"/> </classpath> <sourcepath> <pathelement path="${user.javadoc.javasrc}"/> <pathelement path="src/app"/> - <pathelement path="textedit/src/app"/> - <pathelement path="utils/src/app"/> - <pathelement path="model/src/app"/> + <pathelement path="src/test"/> <pathelement path="atrinik/src/app"/> + <pathelement path="atrinik/src/test"/> <pathelement path="crossfire/src/app"/> + <pathelement path="crossfire/src/test"/> <pathelement path="daimonin/src/app"/> + <pathelement path="daimonin/src/test"/> + <pathelement path="model/src/app"/> + <pathelement path="model/src/test"/> + <pathelement path="preferences/src/app"/> + <pathelement path="preferences/src/test"/> + <pathelement path="textedit/src/app"/> + <pathelement path="textedit/src/test"/> + <pathelement path="utils/src/app"/> + <pathelement path="utils/src/test"/> </sourcepath> <packageset dir="src/app" defaultexcludes="yes"/> - <packageset dir="textedit/src/app" defaultexcludes="yes"/> - <packageset dir="utils/src/app" defaultexcludes="yes"/> - <packageset dir="model/src/app" defaultexcludes="yes"/> + <packageset dir="src/test" defaultexcludes="yes"/> <packageset dir="atrinik/src/app" defaultexcludes="yes"/> + <packageset dir="atrinik/src/test" defaultexcludes="yes"/> <packageset dir="crossfire/src/app" defaultexcludes="yes"/> + <packageset dir="crossfire/src/test" defaultexcludes="yes"/> <packageset dir="daimonin/src/app" defaultexcludes="yes"/> + <packageset dir="daimonin/src/test" defaultexcludes="yes"/> + <packageset dir="model/src/app" defaultexcludes="yes"/> + <packageset dir="model/src/test" defaultexcludes="yes"/> + <packageset dir="preferences/src/app" defaultexcludes="yes"/> + <packageset dir="preferences/src/test" defaultexcludes="yes"/> + <packageset dir="textedit/src/app" defaultexcludes="yes"/> + <packageset dir="textedit/src/test" defaultexcludes="yes"/> + <packageset dir="utils/src/app" defaultexcludes="yes"/> + <packageset dir="utils/src/test" defaultexcludes="yes"/> <tag name="todo" description="Todo:"/> <tag name="used" description="Manually marked as used." enabled="false"/> <tag name="fixme" description="Fixme:"/> @@ -211,7 +573,7 @@ </javadoc> </target> - <target name="dist" description="Packs distribution archives." depends="distSrc, distLib, distDoc"/> + <target name="dist" description="Packs distribution archives." depends="distSrc,distLib,distDoc"/> <target name="distSrc" description="Packs source distribution archives."> <mkdir dir="dist"/> @@ -243,7 +605,7 @@ <delete file="${distSrc}.tar"/> </target> - <target name="distLib" description="Packs library distribution archives." depends="compile"> + <target name="distLib" description="Packs library distribution archives."> <!--XXX:depends="compile"--> <mkdir dir="dist"/> <property name="distLib" value="dist/gridarta-${project.version}.lib"/> <jar destfile="${distLib}.jar"> @@ -285,15 +647,15 @@ <delete file="${distDoc}.tar"/> </target> - <target name="checkDevMail" description="checks whether the developer defined his / her email address" unless="developer.email"> + <target name="checkDevMail" description="Checks whether the developer defined his / her email address." unless="developer.email"> <fail message="You must define the property developer.email with your email address in the file developer.properties."/> </target> - <target name="checkDevSmtp" description="checks whether the developer defined his / her smtp host" unless="user.mail.smtp.host"> + <target name="checkDevSmtp" description="Checks whether the developer defined his / her smtp host." unless="user.mail.smtp.host"> <fail message="You must define the property user.mail.smtp.host with your smtp host address in the file developer.properties."/> </target> - <target name="releaseDist" description="uploads distribution archives to sourceforge." if="developer.email" depends="checkDevMail, dist"> + <target name="releaseDist" description="Uploads distribution archives to sourceforge." if="developer.email" depends="checkDevMail, dist"> <touch file="src/doc/api/start.xhtml" millis="0"/> <megaxslt srcdir="src/doc/api" destdir="src/doc/api" includes="start.xhtml" validatesource="true" validatedest="true" ending="xhtml" converttocanonical="true" checktimestamps="true"> <xmlcatalog refid="commonDTDs"/> @@ -315,10 +677,9 @@ <antcall target="uploadDoc"/> </target> - <target name="uploadDoc" description="uploads the latest editorial documentation." depends="editorialDoc"> + <target name="uploadDoc" description="Uploads the latest editorial documentation." depends="editorialDoc"> <exec executable="rsync" failonerror="true"> - <!--arg line="-auzv - -exclude=api/*/ -e ssh dest/doc/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/" /--> - <arg line="-auzv -e ssh dest/doc/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/"/> + <arg line="-auzv-e ssh dest/doc/ ${user.rsync.username}@${user.rsync.host}:${user.rsync.dir}/htdocs/"/> </exec> </target> @@ -360,7 +721,7 @@ </svn> </target> - <target name="checkstyle" description="Runs checkstyle to stylecheck the source code"> + <target name="checkstyle" description="Runs checkstyle to style-check the source code"> <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-all-5.0.jar"> <classpath> <pathelement path="lib/antlr.jar"/> @@ -373,21 +734,24 @@ <formatter type="plain"/> <fileset dir="src/app" includes="**/*.java"/> <fileset dir="src/test" includes="**/*.java"/> - <fileset dir="textedit/src/app" includes="**/*.java"/> - <fileset dir="utils/src/app" includes="**/*.java"/> - <fileset dir="utils/src/test" includes="**/*.java"/> - <fileset dir="model/src/app" includes="**/*.java"/> - <fileset dir="model/src/test" includes="**/*.java"/> <fileset dir="atrinik/src/app" includes="**/*.java"/> <fileset dir="atrinik/src/test" includes="**/*.java"/> <fileset dir="crossfire/src/app" includes="**/*.java"/> <fileset dir="crossfire/src/test" includes="**/*.java"/> <fileset dir="daimonin/src/app" includes="**/*.java"/> <fileset dir="daimonin/src/test" includes="**/*.java"/> + <fileset dir="model/src/app" includes="**/*.java"/> + <fileset dir="model/src/test" includes="**/*.java"/> + <fileset dir="preferences/src/app" includes="**/*.java"/> + <fileset dir="preferences/src/test" includes="**/*.java"/> + <fileset dir="textedit/src/app" includes="**/*.java"/> + <fileset dir="textedit/src/test" includes="**/*.java"/> + <fileset dir="utils/src/app" includes="**/*.java"/> + <fileset dir="utils/src/test" includes="**/*.java"/> </checkstyle> </target> - <target name="mailCheckstyle" description="Mails checkstyle results to the mailing list" depends="checkstyle, checkDevMail, checkDevSmtp"> + <target name="mailCheckstyle" description="Mails checkstyle results to the mailing list" depends="checkstyle,checkDevMail,checkDevSmtp"> <mail from="${developer.email}" tolist="gri...@li..." mailhost="${user.mail.smtp.host}" subject="Checkstyle violation(s) in Gridarta" files="checkstyle_report.html"/> </target> @@ -401,10 +765,9 @@ </megaxslt> </target> - <target name="javadoc" description="Creates the JavaDoc documentation for the complete editor source."> - <exec executable="svnversion" outputproperty="build.number"/> + <target name="javadoc" depends="init-properties" description="Creates the JavaDoc documentation for the complete editor source."> <mkdir dir="dest/doc/dev/api"/> - <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta Editor — API Documentation" doctitle="Gridarta Editor ${build.number}<br />API Documentation" header="Gridarta Editor ${build.number}<br />API Documentation" footer="Gridarta Editor ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> + <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta — API Documentation" doctitle="Gridarta ${build.number}<br />API Documentation" header="Gridarta ${build.number}<br />API Documentation" footer="Gridarta ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> @@ -415,31 +778,37 @@ <pathelement path="${user.javadoc.javasrc}"/> <pathelement path="src/app"/> <pathelement path="src/test"/> - <pathelement path="textedit/src/app"/> - <pathelement path="utils/src/app"/> - <pathelement path="utils/src/test"/> - <pathelement path="model/src/app"/> - <pathelement path="model/src/test"/> <pathelement path="atrinik/src/app"/> <pathelement path="atrinik/src/test"/> <pathelement path="crossfire/src/app"/> <pathelement path="crossfire/src/test"/> <pathelement path="daimonin/src/app"/> <pathelement path="daimonin/src/test"/> + <pathelement path="model/src/app"/> + <pathelement path="model/src/test"/> + <pathelement path="preferences/src/app"/> + <pathelement path="preferences/src/test"/> + <pathelement path="textedit/src/app"/> + <pathelement path="textedit/src/test"/> + <pathelement path="utils/src/app"/> + <pathelement path="utils/src/test"/> </sourcepath> <packageset dir="src/app" defaultexcludes="yes"/> <packageset dir="src/test" defaultexcludes="yes"/> - <packageset dir="textedit/src/app" defaultexcludes="yes"/> - <packageset dir="utils/src/app" defaultexcludes="yes"/> - <packageset dir="utils/src/test" defaultexcludes="yes"/> - <packageset dir="model/src/app" defaultexcludes="yes"/> - <packageset dir="model/src/test" defaultexcludes="yes"/> <packageset dir="atrinik/src/app" defaultexcludes="yes"/> <packageset dir="atrinik/src/test" defaultexcludes="yes"/> <packageset dir="crossfire/src/app" defaultexcludes="yes"/> <packageset dir="crossfire/src/test" defaultexcludes="yes"/> <packageset dir="daimonin/src/app" defaultexcludes="yes"/> <packageset dir="daimonin/src/test" defaultexcludes="yes"/> + <packageset dir="model/src/app" defaultexcludes="yes"/> + <packageset dir="model/src/test" defaultexcludes="yes"/> + <packageset dir="preferences/src/app" defaultexcludes="yes"/> + <packageset dir="preferences/src/test" defaultexcludes="yes"/> + <packageset dir="textedit/src/app" defaultexcludes="yes"/> + <packageset dir="textedit/src/test" defaultexcludes="yes"/> + <packageset dir="utils/src/app" defaultexcludes="yes"/> + <packageset dir="utils/src/test" defaultexcludes="yes"/> <bottom> <![CDATA[<address> <a href="http://sourceforge.net/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=166996&type=1" alt="SourceForge.net Logo" width="88" height="31" class="now" /></a> @@ -450,7 +819,7 @@ Feedback: <a href="mailto:ch...@ri...">webmaster</a> </address> <p class="copyright"> - © 2003-2007 The Gridarta Developers. All rights reserved. + © 2003-2010 The Gridarta Developers. All rights reserved. </p>]]> </bottom> <tag name="todo" description="Todo:"/> @@ -468,99 +837,196 @@ </javadoc> </target> - <target name="test" description="executes the junit tests." depends="compile"> - <mkdir dir="classes/test"/> + <target name="test" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-textedit,test-utils"> + <junitreport todir="docs/test"> + <fileset dir="docs/test"> + <include name="TEST-*.xml"/> + </fileset> + <report format="frames" todir="docs/test"/> + </junitreport> + </target> + + <target name="test-atrinik" depends="compile-atrinik"> <mkdir dir="docs/test"/> - <javac srcdir="src/test:model/src/test:utils/src/test:atrinik/src/test:crossfire/src/test:daimonin/src/test" destdir="classes/test" encoding="utf-8" source="${build.source.version}" target="${build.target.version}" includeantruntime="false" debug="yes"> + <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="bsh-classgen-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-commands-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-core-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-util-2.0b4.jar"/> - <fileset dir="lib" includes="japi-lib-lang-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-about-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-extlib-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-tod-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> - <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> - <fileset dir="lib" includes="java-getopt-1.0.13.jar"/> - <fileset dir="lib" includes="jdom.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/atrinik/app"/> + <pathelement location="dest/atrinik/test"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/atrinik/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> + </fileset> + </batchtest> + </junit> + </target> + + <target name="test-crossfire" depends="compile-crossfire"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="dest/app"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/crossfire/app"/> + <pathelement location="dest/crossfire/test"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> </classpath> - <include name="**/*.java"/> - <exclude name="**/package-info.java"/> - </javac> - <copy todir="classes/test"> - <fileset dir="resource" includes="**/*.properties,**/*.dtd"/> - <fileset dir="src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="textedit/src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="utils/src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="utils/src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="model/src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="model/src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="atrinik/src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="atrinik/src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="crossfire/src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="crossfire/src/app" includes="**/*.properties,**/*.testdata"/> - <fileset dir="daimonin/src/test" includes="**/*.properties,**/*.testdata"/> - <fileset dir="daimonin/src/app" includes="**/*.properties,**/*.testdata"/> - </copy> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/crossfire/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> + </fileset> + </batchtest> + </junit> + </target> + + <target name="test-daimonin" depends="compile-daimonin"> + <mkdir dir="docs/test"/> <junit printsummary="no" haltonfailure="yes"> <classpath> - <fileset dir="lib" includes="annotations.jar"/> - <fileset dir="lib" includes="bsh-classgen-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-commands-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-core-2.0b4.jar"/> - <fileset dir="lib" includes="bsh-util-2.0b4.jar"/> - <fileset dir="lib" includes="japi-lib-lang-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-about-0.1.0.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/daimonin/app"/> + <pathelement location="dest/daimonin/test"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/utils/app"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/daimonin/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> + </fileset> + </batchtest> + </junit> + </target> + + <target name="test-gridarta" depends="compile-gridarta"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-extlib-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-misc-trunk-1398.jar"/> - <fileset dir="lib" includes="japi-lib-swing-prefs-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-swing-tod-0.1.0.jar"/> - <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/gridarta/app"/> + <pathelement location="dest/gridarta/test"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/gridarta/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> + </fileset> + </batchtest> + </junit> + </target> + + <target name="test-model" depends="compile-model"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <fileset dir="lib" includes="japi-lib-swing-action-0.1.0.jar"/> <fileset dir="lib" includes="japi-lib-xml-0.1.0.jar"/> - <fileset dir="lib" includes="java-getopt-1.0.13.jar"/> - <fileset dir="lib" includes="jdom.jar"/> + <fileset dir="lib" includes="log4j-1.2.13.jar"/> <fileset dir="lib" includes="junit-4.2.jar"/> - <fileset dir="lib" includes="log4j-1.2.13.jar"/> - <pathelement location="classes/test"/> - <pathelement location="dest/app"/> + <pathelement location="dest/model/app"/> + <pathelement location="dest/model/test"/> + <pathelement location="dest/utils/app"/> + <pathelement location="resource"/> </classpath> <formatter type="plain"/> <formatter type="xml"/> <batchtest todir="docs/test"> - <fileset dir="src/test"> - <include name="**/*Test.java"/> - <exclude name="**/Abstract*Test.java"/> + <fileset dir="dest/model/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> </fileset> - <fileset dir="atrinik/src/test"> - <include name="**/*Test.java"/> - <exclude name="**/Abstract*Test.java"/> + </batchtest> + </junit> + </target> + + <target name="test-preferences" depends="compile-preferences"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/preferences/app"/> + <pathelement location="dest/preferences/test"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/preferences/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> </fileset> - <fileset dir="crossfire/src/test"> - <include name="**/*Test.java"/> - <exclude name="**/Abstract*Test.java"/> + </batchtest> + </junit> + </target> + + <target name="test-textedit" depends="compile-textedit"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/textedit/app"/> + <pathelement location="dest/textedit/test"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/textedit/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> </fileset> - <fileset dir="daimonin/src/test"> - <include name="**/*Test.java"/> - <exclude name="**/Abstract*Test.java"/> + </batchtest> + </junit> + </target> + + <target name="test-utils" depends="compile-utils"> + <mkdir dir="docs/test"/> + <junit printsummary="no" haltonfailure="yes"> + <classpath> + <fileset dir="lib" includes="japi-lib-util-trunk-1379.jar"/> + <fileset dir="lib" includes="junit-4.2.jar"/> + <pathelement location="dest/utils/app"/> + <pathelement location="dest/utils/test"/> + </classpath> + <formatter type="plain"/> + <formatter type="xml"/> + <batchtest todir="docs/test"> + <fileset dir="dest/utils/test"> + <include name="**/*Test.class"/> + <exclude name="**/*$*"/> + <exclude name="**/Abstract*Test.class"/> </fileset> </batchtest> </junit> - <junitreport todir="docs/test"> - <fileset dir="docs/test"> - <include name="TEST-*.xml"/> - </fileset> - <report format="frames" todir="docs/test"/> - </junitreport> </target> + </project> Modified: trunk/project.properties =================================================================== --- trunk/project.properties 2010-06-13 23:34:24 UTC (rev 8390) +++ trunk/project.properties 2010-06-14 17:27:20 UTC (rev 8391) @@ -18,7 +18,7 @@ # project.version.major=0 -project.version.minor=1 +project.version.minor=9 project.version.patch=0 project.version=${project.version.major}.${project.version.minor}.${project.version.patch} project.focus=majorEnhancements This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-14 17:33:17
|
Revision: 8392 http://gridarta.svn.sourceforge.net/gridarta/?rev=8392&view=rev Author: akirschbaum Date: 2010-06-14 17:33:10 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Remove code to delete old libraries; these libraries should have been removed by now. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_de.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_fr.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_sv.properties trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_de.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_fr.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_sv.properties trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -49,9 +49,7 @@ # ToolBars main.toolbar=newMap openFile saveMap saveMapAs - prevWindow nextWindow - undo redo -oldLibs.okayLibs=.svn CVS README LICENSE-* *-LICENSE japi.jar jlfgr-1_0.jar - moveCursor.menu=goNorth goEast goSouth goWest goNorthEast goSouthEast goSouthWest goNorthWest - goLocation exitConnector.menu=exitCopy exitPaste exitConnect Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-06-14 17:33:10 UTC (rev 8392) @@ -20,12 +20,9 @@ package net.sf.gridarta.var.atrinik.maincontrol; import java.awt.Component; -import java.io.File; import java.io.IOException; import java.net.URL; -import java.util.Arrays; import java.util.regex.Pattern; -import javax.swing.JOptionPane; import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; @@ -100,7 +97,6 @@ import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; -import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; import net.sf.gridarta.validation.ValidatorPreferences; @@ -145,8 +141,6 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.prefs.PreferencesGroup; -import net.sf.japi.util.filter.file.Factory; -import net.sf.japi.util.filter.file.GlobFileFilter; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -488,36 +482,6 @@ /** * {@inheritDoc} */ - @Override - public void deleteLibraries(@NotNull final Component parent) { - // Delete libraries. - final File libs = new File(System.getProperty("user.dir"), "lib"); - final CharSequence libsString = ACTION_BUILDER.getString("oldLibs.okayLibs"); - assert libsString != null; - final String[] patterns = StringUtils.PATTERN_WHITESPACE.split(libsString, 0); - final File[] libFiles = libs.listFiles(Factory.not(new GlobFileFilter(patterns))); - if (libFiles != null) { - Arrays.sort(libFiles); - if (log.isInfoEnabled()) { - for (final File libFile : libFiles) { - log.info(libFile); - } - } - } - if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { - Arrays.sort(libFiles); - for (final File libFile : libFiles) { - libFile.delete(); - } - if (libs.listFiles().length == 0) { - libs.delete(); - } - } - } - - /** - * {@inheritDoc} - */ @NotNull @Override public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -104,11 +104,7 @@ optionsResMedia=Media optionsResMedia.shortdescription=<html>The media directory is for choosing background sounds for maps.<br>Please know that you cannot simply choose any media directory you want.<br>The background sound will only work if the files exist on the client as well.<br>Therefore, choosing a standard atrinik media directory is crucial.</html> -# Old Libraries -oldLibsFound.message=Old libraries found.\nLocation: {0}\nThey aren''t used anymore.\nDelete them? -oldLibsFound.title=Delete old libraries? - ####### # Map Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_de.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_de.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_de.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -57,11 +57,7 @@ #optionsResMedia= #optionsResMedia.shortdescription= -# Old Libraries -#oldLibsFound.message= -#oldLibsFound.title= - ####### # Help Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_fr.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_fr.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_fr.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -60,11 +60,7 @@ #optionsResMedia= #optionsResMedia.shortdescription= -# Old Libraries -#oldLibsFound.message= -#oldLibsFound.title= - ####### # Help Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_sv.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_sv.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages_sv.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -58,11 +58,7 @@ optionsResMedia=Media optionsResMedia.shortdescription=<html>Mediakatalogen anv\xE4nds f\xF6r att v\xE4lja bakgrundsljud till kartor.<br>Observera att det inte g\xE5r att v\xE4lja vilka filer som helst.<br>Bakgrundsljud fungerar enbart om filen finns i klienten ocks\xE5.<br>D\xE4rf\xF6r \xE4r det viktigt att v\xE4lja en Atrinik standardkatalog f\xF6r media.</html> -# Old Libraries -oldLibsFound.message=Hittade gamla bibliotek.\nS\xF6kv\xE4g: {0}\nDe anv\xE4nds inte l\xE4ngre. Skall jag ta bort dem? -oldLibsFound.title=Ta bort gamla bibliotek? - ####### # Help Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-06-14 17:33:10 UTC (rev 8392) @@ -378,13 +378,6 @@ /** * {@inheritDoc} */ - @Override - public void deleteLibraries(@NotNull final Component parent) { - } - - /** - * {@inheritDoc} - */ @NotNull @Override public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -49,9 +49,7 @@ # ToolBars main.toolbar=newMap openFile saveMap saveMapAs - prevWindow nextWindow - undo redo -oldLibs.okayLibs=.svn CVS README LICENSE-* *-LICENSE japi.jar jlfgr-1_0.jar - moveCursor.menu=goNorth goEast goSouth goWest goNorthEast goSouthEast goSouthWest goNorthWest - goLocation exitConnector.menu=exitCopy exitPaste exitConnect Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-06-14 17:33:10 UTC (rev 8392) @@ -20,12 +20,9 @@ package net.sf.gridarta.var.daimonin.maincontrol; import java.awt.Component; -import java.io.File; import java.io.IOException; import java.net.URL; -import java.util.Arrays; import java.util.regex.Pattern; -import javax.swing.JOptionPane; import net.sf.gridarta.gui.filter.FilterControl; import net.sf.gridarta.gui.io.GuiFileFilters; import net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory; @@ -100,7 +97,6 @@ import net.sf.gridarta.script.parameter.PluginParameterFactory; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.IOUtils; -import net.sf.gridarta.utils.StringUtils; import net.sf.gridarta.utils.SystemIcons; import net.sf.gridarta.validation.DelegatingMapValidator; import net.sf.gridarta.validation.ValidatorPreferences; @@ -146,8 +142,6 @@ import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; import net.sf.japi.swing.prefs.PreferencesGroup; -import net.sf.japi.util.filter.file.Factory; -import net.sf.japi.util.filter.file.GlobFileFilter; import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -489,36 +483,6 @@ /** * {@inheritDoc} */ - @Override - public void deleteLibraries(@NotNull final Component parent) { - // Delete libraries. - final File libs = new File(System.getProperty("user.dir"), "lib"); - final CharSequence libsString = ACTION_BUILDER.getString("oldLibs.okayLibs"); - assert libsString != null; - final String[] patterns = StringUtils.PATTERN_WHITESPACE.split(libsString, 0); - final File[] libFiles = libs.listFiles(Factory.not(new GlobFileFilter(patterns))); - if (libFiles != null) { - Arrays.sort(libFiles); - if (log.isInfoEnabled()) { - for (final File libFile : libFiles) { - log.info(libFile); - } - } - } - if (libFiles != null && libFiles.length > 0 && ACTION_BUILDER.showOnetimeConfirmDialog(parent, JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == JOptionPane.YES_OPTION) { - Arrays.sort(libFiles); - for (final File libFile : libFiles) { - libFile.delete(); - } - if (libs.listFiles().length == 0) { - libs.delete(); - } - } - } - - /** - * {@inheritDoc} - */ @NotNull @Override public NewMapDialogFactory<GameObject, MapArchObject, Archetype> newNewMapDialogFactory(@NotNull final MapViewsManager<GameObject, MapArchObject, Archetype> mapViewsManager, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final Component parent) { Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -102,11 +102,7 @@ optionsResMedia=Media optionsResMedia.shortdescription=<html>The media directory is for choosing background sounds for maps.<br>Please know that you cannot simply choose any media directory you want.<br>The background sound will only work if the files exist on the client as well.<br>Therefore, choosing a standard daimonin media directory is crucial.</html> -# Old Libraries -oldLibsFound.message=Old libraries found.\nLocation: {0}\nThey aren''t used anymore.\nDelete them? -oldLibsFound.title=Delete old libraries? - ####### # Map Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_de.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_de.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_de.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -56,11 +56,7 @@ #optionsResMedia= #optionsResMedia.shortdescription= -# Old Libraries -#oldLibsFound.message= -#oldLibsFound.title= - ####### # Help Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_fr.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_fr.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_fr.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -58,11 +58,7 @@ #optionsResMedia= #optionsResMedia.shortdescription= -# Old Libraries -#oldLibsFound.message= -#oldLibsFound.title= - ####### # Help Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_sv.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_sv.properties 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages_sv.properties 2010-06-14 17:33:10 UTC (rev 8392) @@ -56,11 +56,7 @@ optionsResMedia=Media optionsResMedia.shortdescription=<html>Mediakatalogen anv\xE4nds f\xF6r att v\xE4lja bakgrundsljud till kartor.<br>Observera att det inte g\xE5r att v\xE4lja vilka filer som helst.<br>Bakgrundsljud fungerar enbart om filen finns i klienten ocks\xE5.<br>D\xE4rf\xF6r \xE4r det viktigt att v\xE4lja en Daimonin standardkatalog f\xF6r media.</html> -# Old Libraries -oldLibsFound.message=Hittade gamla bibliotek.\nS\xF6kv\xE4g: {0}\nDe anv\xE4nds inte l\xE4ngre. Skall jag ta bort dem? -oldLibsFound.title=Ta bort gamla bibliotek? - ####### # Help Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-06-14 17:33:10 UTC (rev 8392) @@ -319,11 +319,6 @@ MapPropertiesDialogFactory<G, A, R> newMapPropertiesDialogFactory(@NotNull GlobalSettings globalSettings, @NotNull MapManager<G, A, R> mapManager, @NotNull MapPathNormalizer mapPathNormalizer); /** - * @param parent the parent component for dialogs - */ - void deleteLibraries(@NotNull Component parent); - - /** * Creates a new {@link NewMapDialogFactory} instance. * @param mapViewsManager the map views * @param mapArchObjectFactory the map arch object factory instance Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-14 17:27:20 UTC (rev 8391) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-06-14 17:33:10 UTC (rev 8392) @@ -601,7 +601,6 @@ globalSettings.setAutoPopupDocumentation(false); } - editorFactory.deleteLibraries(mainViewFrame); final MapMenuManager<G, A, R> recentMapMenuManager = new MapMenuManager<G, A, R>(mapManager, new RecentMapMenuPreferences<G, A, R>(mapViewsManager, globalSettings, mapImageCache, fileControl)); final JMenu recentMenu = MenuUtils.getMenu(menuBar, "recent"); if (recentMenu == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-14 18:09:02
|
Revision: 8395 http://gridarta.svn.sourceforge.net/gridarta/?rev=8395&view=rev Author: akirschbaum Date: 2010-06-14 18:08:56 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Do not crash if a treasurelist definition file cannot be found. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-14 18:01:27 UTC (rev 8394) +++ trunk/atrinik/ChangeLog 2010-06-14 18:08:56 UTC (rev 8395) @@ -1,3 +1,7 @@ +2010-06-14 Andreas Kirschbaum + + * Do not crash if a treasurelist definition file cannot be found. + 2010-06-13 Andreas Kirschbaum * Add support for archetypes with default inventories. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-14 18:01:27 UTC (rev 8394) +++ trunk/crossfire/ChangeLog 2010-06-14 18:08:56 UTC (rev 8395) @@ -1,3 +1,7 @@ +2010-06-14 Andreas Kirschbaum + + * Do not crash if a treasurelist definition file cannot be found. + 2010-06-13 Kevin Bulgrien * Improve grammar in various tip-of-the-day texts. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-14 18:01:27 UTC (rev 8394) +++ trunk/daimonin/ChangeLog 2010-06-14 18:08:56 UTC (rev 8395) @@ -1,3 +1,7 @@ +2010-06-14 Andreas Kirschbaum + + * Do not crash if a treasurelist definition file cannot be found. + 2010-06-13 Andreas Kirschbaum * Fix cursor position after mouse-clicks into script editor. Modified: trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-06-14 18:01:27 UTC (rev 8394) +++ trunk/model/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-06-14 18:08:56 UTC (rev 8395) @@ -115,6 +115,7 @@ treasureLocation = configSource.getFile(globalSettings, "treasures", index); } catch (final IOException ex) { errorView.addWarning(ErrorViewCategory.TREASURES_FILE_INVALID, ex.getMessage()); + index++; continue; } if (treasureLocation == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-14 18:46:56
|
Revision: 8398 http://gridarta.svn.sourceforge.net/gridarta/?rev=8398&view=rev Author: akirschbaum Date: 2010-06-14 18:46:49 +0000 (Mon, 14 Jun 2010) Log Message: ----------- Add tets directories. Modified Paths: -------------- trunk/textedit.iml trunk/utils.iml Modified: trunk/textedit.iml =================================================================== --- trunk/textedit.iml 2010-06-14 18:39:57 UTC (rev 8397) +++ trunk/textedit.iml 2010-06-14 18:46:49 UTC (rev 8398) @@ -3,6 +3,7 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$/textedit"> <sourceFolder url="file://$MODULE_DIR$/textedit/src/app" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/textedit/src/test" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> Modified: trunk/utils.iml =================================================================== --- trunk/utils.iml 2010-06-14 18:39:57 UTC (rev 8397) +++ trunk/utils.iml 2010-06-14 18:46:49 UTC (rev 8398) @@ -3,7 +3,7 @@ <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url="file://$MODULE_DIR$/utils"> <sourceFolder url="file://$MODULE_DIR$/utils/src/app" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/utils/src/test" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/utils/src/test" isTestSource="true" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |