You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <chr...@us...> - 2006-10-21 14:27:23
|
Revision: 559 http://svn.sourceforge.net/gridarta/?rev=559&view=rev Author: christianhujer Date: 2006-10-21 07:26:58 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Moved AnimationParseException to gridarta. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 14:26:58 UTC (rev 559) @@ -32,7 +32,7 @@ import daieditor.IGUIConstants; import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.anim.AnimationObjects; -import daieditor.gameobject.anim.AnimationParseException; +import net.sf.gridarta.gameobject.anim.AnimationParseException; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import daieditor.gameobject.face.DuplicateFaceException; import daieditor.gameobject.face.FaceFacade; Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 14:26:58 UTC (rev 559) @@ -38,6 +38,7 @@ import java.util.Map; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.AnimationParseException; import org.jetbrains.annotations.Nullable; Deleted: trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java 2006-10-21 12:52:04 UTC (rev 558) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java 2006-10-21 14:26:58 UTC (rev 559) @@ -1,85 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject.anim; - -import java.io.File; - -/** - * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such - * a file contains an error. - * In future, it might as well be used if a user defines or changes an animation. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class AnimationParseException extends Exception { - - /** - * The file that caused the error. - * @serial include - */ - private final File file; - - /** - * The line number that caused the error. - * @serial include - */ - private final int lineNumber; - - /** - * Create an AnimationParseException. - * @param expected expected parse element - * @param actual actual parse element that gave the error - * @param lineNumber number of erraneous line - */ - public AnimationParseException(final String expected, final String actual, final int lineNumber) { - super("Excpected \"" + expected + "\", got \"" + actual + "\" in line " + lineNumber); - file = null; - this.lineNumber = lineNumber; - } - - /** - * Create an AnimationParseException. - * @param cause Exception causing this exception - * @param file File containint the error - */ - public AnimationParseException(final AnimationParseException cause, final File file) { - super(cause.getMessage() + " of file " + file, cause); - this.file = file; - lineNumber = cause.lineNumber; - } - - /** - * Get the number of the erraneous line. - * @return number of erraneous line - */ - public int getLineNumber() { - return lineNumber; - } - - /** - * Get the file that was erraneous. - * @return erraneous file or <code>null</code> if file unknown - */ - public File getFile() { - return file; - } - -} // class AnimationParseException Copied: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java (from rev 556, trunk/daimonin/src/daieditor/gameobject/anim/AnimationParseException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java 2006-10-21 14:26:58 UTC (rev 559) @@ -0,0 +1,85 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.gameobject.anim; + +import java.io.File; + +/** + * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such + * a file contains an error. + * In future, it might as well be used if a user defines or changes an animation. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class AnimationParseException extends Exception { + + /** + * The file that caused the error. + * @serial include + */ + private final File file; + + /** + * The line number that caused the error. + * @serial include + */ + private final int lineNumber; + + /** + * Create an AnimationParseException. + * @param expected expected parse element + * @param actual actual parse element that gave the error + * @param lineNumber number of erraneous line + */ + public AnimationParseException(final String expected, final String actual, final int lineNumber) { + super("Excpected \"" + expected + "\", got \"" + actual + "\" in line " + lineNumber); + file = null; + this.lineNumber = lineNumber; + } + + /** + * Create an AnimationParseException. + * @param cause Exception causing this exception + * @param file File containint the error + */ + public AnimationParseException(final AnimationParseException cause, final File file) { + super(cause.getMessage() + " of file " + file, cause); + this.file = file; + lineNumber = cause.lineNumber; + } + + /** + * Get the number of the erraneous line. + * @return number of erraneous line + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * Get the file that was erraneous. + * @return erraneous file or <code>null</code> if file unknown + */ + public File getFile() { + return file; + } + +} // class AnimationParseException Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationParseException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 12:52:39
|
Revision: 558 http://svn.sourceforge.net/gridarta/?rev=558&view=rev Author: christianhujer Date: 2006-10-21 05:52:04 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Unified AnimationObject(s). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/anim/ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-10-21 12:52:04 UTC (rev 558) @@ -1726,7 +1726,7 @@ return archetypeParser; } - public AnimationObjects getAnimationObject() { + public AnimationObjects getAnimationObjects() { return animationObjects; } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -36,6 +36,7 @@ import java.util.List; import java.util.Map; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.apache.log4j.Logger; import org.jdom.DataConversionException; import org.jdom.Document; @@ -52,14 +53,12 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ +@SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger(ArchetypeParser.class); - // name of the system-arch containing path of starting map - public static final String STARTARCH_NAME = "map"; - // table with type numbers as keys (Integer), and type names as values (String) private Map<Integer,String> archTypeNumbers; @@ -248,7 +247,11 @@ } } else if (animflag) { if (thisLine.startsWith("mina")) { - mainControl.getAnimationObject().addAnimObject(arch.getArchetypeName(), arch.getAnimText()); + try { + mainControl.getAnimationObjects().addAnimationObject(arch.getArchetypeName(), arch.getAnimText()); + } catch (final DuplicateAnimationException e) { + log.warn("Duplicate Animation " + arch.getArchetypeName(), e); + } arch.addObjectText("animation " + arch.getArchetypeName() + "\n"); // here we must add this to AnimationObject Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) @@ -60,6 +60,7 @@ import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.AbstractArchetypeSet; import net.sf.gridarta.gameobject.Archetype; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -310,7 +311,11 @@ if (log.isDebugEnabled()) { log.debug("We found this>> name: >" + animName + " \n>" + animText + "<\n"); } - mainControl.getAnimationObject().addAnimObject(animName, animText); + try { + mainControl.getAnimationObjects().addAnimationObject(animName, animText); + } catch (DuplicateAnimationException e) { + log.warn("Duplicate Animation " + animName, e); + } } else { animText = "" + animText + thisLine + "\n"; } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,7 +29,7 @@ * A single animation object. * An animation object holds the name and the framelist of an animation. */ -public final class AnimationObject implements Comparable<AnimationObject> { +public final class AnimationObject implements Comparable<AnimationObject>, net.sf.gridarta.gameobject.anim.AnimationObject { /** The name of this animation. */ private final String animName; @@ -50,19 +50,12 @@ this.animList = animList; } - /** - * Get the animName, which is the name of the animation as usable by the "animations" attribute. - * @return the name of this animation. - */ + /** {@inheritDoc} */ public String getAnimName() { return animName; } - /** - * Returns the animation list of this animation. - * The individual entries are all postfixed with '\n'. - * @return the animation list of this animation. - */ + /** {@inheritDoc} */ public String getAnimList() { return animList; } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,15 +29,14 @@ import java.util.Iterator; import java.util.List; import java.util.TreeSet; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; /** * The <code>AnimationObject</code>. - * <p/> - * WARNING: This class uses two indexes which are independent of each other: - * index of animation object and index of animation name. * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public class AnimationObjects implements Iterable<AnimationObject> { +public class AnimationObjects implements net.sf.gridarta.gameobject.anim.AnimationObjects<AnimationObject> { /** The animation objects. */ private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); @@ -51,21 +50,9 @@ return new TreeSet<AnimationObject>(animObjects).iterator(); } - /** - * Add an animation object. - * @param name name of the animation object - * @param list list with individual frames - */ - public void addAnimObject(final String name, final String list) { + /** {@inheritDoc} */ + public void addAnimationObject(final String name, final String list) throws DuplicateAnimationException { animObjects.add(new AnimationObject(name, list)); } - /** - * Returns number of animation objects created. - * @return number of animation objects created. - */ - public int getNumAnimObjects() { - return animObjects.size(); - } - } // class AnimationObjects Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -29,7 +29,7 @@ import daieditor.IGUIConstants; import daieditor.MultiPositionData; import daieditor.PathManager; -import daieditor.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; @@ -50,14 +50,12 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ +@SuppressWarnings({"HardcodedFileSeparator"}) public final class ArchetypeParser implements net.sf.gridarta.gameobject.ArchetypeParser<GameObject> { /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); - // name of the system-arch containing path of starting map - public static final String STARTARCH_NAME = "map"; - private final CMainControl mainControl; /** Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-10-21 12:52:04 UTC (rev 558) @@ -33,7 +33,7 @@ import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.anim.AnimationParseException; -import daieditor.gameobject.anim.DuplicateAnimationException; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import daieditor.gameobject.face.DuplicateFaceException; import daieditor.gameobject.face.FaceFacade; import daieditor.gameobject.face.FaceObject; Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -40,7 +40,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class AnimationObject extends NamedObject implements Serializable { +public final class AnimationObject extends NamedObject implements Serializable, net.sf.gridarta.gameobject.anim.AnimationObject { /** Serial Version. */ private static final long serialVersionUID = 1L; @@ -147,19 +147,14 @@ } /** - * Get the animName, which is the name of the animation as usable by the "animations" attribute. - * @return the name of this animation. + * {@inheritDoc} * @see #getName() */ public String getAnimName() { return animName; } - /** - * Returns the animation list of this animation. - * The individual entries are all postfixed with '\n'. - * @return the animation list of this animation. - */ + /** {@inheritDoc} */ public String getAnimList() { return animList; } Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import org.jetbrains.annotations.Nullable; @@ -46,7 +47,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class AnimationObjects extends NamedObjects<AnimationObject> { +public final class AnimationObjects extends NamedObjects<AnimationObject> implements net.sf.gridarta.gameobject.anim.AnimationObjects<AnimationObject> { /** * This Map holds (anim object name, path to arc file) pairs. @@ -62,12 +63,7 @@ super(name); } - /** - * Adds a new animation object. - * @param animName name of the animation object to add - * @param list String with animation list data - * @throws DuplicateAnimationException in case the animation was not unique - */ + /** {@inheritDoc} */ public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { addAnimationObject(animName, list, null); } Deleted: trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:52:04 UTC (rev 558) @@ -1,51 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2005 Christian Hujer - * - * 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., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gameobject.anim; - -/** - * Exception that's thrown in case an animation name was not unique. - * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> - * @serial exclude - */ -public class DuplicateAnimationException extends Exception { - - /** AnimationObject causing the problem. */ - private final AnimationObject duplicate; - - /** - * Create a DuplicateAnimationException. - * @param duplicate Duplicate animation that's the cause - */ - public DuplicateAnimationException(final AnimationObject duplicate) { - super("Non-unique animation " + duplicate.getAnimName()); - this.duplicate = duplicate; - } - - /** - * Get the duplicate that caused this exception. - * @return duplicate - */ - public AnimationObject getDuplicate() { - return duplicate; - } - -} // class DuplicateAnimationException Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2006-10-21 12:21:38 UTC (rev 557) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeParser.java 2006-10-21 12:52:04 UTC (rev 558) @@ -12,6 +12,11 @@ public interface ArchetypeParser<G extends GameObject<G>> { /** + * Name of the system-arch containing path of starting map. + */ + String STARTARCH_NAME = "map"; + + /** * If the given arch is a multipart head, we generate the appropriate * tail (from the arch stack) and attach it. The new arches get added * to the temp list, not a map. This method should only be called Added: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,22 @@ +package net.sf.gridarta.gameobject.anim; + +/** + * An AnimationObject reflects the animation ("<code>anim\n</code>" ... "<code>mina\n</code>") of a GameObject or Archetype. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface AnimationObject { + + /** + * Get the animName, which is the name of the animation as usable by the "animations" attribute. + * @return the name of this animation. + */ + public String getAnimName(); + + /** + * Returns the animation list of this animation. + * The individual entries are all postfixed with '\n'. + * @return the animation list of this animation. + */ + public String getAnimList(); + +} // interface AnimationObject Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObject.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,17 @@ +package net.sf.gridarta.gameobject.anim; + +/** + * AnimationObjects is a container for {@link AnimationObject}s. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public interface AnimationObjects<T extends AnimationObject> extends Iterable<T> { + + /** + * Add an animation object. + * @param name name of the animation object + * @param list list with individual frames + * @throws DuplicateAnimationException in case the animation was not unique + */ + void addAnimationObject(String name, String list) throws DuplicateAnimationException; + +} // interface AnimationObjects Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java (from rev 556, trunk/daimonin/src/daieditor/gameobject/anim/DuplicateAnimationException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java 2006-10-21 12:52:04 UTC (rev 558) @@ -0,0 +1,51 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.gameobject.anim; + +/** + * Exception that's thrown in case an animation name was not unique. + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + * @serial exclude + */ +public class DuplicateAnimationException extends Exception { + + /** AnimationObject causing the problem. */ + private final AnimationObject duplicate; + + /** + * Create a DuplicateAnimationException. + * @param duplicate Duplicate animation that's the cause + */ + public DuplicateAnimationException(final AnimationObject duplicate) { + super("Non-unique animation " + duplicate.getAnimName()); + this.duplicate = duplicate; + } + + /** + * Get the duplicate that caused this exception. + * @return duplicate + */ + public AnimationObject getDuplicate() { + return duplicate; + } + +} // class DuplicateAnimationException Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/DuplicateAnimationException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-21 12:21:45
|
Revision: 557 http://svn.sourceforge.net/gridarta/?rev=557&view=rev Author: christianhujer Date: 2006-10-21 05:21:38 -0700 (Sat, 21 Oct 2006) Log Message: ----------- Simplified by replacing redundant field with derived attribute getter. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-19 20:28:33 UTC (rev 556) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2006-10-21 12:21:38 UTC (rev 557) @@ -42,9 +42,6 @@ /** The animation objects. */ private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); - /** Number of animation objects created. */ - private int numAnimObjects; - /** Create the AnimationObject container. */ public AnimationObjects() { } @@ -61,7 +58,6 @@ */ public void addAnimObject(final String name, final String list) { animObjects.add(new AnimationObject(name, list)); - numAnimObjects++; } /** @@ -69,7 +65,7 @@ * @return number of animation objects created. */ public int getNumAnimObjects() { - return numAnimObjects; + return animObjects.size(); } } // class AnimationObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 20:28:56
|
Revision: 556 http://svn.sourceforge.net/gridarta/?rev=556&view=rev Author: akirschbaum Date: 2006-10-19 13:28:33 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Unify expression. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:22:26 UTC (rev 555) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:28:33 UTC (rev 556) @@ -207,7 +207,7 @@ log.debug("# type: " + tmp.getTypeName()); } - for (int t = 0; t < numArgs * 2; t += 2) { + for (int t = 0, l = numArgs * 2; t < l; t += 2) { attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t]); if (log.isDebugEnabled()) { Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 20:22:26 UTC (rev 555) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 20:28:33 UTC (rev 556) @@ -240,7 +240,7 @@ //System.err.println("# type: "+tmp.getTypeName()); - for (int t = 0, l = numArgs << 1; t < l; t += 2) { + for (int t = 0, l = numArgs * 2; t < l; t += 2) { final String attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t], true); //System.err.println(" arch: '"+attrValue+"', type: '"+tmp.getTypeAttr()[t+1]+"'"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 20:22:33
|
Revision: 555 http://svn.sourceforge.net/gridarta/?rev=555&view=rev Author: akirschbaum Date: 2006-10-19 13:22:26 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:18:36 UTC (rev 554) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:22:26 UTC (rev 555) @@ -199,7 +199,7 @@ typeFound = true; } else { // check if all the type-attributes match - final int argsNum = (int) (tmp.getTypeAttr().length / 2.0); + final int numArgs = (int) (tmp.getTypeAttr().length / 2.0); boolean match = true; String attrValue; @@ -207,7 +207,7 @@ log.debug("# type: " + tmp.getTypeName()); } - for (int t = 0; t < argsNum * 2; t += 2) { + for (int t = 0; t < numArgs * 2; t += 2) { attrValue = this.gameObject.getAttributeString(tmp.getTypeAttr()[t]); if (log.isDebugEnabled()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 20:18:42
|
Revision: 554 http://svn.sourceforge.net/gridarta/?rev=554&view=rev Author: akirschbaum Date: 2006-10-19 13:18:36 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Unify whitespace. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 19:12:47 UTC (rev 553) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 20:18:36 UTC (rev 554) @@ -214,8 +214,7 @@ log.debug(" arch: '" + attrValue + "', type: '" + tmp.getTypeAttr()[t + 1] + "'"); } - if (!attrValue.equals(tmp.getTypeAttr()[t + 1]) && - !(tmp.getTypeAttr()[t + 1].equals("0") && attrValue.length() == 0)) { + if (!attrValue.equals(tmp.getTypeAttr()[t + 1]) && !(tmp.getTypeAttr()[t + 1].equals("0") && attrValue.length() == 0)) { match = false; if (log.isDebugEnabled()) { log.debug("-> attr: " + tmp.getTypeAttr()[t] + " NO match"); @@ -1078,8 +1077,7 @@ if (attr.ref.getDataType() == ArchAttribType.INT) { final String value = ((IntAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0 && !value.equals("0")) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } if (attr.ref.getDataType() == ArchAttribType.FLOAT) { @@ -1089,8 +1087,7 @@ // parse float value final double dval = Double.parseDouble(value); if (dval != 0) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } catch (final NumberFormatException e) { } @@ -1099,8 +1096,7 @@ if (attr.ref.getDataType() == ArchAttribType.STRING) { final String value = ((StringAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } if (attr.ref.getDataType() == ArchAttribType.SPELL || @@ -1108,22 +1104,19 @@ attr.ref.getDataType() == ArchAttribType.LIST) { final String value = ((ListAttrib) attr).input.getSelectedItem().toString().trim(); // the attrib value if (value != null && value.length() > 0 && !value.startsWith("<")) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } if (attr.ref.getDataType() == ArchAttribType.BITMASK) { final String value = ((BitmaskAttrib) attr).text.getText().trim(); if (value != null && value.length() > 0 && !value.startsWith("<")) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } if (attr.ref.getDataType() == ArchAttribType.TREASURE) { final String value = ((StringAttrib) attr).input.getText().trim(); // the attrib value if (value != null && value.length() > 0 && !value.equals(CFTreasureListTree.NONE_SYM)) { - doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + - value + "\n", docStyle); + doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } } @@ -1172,8 +1165,7 @@ // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { - newArchText = newArchText + attr.ref.getNameOld() + " " + - (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; + newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } } else if (dType == ArchAttribType.BOOL_SPEC) { // a boolean attribute with customized true/false values @@ -1221,8 +1213,7 @@ } } catch (final NumberFormatException e) { // parsing failed: wrong entry!! - JOptionPane.showMessageDialog(this, "Attribute '" + attr.ref.getNameNew() + - "' must be a number!", "Input Error", + JOptionPane.showMessageDialog(this, "Attribute '" + attr.ref.getNameNew() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); throw new GridderException(""); // bail out } @@ -1247,8 +1238,7 @@ } } else if (attr.ref.getNameOld().equalsIgnoreCase("face")) { // special case #2: "face"-textfield - if (archetype.getFaceName() != null && archetype.getFaceName().length() > 0 && - !inline.equals(archetype.getFaceName())) { + if (archetype.getFaceName() != null && archetype.getFaceName().length() > 0 && !inline.equals(archetype.getFaceName())) { newFace = inline; } else { newFace = ""; @@ -1261,8 +1251,7 @@ } } else if (dType == ArchAttribType.TEXT) { // a String attribute - if (attr.ref.getNameOld().equalsIgnoreCase("msg") && - ((TextAttrib) attr).input.getText().trim().length() > 0) { + if (attr.ref.getNameOld().equalsIgnoreCase("msg") && ((TextAttrib) attr).input.getText().trim().length() > 0) { newMsg = ((TextAttrib) attr).input.getText().trim(); } } else if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL || @@ -1302,12 +1291,10 @@ if (inline != null) { final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; - if (!isNone && !CFTreasureListTree.getInstance().containsTreasureList(inline) && - !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { + if (!isNone && !CFTreasureListTree.getInstance().containsTreasureList(inline) && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. - JOptionPane.showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + - "'" + inline + "' is not a known treasurelist name!", "Input Error", + JOptionPane.showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + "'" + inline + "' is not a known treasurelist name!", "Input Error", JOptionPane.ERROR_MESSAGE); throw new GridderException(""); // bail out } @@ -1328,15 +1315,13 @@ for (int i = 0; type.getAttr().length > i; i++) { if (type.getAttr()[i].getDataType() == ArchAttribType.FIXED) { final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); - if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && - !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { + if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { // usually, fixed attributes are only applied when *not* defined in the archetype. // the reason behind this is: if the default gameObject violates our fixed attribute, // we assume the default gameObject is "right" and we are "wrong". The typedefs aren't that trustworthy. // BUT - if the gameObject has a changed type, the archetype has lost it's credibility. // So, in this special case, the fixed attribute applies always. - newArchText = newArchText + type.getAttr()[i].getNameOld() + " " + - type.getAttr()[i].getNameNew() + "\n"; + newArchText = newArchText + type.getAttr()[i].getNameOld() + " " + type.getAttr()[i].getNameNew() + "\n"; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-19 19:13:02
|
Revision: 553 http://svn.sourceforge.net/gridarta/?rev=553&view=rev Author: akirschbaum Date: 2006-10-19 12:12:47 -0700 (Thu, 19 Oct 2006) Log Message: ----------- Unify ArchAttribType. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchAttrib.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; @@ -360,7 +361,7 @@ // do we have "none" spell? int active; - if (spnum == 0 && (gameObject.getAttributeString(attr.getNameOld()).length() == 0 || attr.getDataType() == CFArchAttrib.T_ZSPELL)) { + if (spnum == 0 && (gameObject.getAttributeString(attr.getNameOld()).length() == 0 || attr.getDataType() == ArchAttribType.ZSPELL)) { active = 0; } else { // now look up the spell-number in the array of spells @@ -386,7 +387,7 @@ } /** - * Construct the Combo box for arrays of "list data" (this is used for T_LIST). + * Construct the Combo box for arrays of "list data" (this is used for ArchAttribType.LIST). * @param attr list attribute * @param listData Vector with list items and corresponding values * @return the completed <code>JComboBox</code> @@ -422,7 +423,7 @@ } /** - * Construct the Panel for bitmask values (this is used for T_BITMASK) + * Construct the Panel for bitmask values (this is used for ArchAttribType.BITMASK) * @param attr spell-attribute * @param guiAttr the gui-instance of the bitmask attribute * @param bitmask the bitmask data for this attribute @@ -578,11 +579,11 @@ for (int i = 0; type.getAttr().length > i; i++) { if (type.getAttr()[i].getSecId() == secId) { // count number of attributes - if (type.getAttr()[i].getDataType() != CFArchAttrib.T_FIXED) { + if (type.getAttr()[i].getDataType() != ArchAttribType.FIXED) { number++; } // check for bitmask attributes - if (!hasBitmask && type.getAttr()[i].getDataType() == CFArchAttrib.T_BITMASK) { + if (!hasBitmask && type.getAttr()[i].getDataType() == ArchAttribType.BITMASK) { hasBitmask = true; } } @@ -608,9 +609,9 @@ // now create the attribute-GUI-instance DialogAttrib newAttr = null; - final int dType = type.getAttr()[i].getDataType(); // data type of the attribute + final ArchAttribType dType = type.getAttr()[i].getDataType(); // data type of the attribute - if (dType == CFArchAttrib.T_TEXT) { + if (dType == ArchAttribType.TEXT) { // special case: we've got a text section isText = true; // text section (need special embedding without additional scrollbars) newAttr = new TextAttrib(); @@ -651,14 +652,14 @@ fullPanel = splitPane; // return the splitpane } - if (dType == CFArchAttrib.T_BOOL || - dType == CFArchAttrib.T_BOOL_SPEC) { + if (dType == ArchAttribType.BOOL || + dType == ArchAttribType.BOOL_SPEC) { // create an attribute line for BOOL panel2 = new JPanel(new BorderLayout()); // need this layout for consistent resize-behaviour final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); newAttr = new BoolAttrib(); final JCheckBox input; - if (dType == CFArchAttrib.T_BOOL) { + if (dType == ArchAttribType.BOOL) { // normal bool input = new JCheckBox(" " + type.getAttr()[i].getNameNew(), (gameObject.getAttributeInt(type.getAttr()[i].getNameOld()) == 1)); } else { @@ -685,7 +686,7 @@ panel2.add(panel3, BorderLayout.WEST); ((BoolAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_INT) { + } else if (dType == ArchAttribType.INT) { // create an attribute line for INT panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -723,8 +724,8 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((IntAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_STRING || - dType == CFArchAttrib.T_FLOAT) { + } else if (dType == ArchAttribType.STRING || + dType == ArchAttribType.FLOAT) { // create an attribute line for STRING panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -732,7 +733,7 @@ final JLabel label = new JLabel(type.getAttr()[i].getNameNew() + ": "); - if (dType == CFArchAttrib.T_STRING) { + if (dType == ArchAttribType.STRING) { newAttr = new StringAttrib(); label.setForeground(Color.black); } else { @@ -782,14 +783,14 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); - if (dType == CFArchAttrib.T_STRING) { + if (dType == ArchAttribType.STRING) { ((StringAttrib) newAttr).input = input; } else { ((FloatAttrib) newAttr).input = input; } - } else if (dType == CFArchAttrib.T_SPELL || - dType == CFArchAttrib.T_ZSPELL || - dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.SPELL || + dType == ArchAttribType.ZSPELL || + dType == ArchAttribType.LIST) { // create an attribute line for a combo box entry panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -804,9 +805,9 @@ // create ComboBox with parsed selection final JComboBox input; - if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL) { + if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { input = buildSpellBox(type.getAttr()[i]); - } else if (dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.LIST) { if (type.getAttr()[i].getMisc() != null && typelist.getListTable().containsKey((String) (type.getAttr()[i].getMisc()[0]))) { // build the list from vector data input = buildArrayBox(type.getAttr()[i], (Vector) (typelist.getListTable().get((String) (type.getAttr()[i].getMisc()[0])))); @@ -831,7 +832,7 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); ((ListAttrib) newAttr).input = input; - } else if (dType == CFArchAttrib.T_BITMASK) { + } else if (dType == ArchAttribType.BITMASK) { // create an attribute entry for a bitmask panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -863,7 +864,7 @@ panel2.add(panel3, BorderLayout.EAST); panel2.add(panel4, BorderLayout.WEST); //((BitmaskAttrib)newAttr).input = input; - } else if (dType == CFArchAttrib.T_TREASURE) { + } else if (dType == ArchAttribType.TREASURE) { // create an attribute entry for a treasurelist panel2 = new JPanel(new BorderLayout()); final JPanel panel3 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -1067,21 +1068,21 @@ // now loop through all attributes and write out nonzero ones for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - if (attr.ref.getDataType() == CFArchAttrib.T_BOOL || - attr.ref.getDataType() == CFArchAttrib.T_BOOL_SPEC) { + if (attr.ref.getDataType() == ArchAttribType.BOOL || + attr.ref.getDataType() == ArchAttribType.BOOL_SPEC) { final boolean value = ((BoolAttrib) attr).input.isSelected(); // true/false if (value) { doc.insertString(doc.getLength(), "<" + attr.ref.getNameNew() + ">\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_INT) { + if (attr.ref.getDataType() == ArchAttribType.INT) { final String value = ((IntAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0 && !value.equals("0")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_FLOAT) { + if (attr.ref.getDataType() == ArchAttribType.FLOAT) { final String value = ((FloatAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { try { @@ -1095,30 +1096,30 @@ } } } - if (attr.ref.getDataType() == CFArchAttrib.T_STRING) { + if (attr.ref.getDataType() == ArchAttribType.STRING) { final String value = ((StringAttrib) attr).input.getText(); // the attrib value if (value != null && value.length() > 0) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_SPELL || - attr.ref.getDataType() == CFArchAttrib.T_ZSPELL || - attr.ref.getDataType() == CFArchAttrib.T_LIST) { + if (attr.ref.getDataType() == ArchAttribType.SPELL || + attr.ref.getDataType() == ArchAttribType.ZSPELL || + attr.ref.getDataType() == ArchAttribType.LIST) { final String value = ((ListAttrib) attr).input.getSelectedItem().toString().trim(); // the attrib value if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_BITMASK) { + if (attr.ref.getDataType() == ArchAttribType.BITMASK) { final String value = ((BitmaskAttrib) attr).text.getText().trim(); if (value != null && value.length() > 0 && !value.startsWith("<")) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + value + "\n", docStyle); } } - if (attr.ref.getDataType() == CFArchAttrib.T_TREASURE) { + if (attr.ref.getDataType() == ArchAttribType.TREASURE) { final String value = ((StringAttrib) attr).input.getText().trim(); // the attrib value if (value != null && value.length() > 0 && !value.equals(CFTreasureListTree.NONE_SYM)) { doc.insertString(doc.getLength(), attr.ref.getNameNew() + " = " + @@ -1165,16 +1166,16 @@ String newFace = null; String newMsg = null; for (DialogAttrib attr = attrHead; attr != null; attr = attr.next) { - final int dType = attr.ref.getDataType(); + final ArchAttribType dType = attr.ref.getDataType(); - if (dType == CFArchAttrib.T_BOOL) { + if (dType == ArchAttribType.BOOL) { // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } - } else if (dType == CFArchAttrib.T_BOOL_SPEC) { + } else if (dType == ArchAttribType.BOOL_SPEC) { // a boolean attribute with customized true/false values final String valString; // value-string to apply if (((BoolAttrib) attr).input.isSelected()) { @@ -1186,20 +1187,20 @@ if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString))) { newArchText = newArchText + attr.ref.getNameOld() + " " + valString + "\n"; } - } else if (dType == CFArchAttrib.T_INT || - dType == CFArchAttrib.T_FLOAT) { + } else if (dType == ArchAttribType.INT || + dType == ArchAttribType.FLOAT) { // an int attribute - if (dType == CFArchAttrib.T_INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { + if (dType == ArchAttribType.INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } - } else if (dType == CFArchAttrib.T_FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { + } else if (dType == ArchAttribType.FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { if (archetype.getAttributeString(attr.ref.getNameOld()).length() > 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0.0\n"; } } else { try { - if (dType == CFArchAttrib.T_INT) { + if (dType == ArchAttribType.INT) { final int value = Integer.parseInt(((IntAttrib) attr).input.getText().trim()); if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; @@ -1226,7 +1227,7 @@ throw new GridderException(""); // bail out } } - } else if (dType == CFArchAttrib.T_STRING) { + } else if (dType == ArchAttribType.STRING) { // a String attribute final String inline = ((StringAttrib) attr).input.getText().trim(); @@ -1258,17 +1259,17 @@ } } } - } else if (dType == CFArchAttrib.T_TEXT) { + } else if (dType == ArchAttribType.TEXT) { // a String attribute if (attr.ref.getNameOld().equalsIgnoreCase("msg") && ((TextAttrib) attr).input.getText().trim().length() > 0) { newMsg = ((TextAttrib) attr).input.getText().trim(); } - } else if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL || - dType == CFArchAttrib.T_LIST) { + } else if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL || + dType == ArchAttribType.LIST) { // get attribute value that should go into the gameObject final int attrVal; // attribute value - if (dType == CFArchAttrib.T_SPELL || dType == CFArchAttrib.T_ZSPELL) { + if (dType == ArchAttribType.SPELL || dType == ArchAttribType.ZSPELL) { attrVal = typelist.getSpellNum()[((ListAttrib) attr).input.getSelectedIndex()]; } else { // get selected index of ComboBox @@ -1277,8 +1278,8 @@ attrVal = (Integer) ((Vector) (typelist.getListTable().get(attr.ref.getMisc()[0]))).elementAt(2 * attrValTmp); } - if (attrVal == -1 || (attrVal == 0 && dType != CFArchAttrib.T_SPELL - && dType != CFArchAttrib.T_ZSPELL)) { + if (attrVal == -1 || (attrVal == 0 && dType != ArchAttribType.SPELL + && dType != ArchAttribType.ZSPELL)) { if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } @@ -1287,14 +1288,14 @@ } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + " " + attrVal + "\n"; } - } else if (dType == CFArchAttrib.T_BITMASK) { + } else if (dType == ArchAttribType.BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } - } else if (dType == CFArchAttrib.T_TREASURE) { + } else if (dType == ArchAttribType.TREASURE) { // a treasurelist attribute final String inline = ((StringAttrib) attr).input.getText().trim(); // input string @@ -1325,7 +1326,7 @@ // Also write all the 'fixed' attributes into the archtext for (int i = 0; type.getAttr().length > i; i++) { - if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED) { + if (type.getAttr()[i].getDataType() == ArchAttribType.FIXED) { final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import java.io.BufferedReader; import java.io.EOFException; import java.io.IOException; @@ -54,49 +55,25 @@ public static final String XML_INPUT_LENGTH = "length"; - // possible data types for attribute "values": - public static final int T_BOOL = 1; // bool (-> Checkbox) - - public static final int T_BOOL_SPEC = 2; // bool with customized true/false values - - public static final int T_INT = 3; // int (-> Textfield) - - public static final int T_FLOAT = 4; // float (-> Textfield) - - public static final int T_STRING = 5; // string (-> Textfield) - - public static final int T_TEXT = 6; // text (-> Textarea) - - public static final int T_FIXED = 7; // fixed string (no input) - - public static final int T_SPELL = 8; // spell number (-> ComboBox) - - public static final int T_ZSPELL = 9; // (like T_SPELL, except 0 is always 0, not magic bullet) - - public static final int T_BITMASK = 10; // Bitmask (-> Special input with popup frame) - - public static final int T_LIST = 11; // List (-> ComboBox) - - public static final int T_TREASURE = 12; // treasurelist (-> Textfield and Tree) - private CFArchAttrib next; // next element in the list (/array) private String nameOld; // original attr. name (from the CF arches) - private String endingOld; // for dataType = 'T_TEXT' this is the terminating string + private String endingOld; // for dataType = 'ArchAttribType.TEXT' this is the terminating string // (example: 'endmsg' for arch message) private String nameNew; // new attr. name (for the user-friendly GUI) - private int dataType; // type of attribute data (T_BOOL/T_INT/...) + private ArchAttribType dataType; // type of attribute data private String text; // descrption of this attr. private int inputLength; // optional attribute: set length for input JTextFields private String[] misc; // string array for misc. use - // T_BOOL_SPEC uses misc[0]=true value, misc[1]=false value - // T_BITMASK uses misc[0] = bitmask name, T_LIST uses misc[0] = list name + // ArchAttribType.BOOL_SPEC uses misc[0] = true value, misc[1] = false value + // ArchAttribType.BITMASK uses misc[0] = bitmask name + // ArchAttribType.LIST uses misc[0] = list name private int secId; // identifier of the section this attribute is in @@ -155,10 +132,10 @@ // which type of attribute is it? if (atype.equalsIgnoreCase("bool")) { - dataType = T_BOOL; // normal bool + dataType = ArchAttribType.BOOL; // normal bool } else if (atype.equalsIgnoreCase("bool_special")) { // customized boolean type: - dataType = T_BOOL_SPEC; + dataType = ArchAttribType.BOOL_SPEC; // parse true and false values: a1 = root.getAttribute("true"); @@ -172,13 +149,13 @@ misc[0] = a1.getValue().trim(); // string for true misc[1] = a2.getValue().trim(); // string for false } else if (atype.equalsIgnoreCase("int")) { - dataType = T_INT; + dataType = ArchAttribType.INT; } else if (atype.equalsIgnoreCase("float")) { - dataType = T_FLOAT; + dataType = ArchAttribType.FLOAT; } else if (atype.equalsIgnoreCase("string")) { - dataType = T_STRING; + dataType = ArchAttribType.STRING; } else if (atype.equalsIgnoreCase("text")) { - dataType = T_TEXT; + dataType = ArchAttribType.TEXT; // for text data, the terminating string has to be read too if ((a1 = root.getAttribute(XML_KEY_ARCH_BEGIN)) != null) { nameOld = a1.getValue().trim(); @@ -195,7 +172,7 @@ } } else if ("fixed".equalsIgnoreCase(atype)) { // fixed attribute - dataType = T_FIXED; + dataType = ArchAttribType.FIXED; if ((a1 = root.getAttribute("value")) != null) { nameNew = a1.getValue().trim(); } else { @@ -205,16 +182,16 @@ } else if ("spell".equalsIgnoreCase(atype)) { // spell attribute if (tlist.getSpellNum() == null) { - dataType = T_INT; // if we have no spells, use an INT field instead + dataType = ArchAttribType.INT; // if we have no spells, use an INT field instead } else { - dataType = T_SPELL; + dataType = ArchAttribType.SPELL; } } else if ("nz_spell".equalsIgnoreCase(atype)) { // spell attribute if (tlist.getSpellNum() == null) { - dataType = T_INT; // if we have no spells, use an INT field instead + dataType = ArchAttribType.INT; // if we have no spells, use an INT field instead } else { - dataType = T_ZSPELL; + dataType = ArchAttribType.ZSPELL; } } else if (atype.startsWith("bitmask")) { // got a bitmask attribute @@ -222,7 +199,7 @@ if (tlist.getBitmaskTable().containsKey(bitmaskName)) { // the bitmask is well defined - dataType = T_BITMASK; + dataType = ArchAttribType.BITMASK; misc = new String[1]; misc[0] = bitmaskName; // store bitmask name in misc[0] } else { @@ -234,14 +211,14 @@ if (tlist.getListTable().containsKey(listName)) { // the list is well defined - dataType = T_LIST; + dataType = ArchAttribType.LIST; misc = new String[1]; misc[0] = listName; // store list name in misc[0] } else { log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "', type " + typeName + ": List \"" + listName + "\" is undefined."); } } else if ("treasurelist".equalsIgnoreCase(atype)) { - dataType = T_TREASURE; + dataType = ArchAttribType.TREASURE; } else { // unknown type log.warn("In '" + IGUIConstants.TYPEDEF_FILE + "': Type " + typeName + " has an attribute with unknown type: '" + atype + "'."); @@ -355,7 +332,7 @@ return nameNew; } - public int getDataType() { + public ArchAttribType getDataType() { return dataType; } Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-10-19 19:12:47 UTC (rev 553) @@ -24,6 +24,7 @@ package cfeditor; +import cfeditor.gameobject.ArchAttribType; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; @@ -389,7 +390,7 @@ attrList.add(attrib); // parsing succeeded, now assign this attribute to a section - if (attrib.getDataType() == CFArchAttrib.T_TEXT) { + if (attrib.getDataType() == ArchAttribType.TEXT) { // text attributes all have their own section attrib.setSection(sectionNum, attrib.getNameNew()); sectionNum++; @@ -441,7 +442,7 @@ // create table with attributes text += "<br><br><TABLE BORDER>"; for (int i = 0; i < attr.length; i++) { - if (attr[i].getDataType() != CFArchAttrib.T_FIXED && + if (attr[i].getDataType() != ArchAttribType.FIXED && !attr[i].getSecName().equalsIgnoreCase("general")) { text += "<TR><B>"+attr[i].getNameNew()+":</B><br>"+attr[i].getText()+"</TR>"; } Added: trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java 2006-10-19 19:12:47 UTC (rev 553) @@ -0,0 +1,66 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package cfeditor.gameobject; + +/** + * Enumeration for Archetype Attribute Types. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public enum ArchAttribType { + + /** Boolean -> Checkbox. */ + BOOL, + + /** Boolean -> Checkbox, with customized true/false values. */ + BOOL_SPEC, + + /** Integer -> Textfield. */ + INT, + + /** Float -> Textfield. */ + FLOAT, + + /** String -> Textfield. */ + STRING, + + /** Text -> Textarea. */ + TEXT, + + /** Fixed String -> (No input). */ + FIXED, + + /** Spell -> Spell number (Combobox). */ + SPELL, + + /** ZSpell -> Spell number (except that 0 is always 0, not magic bullet). */ + ZSPELL, + + /** Bitmask -> Special input with popup frame. */ + BITMASK, + + /** List -> Combobox. */ + LIST, + + /** Treasure -> treasurelist (Textfield and Tree). */ + TREASURE, + +} // enum ArchAttribType Property changes on: trunk/crossfire/src/cfeditor/gameobject/ArchAttribType.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-19 19:12:47 UTC (rev 553) @@ -381,7 +381,7 @@ } /** - * Construct the Combo box for arrays of "list data" (this is used for T_LIST). + * Construct the Combo box for arrays of "list data" (this is used for LIST). * @param attr list attribute * @param listData List with list items and corresponding values, that means the types are altering: String,Integer * @return the completed <code>JComboBox</code> Modified: trunk/daimonin/src/daieditor/CFArchAttrib.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-13 21:53:52 UTC (rev 552) +++ trunk/daimonin/src/daieditor/CFArchAttrib.java 2006-10-19 19:12:47 UTC (rev 553) @@ -67,20 +67,21 @@ private String nameOld; // original attr. name (from the CF arches) - private String endingOld; // for dataType = 'T_TEXT' this is the terminating string + private String endingOld; // for dataType = 'TEXT' this is the terminating string // (example: 'endmsg' for arch message) private String nameNew; // new attr. name (for the user-friendly GUI) - private ArchAttribType dataType; // type of attribute data (T_BOOL/T_INT/...) + private ArchAttribType dataType; // type of attribute data private String text; // descrption of this attr. private int inputLength; // optional attribute: set length for input JTextFields private String[] misc; // string array for misc. use - // T_BOOL_SPEC uses misc[0]=true value, misc[1]=false value - // T_BITMASK uses misc[0] = bitmask name, T_LIST uses misc[0] = list name + // BOOL_SPEC uses misc[0] = true value, misc[1] = false value + // BITMASK uses misc[0] = bitmask name + // LIST uses misc[0] = list name private int secId; // identifier of the section this attribute is in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-13 21:54:06
|
Revision: 552 http://svn.sourceforge.net/gridarta/?rev=552&view=rev Author: christianhujer Date: 2006-10-13 14:53:52 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Added fixme comments about multi arch objects in removal from map squares. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-10-13 21:53:52 UTC (rev 552) @@ -345,6 +345,7 @@ /** * Cleans all completely blocked squares of a map. * @param mapModel Map Model to search for completely blocked squares + * @fixme this implementation does not take care of multi square objects. */ @ActionMethod public void cleanCompletelyBlockedSquares() { final MapModel mapModel = currentMap.getMapModel(); Modified: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2006-10-13 21:53:52 UTC (rev 552) @@ -35,6 +35,7 @@ /** * A SquareValidator to assert that a square that's blocked and nopass is not surrounded by blocked and nopass only. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @fixme this implementation does not take care of multi square objects. */ public class BlockedSquareChecker extends AbstractValidator implements MapValidator { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2006-10-13 21:43:08 UTC (rev 551) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObjectContainer.java 2006-10-13 21:53:52 UTC (rev 552) @@ -170,6 +170,7 @@ * Remove a GameObject from this container. * @param gameObject GameObject to remove * @throws IllegalArgumentException if <var>gameObject</var> isn't in this container + * @fixme this implementation does not take care of multi square objects. */ public final void remove(@NotNull final G gameObject) { // keep this in sync with iterator() @@ -180,7 +181,10 @@ squareChanged(); } - /** Remove all GameObjects from this container. */ + /** + * Removes all GameObjects from this container. + * @fixme this implementation does not take care of multi square objects. + */ public final void removeAll() { if (contents.size() <= 0) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-13 21:43:16
|
Revision: 551 http://svn.sourceforge.net/gridarta/?rev=551&view=rev Author: christianhujer Date: 2006-10-13 14:43:08 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Clarified that the link goes to the daimonin forum. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-10-13 18:50:52 UTC (rev 550) +++ trunk/src/doc/start.xhtml 2006-10-13 21:43:08 UTC (rev 551) @@ -41,7 +41,7 @@ <li><a href="dev/">Gridarta Developer Documentation</a> Information for Gridarta Developers</li> <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> <li><a href="history">History of Gridarta</a></li> - <li><a href="http://www.daimonin.net/index.php?name=PNphpBB2&file=viewtopic&t=283&start=15&postdays=0&postorder=asc">Cher's BLOG</a> about Gridarta</li> + <li><a href="http://www.daimonin.net/index.php?name=PNphpBB2&file=viewtopic&t=283&start=15&postdays=0&postorder=asc">Cher's BLOG</a> about Gridarta in the Daimonin Forum</li> </ul> <h2>Contact the Gridarta developers</h2> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-13 18:51:06
|
Revision: 550 http://svn.sourceforge.net/gridarta/?rev=550&view=rev Author: christianhujer Date: 2006-10-13 11:50:52 -0700 (Fri, 13 Oct 2006) Log Message: ----------- Removed redundant modifiers. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-12 17:53:43 UTC (rev 549) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-13 18:50:52 UTC (rev 550) @@ -18,7 +18,7 @@ * Create a new GameObject from this Archetype. * @return New GameObject based on this Archetype. */ - abstract G createArch(); + G createArch(); /** * Get the name of this Archetype. @@ -76,7 +76,7 @@ // TODO add documentation // TODO check whether this should return G or Archetype<G> - @Nullable public abstract G getMultiNext(); + @Nullable G getMultiNext(); // TODO proper documentation /** @return true if 'this' arch is part of a multisquare object */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-10-12 17:53:50
|
Revision: 549 http://svn.sourceforge.net/gridarta/?rev=549&view=rev Author: akirschbaum Date: 2006-10-12 10:53:43 -0700 (Thu, 12 Oct 2006) Log Message: ----------- Make "Enter Exit" work for BATTLEGROUND tiles. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/ExitTypes.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-10-11 22:56:20 UTC (rev 548) +++ trunk/crossfire/ChangeLog 2006-10-12 17:53:43 UTC (rev 549) @@ -1,3 +1,7 @@ +2006-10-12 Andreas Kirschbaum + + * Make "Enter Exit" work for BATTLEGROUND tiles. + 2006-10-08 Andreas Kirschbaum * Fix #1573023 (Arch browser's filter broken). Modified: trunk/crossfire/src/cfeditor/ExitTypes.java =================================================================== --- trunk/crossfire/src/cfeditor/ExitTypes.java 2006-10-11 22:56:20 UTC (rev 548) +++ trunk/crossfire/src/cfeditor/ExitTypes.java 2006-10-12 17:53:43 UTC (rev 549) @@ -17,6 +17,7 @@ static { EXIT_TYPES.add(41); // teleporter + EXIT_TYPES.add(58); // battleground EXIT_TYPES.add(66); // exit EXIT_TYPES.add(94); // pit EXIT_TYPES.add(95); // trapdoor This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-11 22:56:25
|
Revision: 548 http://svn.sourceforge.net/gridarta/?rev=548&view=rev Author: christianhujer Date: 2006-10-11 15:56:20 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Added a link to my blog to the gridarta homepage. Modified Paths: -------------- trunk/src/doc/start.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-10-11 21:57:17 UTC (rev 547) +++ trunk/src/doc/start.xhtml 2006-10-11 22:56:20 UTC (rev 548) @@ -41,6 +41,7 @@ <li><a href="dev/">Gridarta Developer Documentation</a> Information for Gridarta Developers</li> <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> <li><a href="history">History of Gridarta</a></li> + <li><a href="http://www.daimonin.net/index.php?name=PNphpBB2&file=viewtopic&t=283&start=15&postdays=0&postorder=asc">Cher's BLOG</a> about Gridarta</li> </ul> <h2>Contact the Gridarta developers</h2> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-11 21:57:36
|
Revision: 547 http://svn.sourceforge.net/gridarta/?rev=547&view=rev Author: christianhujer Date: 2006-10-11 14:57:17 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Implemented feature to check and delete completely blocked squares. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties Added Paths: ----------- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-10-11 19:12:24 UTC (rev 546) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-10-11 21:57:17 UTC (rev 547) @@ -69,6 +69,7 @@ import daieditor.map.validation.checks.SquareWithoutFloorChecker; import daieditor.map.validation.checks.SysObjectOnLayerZeroChecker; import daieditor.map.validation.checks.TilePathsChecker; +import daieditor.map.validation.checks.BlockedSquareChecker; import java.awt.Image; import java.awt.Point; import java.awt.Toolkit; @@ -324,6 +325,7 @@ final DelegatingMapValidator mapValidators = new DelegatingMapValidator(); mapValidators.add( new BlockedMobOrSpawnPointChecker(), + new BlockedSquareChecker(), new ConnectedInsideContainerChecker(), new ConnectedPickableChecker(), new DoubleTypeChecker(), @@ -341,6 +343,19 @@ } /** + * Cleans all completely blocked squares of a map. + * @param mapModel Map Model to search for completely blocked squares + */ + @ActionMethod public void cleanCompletelyBlockedSquares() { + final MapModel mapModel = currentMap.getMapModel(); + mapModel.beginTransaction(); + for (final MapSquare completelyBlockedSquare : BlockedSquareChecker.findCompletelyBlockedSquares(mapModel)) { + completelyBlockedSquare.removeAll(); + } + mapModel.endTransaction(); + } + + /** * Get the static instance of CMainControl. * @return static instance of this class */ Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-10-11 19:12:24 UTC (rev 546) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-10-11 21:57:17 UTC (rev 547) @@ -717,7 +717,7 @@ private final String[] directionsGo = {"goNorth", "goEast", "goSouth", "goWest", "goNorthEast", "goSouthEast", "goSouthWest", "goNorthWest"}; private void initActions() { - ACTION_FACTORY.createActions(true, mainControl, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "checkMap", "zoom", "gc", "prevWindow", "nextWindow", "onlineHelp", "tod", "about", "update"); + ACTION_FACTORY.createActions(true, mainControl, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "checkMap", "cleanCompletelyBlockedSquares", "zoom", "gc", "prevWindow", "nextWindow", "onlineHelp", "tod", "about", "update"); ACTION_FACTORY.createActions(true, mainControl, directionsMap); ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), directionsGo); ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), "selectTile", "startStopDrag", "addToSelection", "subFromSelection", "releaseDrag"); Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2006-10-11 19:12:24 UTC (rev 546) +++ trunk/daimonin/src/daieditor/action.properties 2006-10-11 21:57:17 UTC (rev 547) @@ -15,7 +15,7 @@ pickmaps.menu=lockAllPickmaps - addNewPickmap closePickmap - openPickmapMap - savePickmap revertPickmap resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists -tools.menu=newScript editScript - controlServer controlClient - checkMap - zoom gc +tools.menu=newScript editScript - controlServer controlClient - checkMap cleanCompletelyBlockedSquares - zoom gc #view.menu=+lafs - changeFont - showMonsters showExits showBackground showDoorsKeys showWall showEquipment showTreasure showConnected resetShow #view.menu=changeFont - viewShow viewAlpha #view.menu=viewShow viewAlpha gridVisible drawDouble - prevWindow nextWindow Added: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java (rev 0) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java 2006-10-11 21:57:17 UTC (rev 547) @@ -0,0 +1,129 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.map.validation.checks; + +import daieditor.gameobject.GameObject; +import daieditor.map.MapModel; +import daieditor.map.validation.AbstractValidator; +import daieditor.map.validation.ErrorCollector; +import daieditor.map.validation.MapValidator; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; +import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.MapSquare; + +/** + * A SquareValidator to assert that a square that's blocked and nopass is not surrounded by blocked and nopass only. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class BlockedSquareChecker extends AbstractValidator implements MapValidator { + + /** {@inheritDoc} */ + public void validate(final MapModel mapModel, final ErrorCollector errorCollector) { + for (final MapSquare completelyBlockedSquare : findCompletelyBlockedSquares(mapModel)) { + errorCollector.collect(new BlockedSquareError(completelyBlockedSquare)); + } + } + + /** + * Returns the completely blocked squares of a map. + * @param mapModel Map Model to search for completely blocked squares + * @return list with all completely blocked squares + */ + public static List<MapSquare> findCompletelyBlockedSquares(final MapModel mapModel) { + final Size2D mapSize = mapModel.getMapSize(); + final int mapWidth = mapSize.getWidth(); + final int mapHeight = mapSize.getHeight(); + // The blockedMatrix is 1 row larger than the map on each border to easen two things: + // First, it's not neccessary to do a bounds check then. + // Second, it will cope with the future requirement to perform this check with respect of tiled maps. + final boolean[][] blockedMatrix = new boolean[mapWidth + 2][mapHeight + 2]; + final Point pos = new Point(); + for (int x = 0; x < mapWidth; x++) { + pos.x = x; + for (int y = 0; y < mapHeight; y++) { + pos.y = y; + if (isBlocked(mapModel.getMapSquare(pos))) { + blockedMatrix[x + 1][y + 1] = true; + } + } + } + final List<MapSquare> completelyBlockedSquares = new ArrayList<MapSquare>(); + for (int x = 0; x < mapWidth; x++) { + pos.x = x; + for (int y = 0; y < mapHeight; y++) { + pos.y = y; + if (and9x9(blockedMatrix, x + 1, y + 1)) { + completelyBlockedSquares.add(mapModel.getMapSquare(pos)); + } + } + } + return completelyBlockedSquares; + } + + /** + * Returns the <code>AND</code> of a 9x9 field denoted by <var>x</var> and <var>y</var> in <var>matrix</var>. + * @param matrix Matrix to look at + * @param x x coordinate of 9x9 center + * @param y y coordinate of 9x9 center + * @return <code>AND</code> result of the 9x9 matrix around and with <var>matrix[x][y]</var>. + * @throws ArrayIndexOutOfBoundsException if <code><var>x</var> < 1</code>, <code><var>y</var> < 1</code>, <code><var>x</var> >= width - 1</code> or <code><var>y</var> >= height - 1</code>. + */ + private static boolean and9x9(final boolean[][] matrix, final int x, final int y) { + return + matrix[x - 1][y - 1] && + matrix[x - 1][ y ] && + matrix[x - 1][y + 1] && + matrix[ x ][y - 1] && + matrix[ x ][ y ] && + matrix[ x ][y + 1] && + matrix[x + 1][y - 1] && + matrix[x + 1][ y ] && + matrix[x + 1][y + 1]; + } + + /** + * Return whether a square is blocked and unpassable. + * A square is blocked if it contains a GameObject with "<code>blocksview 1</code>". + * A square is unpassable if it contains a GameObject with "<code>no_pass 1</code>". + * @param square MapSquare to check + * @return <code>true</code> if the square is blocking view and passage. + */ + private static boolean isBlocked(final MapSquare<GameObject> square) { + boolean nopass = false; + boolean blocksView = false; + for (final GameObject gameObject : square) { + if (!nopass) { + nopass = gameObject.getAttributeInt("no_pass") == 1; + } + if (!blocksView) { + blocksView = gameObject.getAttributeInt("blocksview") == 1; + } + if (nopass && blocksView) { + return true; + } + } + return false; + } + +} // class BlockedMobOrSpawnPointChecker Property changes on: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareChecker.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java (rev 0) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java 2006-10-11 21:57:17 UTC (rev 547) @@ -0,0 +1,49 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2005 Christian Hujer + * + * 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., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.map.validation.checks; + +import daieditor.gameobject.GameObject; +import daieditor.map.validation.CorrectableError; +import daieditor.map.validation.SquareValidationError; +import java.awt.Component; +import net.sf.gridarta.map.MapSquare; + +/** + * Validation error that's used when the BlockedMobOrSpawnPointChecker detected a possible error on the map. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class BlockedSquareError extends SquareValidationError implements CorrectableError { + + /** + * Create a BlockedMobOrSpawnPointError. + * @param mapSquare the square on which the error occurred + */ + public BlockedSquareError(final MapSquare<GameObject> mapSquare) { + super(mapSquare); + } + + /** {@inheritDoc} */ + public void correct(final Component parentComponent) { + // TODO: Query whether the user wants to delete the arch, delete the spawn / mob or cancel. + } + +} // class BlockedMobOrSpawnPointError Property changes on: trunk/daimonin/src/daieditor/map/validation/checks/BlockedSquareError.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-10-11 19:12:24 UTC (rev 546) +++ trunk/daimonin/src/daieditor/messages.properties 2006-10-11 21:57:17 UTC (rev 547) @@ -673,8 +673,12 @@ checkMap.text=Check map checkMap.mnemonic=M -checkMapshortdescription=Run map checker +checkMap.shortdescription=Run map checker +cleanCompletelyBlockedSquares.text=Clean blocked squares +cleanCompletelyBlockedSquares.mnemonic=B +cleanCompletelyblockedSquares.shortdescription=Cleans squares which are blocking view and passage and are only surrounded by such squares. + zoom.text=Zoom zoom.mnemonic=Z @@ -901,14 +905,17 @@ Validator.BlockedMobOrSpawnPoint.title=Blocked mob or blocked spawn point Validator.BlockedMobOrSpawnPoint.msg=<html><h3>{0}</h3><p>On this square is a mob or a spawn point,<br>but also this square is blocked by an object that cannot be passed.</p><p>You could:</p><ul><li>Remove the mob or spawn point</li><li>Change the <code>no_pass</code> flag of the blocking object to <code>0</code></li><li>Remove the blocking object</li></ul> +Validator.BlockedSquare.title=Completely Blocked Square +Validator.BlockedSquare.msg=<html><h3>{0}</h3><p>This square is completely blocked. This and all its surrounding squares are <code>no_pass 1</code> and <code>blocksview 1</code>.</p><p>Usually such squares do not make sense and their contents can be safely deleted.</p> + Validator.ConnectedInsideContainer.title=Connected object inside container Validator.ConnectedInsideContainer.msg=<html><h3>{0}</h3><p>On this square is a connected object inside a container.<br>Connected objects are not allowed inside containers.</p><p>You could:</p><ul><li>Remove the whole container</li><li>Remove the connected object inside the container</li><li>Remove the connection from the connected object</li></ul> Validator.ConnectedPickable.title=Pickable connected object Validator.ConnectedPickable.msg=<html><h3>{0}</h3><p>On this square is a connected object that can be picked up.<br>Connected objects must never leave there map and therefor must not be pickable.</p><p>You could:</p><ul><li>Remove the connected object</li><li>Set the <code>no_pick</code> flag of the connected object to 1</li></ul> -Validator.DoubleArch.title=Two arches of the same type on the same square -Validator.DoubleArch.msg=<html><h3>{0}</h3><p>On this square there are more than 1 arch of the same type.<br>While often not being an error and not being problematic at all, this sometimes happens by accident.</p><p>You could:</p><ul><li>Ignore this</li><li>Remove one of the arches</li></ul> +Validator.DoubleType.title=Two arches of the same type on the same square +Validator.DoubleType.msg=<html><h3>{0}</h3><p>On this square there are more than 1 arch of the same type.<br>While often not being an error and not being problematic at all, this sometimes happens by accident.</p><p>You could:</p><ul><li>Ignore this</li><li>Remove one of the arches</li></ul> Validator.DoubleLayer.title=Two objects within the same layer on the same square Validator.DoubleLayer.msg=<html><h3>{0}</h3><p>On this square there are more than 1 arch in the same layer.<br>While not really critical, this can lead to strange effects when displaying this square in the client.</p><p>You could:</p><ul><li>Ignore this</li><li>Remove one of the arches</li></ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-11 19:12:39
|
Revision: 546 http://svn.sourceforge.net/gridarta/?rev=546&view=rev Author: christianhujer Date: 2006-10-11 12:12:24 -0700 (Wed, 11 Oct 2006) Log Message: ----------- Bug: newly created CF GameObjects were treated like Archetypes. Fixed. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-11 19:12:24 UTC (rev 546) @@ -320,6 +320,7 @@ } } postParseDefArch(arch); + arch.setIsArchetype(); mainControl.getArchetypeSet().addArchetype(arch); archmore = false; // we assume this is last... but perhaps.. Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-11 19:12:24 UTC (rev 546) @@ -96,7 +96,6 @@ /** Create an GameObject. */ public GameObject() { - setArchetype(this); script = null; // this object stays 'null' unless there are events defined myId = myIdCounter++; // increase ID counter for every new arch created Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 14:10:07 UTC (rev 545) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-11 19:12:24 UTC (rev 546) @@ -277,7 +277,6 @@ } } postParseDefArch(arch); - // TODO cher: check whether the arch always is an Archetype and if so remove the method below. arch.setIsArchetype(); arch.setEditorFolder(newCat); mainControl.getArchetypeSet().addArchetype(arch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 14:10:21
|
Revision: 545 http://svn.sourceforge.net/gridarta/?rev=545&view=rev Author: christianhujer Date: 2006-10-09 07:10:07 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added missing {@inheritDoc}. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapModel.java trunk/daimonin/src/daieditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-10-09 14:02:58 UTC (rev 544) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-10-09 14:10:07 UTC (rev 545) @@ -63,6 +63,7 @@ /** {@inheritDoc} */ void squareChanged(@NotNull MapSquare<GameObject> square); + /** {@inheritDoc} */ MapArchObject getMapArchObject(); /** Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-10-09 14:02:58 UTC (rev 544) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-10-09 14:10:07 UTC (rev 545) @@ -98,6 +98,7 @@ */ void clearMap(); + /** {@inheritDoc} */ MapArchObject getMapArchObject(); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 14:03:14
|
Revision: 544 http://svn.sourceforge.net/gridarta/?rev=544&view=rev Author: christianhujer Date: 2006-10-09 07:02:58 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Replaced GameObject with Archetype where already possible. Modified Paths: -------------- trunk/crossfire/src/cfeditor/AutojoinList.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/AutojoinList.java =================================================================== --- trunk/crossfire/src/cfeditor/AutojoinList.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/crossfire/src/cfeditor/AutojoinList.java 2006-10-09 14:02:58 UTC (rev 544) @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.BufferedReader; import net.sf.gridarta.io.IOUtils; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -142,11 +143,11 @@ } else if (count < 16) { // add a new archid to the buffer - final GameObject arch = archstack.getArchetype(line); - if (arch != null) { + final Archetype<GameObject> archetype = archstack.getArchetype(line); + if (archetype != null) { nbuf[count] = line; - if (!arch.isMulti()) { + if (!archetype.isMulti()) { count++; // no multipart, this one's okay } else { log.warn("In file " + filename + ": Arch '" + line + "' is a multipart."); Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-10-09 14:02:58 UTC (rev 544) @@ -59,6 +59,7 @@ import javax.swing.SwingConstants; import net.sf.gridarta.io.IOUtils; import net.sf.gridarta.gameobject.AbstractArchetypeSet; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -560,7 +561,7 @@ // loop through all existing ArchPanels and find all arches // along with their display-category - GameObject archetype; + Archetype<GameObject> archetype; for (CArchPanel.PanelNode node = CArchPanel.getStartPanelNode(); node != null; node = node.next) { @@ -648,7 +649,7 @@ } // finally we need to get the "map"-arch, which is not in the panels - final GameObject maparch = getArchetype(ArchetypeParser.STARTARCH_NAME); + final Archetype<GameObject> maparch = getArchetype(ArchetypeParser.STARTARCH_NAME); if (maparch != null) { count++; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 14:00:33 UTC (rev 543) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 14:02:58 UTC (rev 544) @@ -38,6 +38,7 @@ import java.util.NoSuchElementException; import javax.swing.event.EventListenerList; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; @@ -219,7 +220,7 @@ /** {@inheritDoc} */ public boolean isMultiArchFittingToMap(final String archName, final Point pos, final boolean allowDouble) { - final GameObject head = getArchetype(archName); + final Archetype<GameObject> head = getArchetype(archName); final Point mapH = new Point(head.getMultiX(), head.getMultiY()); mapH.translate(pos.x, pos.y); if (!isPointValid(mapH)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 14:00:53
|
Revision: 543 http://svn.sourceforge.net/gridarta/?rev=543&view=rev Author: christianhujer Date: 2006-10-09 07:00:33 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus variable naming. Modified Paths: -------------- trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 13:47:26 UTC (rev 542) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-10-09 14:00:33 UTC (rev 543) @@ -253,15 +253,15 @@ return false; } - final GameObject defaultArch = getArchetype(archName); + final GameObject archetype = getArchetype(archName); // FIXME: Check maximum RefX and RefY to check whether the multitile arch fits on the map. - if (pos.x + defaultArch.getMinX() < 0 || pos.y + defaultArch.getMinY() < 0 || pos.x + defaultArch.getMaxX() > mapSize.getWidth() || pos.y + defaultArch.getMaxY() > mapSize.getHeight()) { + if (pos.x + archetype.getMinX() < 0 || pos.y + archetype.getMinY() < 0 || pos.x + archetype.getMaxX() > mapSize.getWidth() || pos.y + archetype.getMaxY() > mapSize.getHeight()) { // does not fit on map Toolkit.getDefaultToolkit().beep(); return false; } - final GameObject head = defaultArch.createArch(); + final GameObject head = archetype.createArch(); head.setMapX(pos.x); head.setMapY(pos.y); if (insertBelow) { @@ -269,10 +269,10 @@ } else { mapGrid[pos.x][pos.y].addLast(head); } - head.setDirection(defaultArch.getDirection()); + head.setDirection(archetype.getDirection()); mainControl.getArchetypeParser().postParseMapArch(head, mapControl.getActiveEditType()); head.setObjectFace(); - for (GameObject tailArch = defaultArch.getMultiNext(); tailArch != null; tailArch = tailArch.getMultiNext()) { + for (GameObject tailArch = archetype.getMultiNext(); tailArch != null; tailArch = tailArch.getMultiNext()) { final Point posT = new Point(tailArch.getMultiX(), tailArch.getMultiY()); posT.translate(pos.x, pos.y); final GameObject tail = tailArch.createArch(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 13:47:32
|
Revision: 542 http://svn.sourceforge.net/gridarta/?rev=542&view=rev Author: christianhujer Date: 2006-10-09 06:47:26 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed return type of getArchetype() to match generics. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-10-09 13:45:45 UTC (rev 541) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-10-09 13:47:26 UTC (rev 542) @@ -33,7 +33,7 @@ * @return Archetype for <var>archetypeName</var> or <code>null</code> if no such Archetype * @see GameObject#createArch() for a similar method that instantiates. */ - @Nullable GameObject getArchetype(@NotNull final String archetypeName); + @Nullable G getArchetype(@NotNull final String archetypeName); /** * Adds an Archetype to this Set. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 13:45:52
|
Revision: 541 http://svn.sourceforge.net/gridarta/?rev=541&view=rev Author: christianhujer Date: 2006-10-09 06:45:45 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled getMultiX() and getMultiY() up into Archetype. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:13:22 UTC (rev 540) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:45:45 UTC (rev 541) @@ -83,6 +83,22 @@ boolean isMulti(); /** + * Get the x-distance of this part to the head part. + * For single-part objects this is always zero. + * + * @return the x-distance of this part to the head part + */ + int getMultiX(); + + /** + * Get the y-distance of this part to the head part. + * For single-part objects this is always zero. + * + * @return the y-distance of this part to the head part + */ + int getMultiY(); + + /** * Determine if this part is a tail part. For single-part objects this is * never true. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 13:13:28
|
Revision: 540 http://svn.sourceforge.net/gridarta/?rev=540&view=rev Author: christianhujer Date: 2006-10-09 06:13:22 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled up getObjectText() into Archetype interface. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:11:57 UTC (rev 539) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:13:22 UTC (rev 540) @@ -126,4 +126,10 @@ */ @Deprecated int getDirection(); + /** + * Returns the object text of this Archetype as String. + * @return the object text + */ + @NotNull String getObjectText(); + } // interface Archetype This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 13:12:04
|
Revision: 539 http://svn.sourceforge.net/gridarta/?rev=539&view=rev Author: christianhujer Date: 2006-10-09 06:11:57 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added isTail() to Archetype interface. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:08:16 UTC (rev 538) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 13:11:57 UTC (rev 539) @@ -82,6 +82,14 @@ /** @return true if 'this' arch is part of a multisquare object */ boolean isMulti(); + /** + * Determine if this part is a tail part. For single-part objects this is + * never true. + * + * @return <code>true</code> iff this part if a tail part + */ + boolean isTail(); + // TODO documentation int getArchTypNr(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 13:08:23
|
Revision: 538 http://svn.sourceforge.net/gridarta/?rev=538&view=rev Author: christianhujer Date: 2006-10-09 06:08:16 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Improved generics typing of ArchetypeSet. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java 2006-10-09 12:59:52 UTC (rev 537) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSet.java 2006-10-09 13:08:16 UTC (rev 538) @@ -11,13 +11,13 @@ * Base implementation of ArchetypeSet. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public abstract class AbstractArchetypeSet<T extends GameObject> implements ArchetypeSet<T> { +public abstract class AbstractArchetypeSet<G extends GameObject<G>> implements ArchetypeSet<G> { /** The load status of this ArchetypeSet. */ private LoadStatus loadStatus = LoadStatus.EMPTY; /** The defined Archetypes. */ - private final Map<String, T> archetypeMap = new TreeMap<String, T>(); + private final Map<String, G> archetypeMap = new TreeMap<String, G>(); /** * Whether Archetypes were loaded form an archive. @@ -48,12 +48,12 @@ } /** {@inheritDoc} */ - @Nullable public final T getArchetype(@NotNull final String archetypeName) { + @Nullable public final G getArchetype(@NotNull final String archetypeName) { return archetypeMap.get(archetypeName); } /** {@inheritDoc} */ - public final void addArchetype(@NotNull final T archetype) { + public final void addArchetype(@NotNull final G archetype) { if (!archetype.isArchetype()) { throw new NotArchetypeException(archetype); } @@ -69,7 +69,7 @@ * Handle a duplicate Archetype * @param archetype Dupliate Archetype to handle */ - protected abstract void handleDuplicate(final T archetype); + protected abstract void handleDuplicate(final G archetype); /** * Sets the load status @@ -93,7 +93,7 @@ * Returns a read-only collection of all Archetypes. * @return A read-only collection of all Archetypes. */ - protected Collection<T> getArchetypes() { + protected Collection<G> getArchetypes() { return Collections.unmodifiableCollection(archetypeMap.values()); } Modified: trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-10-09 12:59:52 UTC (rev 537) +++ trunk/src/app/net/sf/gridarta/gameobject/ArchetypeSet.java 2006-10-09 13:08:16 UTC (rev 538) @@ -7,7 +7,7 @@ * Interface that captures similarities between different ArchetypeSet implementations. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface ArchetypeSet<T extends GameObject> { +public interface ArchetypeSet<G extends GameObject<G>> { /** * Returns the load status of this ArchetypeSet. @@ -40,7 +40,7 @@ * @param archetype Archetype to add. * @throws IllegalArgumentException in case the added GameObject is not an Archetype. */ - void addArchetype(@NotNull final T archetype) throws IllegalArgumentException; + void addArchetype(@NotNull final G archetype) throws IllegalArgumentException; /** * Instructs this ArchetypeSet to load its Archetypes. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:59:58
|
Revision: 537 http://svn.sourceforge.net/gridarta/?rev=537&view=rev Author: christianhujer Date: 2006-10-09 05:59:52 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed broken comment. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 12:58:45 UTC (rev 536) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 12:59:52 UTC (rev 537) @@ -493,7 +493,7 @@ gameObject.setMultiX(archetype.getMultiX()); gameObject.setMultiY(archetype.getMultiY()); - // arch.setEditType(defarch.getEditType()); + // gameObject.setEditType(archetype.getEditType()); // validate the ScriptedEvents gameObject.validateAllEvents(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:58:50
|
Revision: 536 http://svn.sourceforge.net/gridarta/?rev=536&view=rev Author: christianhujer Date: 2006-10-09 05:58:45 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed broken comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 12:57:11 UTC (rev 535) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 12:58:45 UTC (rev 536) @@ -496,7 +496,7 @@ gameObject.setMultiX(archetype.getMultiX()); gameObject.setMultiY(archetype.getMultiY()); - // arch.setEditType(defarch.getEditType()); + // gameObject.setEditType(archetype.getEditType()); // validate the ScriptedEvents gameObject.validateAllEvents(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:57:24
|
Revision: 535 http://svn.sourceforge.net/gridarta/?rev=535&view=rev Author: christianhujer Date: 2006-10-09 05:57:11 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus variable naming; Changed GameObject to Archetype where used as an Archetype in CArchQuickView. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/daimonin/src/daieditor/CArchQuickView.java Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-10-09 12:15:54 UTC (rev 534) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-10-09 12:57:11 UTC (rev 535) @@ -34,6 +34,7 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ScrollPaneConstants; +import net.sf.gridarta.gameobject.Archetype; /** * The <code>CArchQuickView</code> holds the tile palette. @@ -108,11 +109,11 @@ /** * Show quick info for an object. * - * @param archPart the object to show; this may be any part of a multi-part + * @param gameObjectPart the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject archPart) { - if (archPart == null) { + void showArchPanelQuickObject(final GameObject gameObjectPart) { + if (gameObjectPart == null) { archArchNameText.setText("<html><font color=black>Arch:</font></html>"); archObjNameText.setText("<html><font color=black>Name:</font></html>"); archTypeText.setText("<html><font color=black>Type:</font></html>"); @@ -120,34 +121,34 @@ return; } - final GameObject arch = archPart.getHead(); - archArchNameText.setText("<html><font color=black>Arch: " + arch.getArchetypeName() + "</font></html>"); - if (arch.getObjName() == null || arch.getObjName().length() <= 0) { - final GameObject def = arch.getArchetype(); - if (def == null || def == arch) { + final GameObject gameObject = gameObjectPart.getHead(); + archArchNameText.setText("<html><font color=black>Arch: " + gameObject.getArchetypeName() + "</font></html>"); + if (gameObject.getObjName() == null || gameObject.getObjName().length() <= 0) { + final Archetype<GameObject> archetype = gameObject.getArchetype(); + if (archetype == null || archetype == gameObject) { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); - } else if (def.getObjName() != null && def.getObjName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: " + def.getObjName() + "</font></html>"); - } else if (def.getArchetypeName() != null && def.getArchetypeName().length() > 0) { - archObjNameText.setText("<html><font color=black>Name: " + def.getArchetypeName() + "</font></html>"); + } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { + archObjNameText.setText("<html><font color=black>Name: " + archetype.getObjName() + "</font></html>"); + } else if (archetype.getArchetypeName() != null && archetype.getArchetypeName().length() > 0) { + archObjNameText.setText("<html><font color=black>Name: " + archetype.getArchetypeName() + "</font></html>"); } else { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } } else { - archObjNameText.setText("<html><font color=black>Name: " + arch.getObjName() + "</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + gameObject.getObjName() + "</font></html>"); } - archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ") </font></html>"); + archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ") </font></html>"); - if (arch.isMulti()) { - archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + arch.getMultiRefCount() + " parts) (" + arch.getSizeX() + "," + arch.getSizeY() + ")</font></html>"); + if (gameObject.isMulti()) { + archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + "," + gameObject.getSizeY() + ")</font></html>"); } else { archTileText.setText("<html><font color=black>Tile: single" + "</font></html>"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(arch, false); + ReplaceDialog.getInstance().updateArchSelection(gameObject, false); } } Modified: trunk/daimonin/src/daieditor/CArchQuickView.java =================================================================== --- trunk/daimonin/src/daieditor/CArchQuickView.java 2006-10-09 12:15:54 UTC (rev 534) +++ trunk/daimonin/src/daieditor/CArchQuickView.java 2006-10-09 12:57:11 UTC (rev 535) @@ -30,6 +30,7 @@ import java.awt.GridBagLayout; import javax.swing.JLabel; import javax.swing.JPanel; +import net.sf.gridarta.gameobject.Archetype; /** * The <code>CArchQuickView</code> holds the tile palette. @@ -90,11 +91,11 @@ /** * Show quick info for an object. * - * @param archPart the object to show; this may be any part of a multi-part + * @param gameObjectPart the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject archPart) { - if (archPart == null) { + void showArchPanelQuickObject(final GameObject gameObjectPart) { + if (gameObjectPart == null) { if (mainControl.getMainView().isPickmapActive()) { archObjNameText.setText(" -random pick- "); archObjNameText.setForeground(Color.BLUE); @@ -105,14 +106,14 @@ archTypeText.setText(null); archTileText.setText(null); } else { - final GameObject arch = archPart.getHead(); - String objName = arch.getObjName(); + final GameObject gameObject = gameObjectPart.getHead(); + String objName = gameObject.getObjName(); if (objName == null || objName.length() == 0) { - final GameObject def = arch.getArchetype(); - if (def == null || def == arch) { + final Archetype<GameObject> archetype = gameObject.getArchetype(); + if (archetype == null || archetype == gameObject) { objName = null; - } else if ((objName = def.getObjName()) != null && objName.length() != 0) { - } else if ((objName = def.getArchetypeName()) != null && objName.length() != 0) { + } else if ((objName = archetype.getObjName()) != null && objName.length() != 0) { + } else if ((objName = archetype.getArchetypeName()) != null && objName.length() != 0) { } else { objName = null; } @@ -125,19 +126,19 @@ } archObjNameText.setText(objName); - archArchNameText.setText(arch.getArchetypeName()); + archArchNameText.setText(gameObject.getArchetypeName()); - archTypeText.setText(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ')'); + archTypeText.setText(mainControl.getTypeList().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ')'); - if (arch.isMulti()) { - archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + arch.getMultiRefCount() + " parts) (" + arch.getSizeX() + ',' + arch.getSizeY() + ")</html>"); + if (gameObject.isMulti()) { + archTileText.setText("<html><span style=\"color:green;\"> multi</span> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + ',' + gameObject.getSizeY() + ")</html>"); } else { archTileText.setText("single"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(arch, false); + ReplaceDialog.getInstance().updateArchSelection(gameObject, false); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |