From: <aki...@us...> - 2006-11-26 17:33:39
|
Revision: 712 http://svn.sourceforge.net/gridarta/?rev=712&view=rev Author: akirschbaum Date: 2006-11-26 09:33:39 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/io/CMapWriter.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 17:29:48 UTC (rev 711) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 17:33:39 UTC (rev 712) @@ -47,6 +47,7 @@ */ public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject> implements MapModel { + /** Logger. */ private static final Logger log = Logger.getLogger(DefaultMapModel.class); /** Flag that indicates if the level has been changed since last save. */ Modified: trunk/daimonin/src/daieditor/io/CMapWriter.java =================================================================== --- trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-26 17:29:48 UTC (rev 711) +++ trunk/daimonin/src/daieditor/io/CMapWriter.java 2006-11-26 17:33:39 UTC (rev 712) @@ -34,6 +34,7 @@ import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.io.AbstractMapWriter; import net.sf.gridarta.io.MapWriter; +import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; /** Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 17:29:48 UTC (rev 711) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 17:33:39 UTC (rev 712) @@ -36,6 +36,7 @@ import net.sf.gridarta.map.AbstractMapModel; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; +import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; /** @@ -54,6 +55,9 @@ */ public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject> implements MapModel { + /** Logger. */ + private static final Logger log = Logger.getLogger(DefaultMapModel.class); + /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:36:23
|
Revision: 713 http://svn.sourceforge.net/gridarta/?rev=713&view=rev Author: akirschbaum Date: 2006-11-26 09:36:15 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-11-26 17:33:39 UTC (rev 712) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObject.java 2006-11-26 17:36:15 UTC (rev 713) @@ -39,6 +39,7 @@ */ public final class FaceObject extends AbstractFaceObject { + /** Logger. */ private static final Logger log = Logger.getLogger(FaceObject.class); //private ImageIcon face; Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2006-11-26 17:33:39 UTC (rev 712) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObject.java 2006-11-26 17:36:15 UTC (rev 713) @@ -23,6 +23,7 @@ import javax.swing.ImageIcon; import net.sf.gridarta.gameobject.face.AbstractFaceObject; +import org.apache.log4j.Logger; /** * A FaceObject stores information and meta information about a face and provides methods for accessing these. @@ -40,6 +41,9 @@ */ public class FaceObject extends AbstractFaceObject { + /** Logger. */ + private static final Logger log = Logger.getLogger(FaceObject.class); + /** The face name. */ private final String faceName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:47:43
|
Revision: 714 http://svn.sourceforge.net/gridarta/?rev=714&view=rev Author: akirschbaum Date: 2006-11-26 09:47:43 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/daimonin/src/daieditor/IGUIConstants.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-11-26 17:36:15 UTC (rev 713) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-11-26 17:47:43 UTC (rev 714) @@ -104,14 +104,17 @@ */ int DOUBLECLICK_MS = 300; - // defaults for new maps - String DEF_MAPFNAME = "<new map>"; // default file name + /** Default file name for new maps. */ + String DEF_MAPFNAME = "<new map>"; - int DEF_MAPSIZE = 10; // default map size (both lenght & width) + /** Default map size (both height and width). */ + int DEF_MAPSIZE = 10; - int DEF_PICKMAP_WIDTH = 7; // default width for pickmaps + /** Default width for pickmaps. */ + int DEF_PICKMAP_WIDTH = 7; - int DEF_PICKMAP_HEIGHT = 12; // default height for pickmaps + /** Default height for pickmaps. */ + int DEF_PICKMAP_HEIGHT = 12; /** The directory that contains the common-use icons. */ String ICON_DIR = "resource" + File.separator + "icons"; Modified: trunk/daimonin/src/daieditor/IGUIConstants.java =================================================================== --- trunk/daimonin/src/daieditor/IGUIConstants.java 2006-11-26 17:36:15 UTC (rev 713) +++ trunk/daimonin/src/daieditor/IGUIConstants.java 2006-11-26 17:47:43 UTC (rev 714) @@ -98,22 +98,25 @@ int[] ALL_TILE_PATHS = {TILE_PATH_NORTH, TILE_PATH_EAST, TILE_PATH_SOUTH, TILE_PATH_WEST, TILE_PATH_NORTHEAST, TILE_PATH_SOUTHEAST, TILE_PATH_SOUTHWEST, TILE_PATH_NORTHWEST}; /** - * The height of rigid area between the two tab-panes on - * the pickmap- and arch-panel. + * The height of rigid area between the two tab-panes on the pickmap- and + * arch-panel. */ int SPACE_PICKARCH_TOP = 10; /** The Border object to be used when creating dialogs. */ Border DIALOG_BORDER = new EmptyBorder(new Insets(4, 4, 4, 4)); - // defaults for new maps - String DEF_MAPFNAME = "<new map>"; // default file name + /** Default file name for new maps. */ + String DEF_MAPFNAME = "<new map>"; - int DEF_MAPSIZE = 24; // default map size (both lenght & width) + /** Default map size (both height and width). */ + int DEF_MAPSIZE = 24; - int DEF_PICKMAP_WIDTH = 20; // default width for pickmaps + /** Default width for pickmaps. */ + int DEF_PICKMAP_WIDTH = 20; - int DEF_PICKMAP_HEIGHT = 20; // default height for pickmaps + /** Default height for pickmaps. */ + int DEF_PICKMAP_HEIGHT = 20; /** The directory that contains the common-use icons.*/ String ICON_DIR = "resource" + File.separator + "icons"; @@ -122,14 +125,12 @@ String SYSTEM_DIR = "resource" + File.separator + "system"; /** The directory that contains all pickmaps. */ - // public static final String PICKMAP_DIR = "resource"+File.separator+"pickmaps"; String PICKMAP_DIR = "dev" + File.separator + "editor" + File.separator + "pickmaps"; /** * The directory that contains all configuration files (careful - if you * change this, check directory creation for file writing). */ - // public static final String CONFIG_DIR = "resource"+File.separator+"conf"; String CONFIG_DIR = "dev" + File.separator + "editor" + File.separator + "conf"; // name of the configuration files: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:54:55
|
Revision: 715 http://svn.sourceforge.net/gridarta/?rev=715&view=rev Author: akirschbaum Date: 2006-11-26 09:54:54 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify implementation -- add (unused) attributes to cfeditor; remove unused field. Modified Paths: -------------- trunk/crossfire/src/cfeditor/MultiArchData.java trunk/daimonin/src/daieditor/MultiArchData.java Modified: trunk/crossfire/src/cfeditor/MultiArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 17:47:43 UTC (rev 714) +++ trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 17:54:54 UTC (rev 715) @@ -61,6 +61,11 @@ private int minY = 0; /** + * The shape ID of this object. + */ + private int multiShapeID; + + /** * All parts belonging to this multi-part object; the first element is the * head part. */ @@ -144,6 +149,24 @@ } /** + * Return the shape ID of this object. + * + * @return the shape ID of this object + */ + public int getMultiShapeID() { + return multiShapeID; + } + + /** + * Set the shape ID of this object. + * + * @param multiShapeID the new shape ID of this object + */ + public void setMultiShapeID(final int multiShapeID) { + this.multiShapeID = multiShapeID; + } + + /** * Return the head part of this multi-part object. * * @return the head part Modified: trunk/daimonin/src/daieditor/MultiArchData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 17:47:43 UTC (rev 714) +++ trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 17:54:54 UTC (rev 715) @@ -60,10 +60,11 @@ */ private int minY = 0; - private int multiShapeID; // the ID of the multiPositionData + /** + * The shape ID of this object. + */ + private int multiShapeID; - private int multiPartNr; // the part number for this tile - /** * All parts belonging to this multi-part object; the first element is the * head part. @@ -147,10 +148,20 @@ return minY; } + /** + * Return the shape ID of this object. + * + * @return the shape ID of this object + */ public int getMultiShapeID() { return multiShapeID; } + /** + * Set the shape ID of this object. + * + * @param multiShapeID the new shape ID of this object + */ public void setMultiShapeID(final int multiShapeID) { this.multiShapeID = multiShapeID; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-26 18:42:44
|
Revision: 717 http://svn.sourceforge.net/gridarta/?rev=717&view=rev Author: christianhujer Date: 2006-11-26 10:42:44 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Removed unused imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CFJavaEditor.java Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 18:41:50 UTC (rev 716) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 18:42:44 UTC (rev 717) @@ -27,7 +27,6 @@ import cfeditor.CMainControl; import cfeditor.CMainStatusbar; import cfeditor.CMapViewBasic; -import cfeditor.GridderException; import cfeditor.IGUIConstants; import cfeditor.MapViewIFrame; import cfeditor.gameobject.GameObject; Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 18:41:50 UTC (rev 716) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 18:42:44 UTC (rev 717) @@ -30,7 +30,6 @@ import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; -import java.util.logging.Level; import static java.util.prefs.Preferences.userNodeForPackage; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 19:01:02
|
Revision: 718 http://svn.sourceforge.net/gridarta/?rev=718&view=rev Author: akirschbaum Date: 2006-11-26 11:00:58 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify MultiArchData implementation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/MultiArchData.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/MultiArchData.java trunk/daimonin/src/daieditor/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/MultiArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 18:42:44 UTC (rev 717) +++ trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 19:00:58 UTC (rev 718) @@ -25,8 +25,8 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import java.util.ArrayList; +import net.sf.gridarta.gameobject.GameObject; /** * Class related to {@link GameObject} to store multipart information. This @@ -38,7 +38,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class MultiArchData { +public final class MultiArchData<G extends GameObject> { /** * Maximum coordinate of any part; it is never negative. @@ -69,14 +69,14 @@ * All parts belonging to this multi-part object; the first element is the * head part. */ - private final ArrayList<GameObject> parts = new ArrayList<GameObject>(); + private final ArrayList<G> parts = new ArrayList<G>(); /** * Create a new instance. * * @param head the head part of the multi-part object */ - public MultiArchData(final GameObject head) { + public MultiArchData(final G head) { assert head.getMultiX() == 0 && head.getMultiY() == 0; parts.add(head); } @@ -171,7 +171,7 @@ * * @return the head part */ - public GameObject getHead() { + public G getHead() { return parts.get(0); } @@ -182,7 +182,7 @@ * * @return the part following the current part */ - public GameObject getNext(final GameObject ob) { + public G getNext(final G ob) { assert ob != null; final int index = parts.indexOf(ob); assert index != -1; @@ -194,7 +194,7 @@ * * @param tail the tail part to add */ - public void addPart(final GameObject tail) { + public void addPart(final G tail) { assert tail != null; parts.add(tail); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-26 18:42:44 UTC (rev 717) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-26 19:00:58 UTC (rev 718) @@ -71,7 +71,7 @@ * Data for multitile-arches. * Stays null for singlesquare-arches. */ - @Nullable private MultiArchData multi = null; + @Nullable private MultiArchData<GameObject> multi = null; /** * Data for scripted events. @@ -417,7 +417,7 @@ */ private void initMultiData() { if (multi == null) { - multi = new MultiArchData(this); + multi = new MultiArchData<GameObject>(this); } } // ----- end multi-arch get/set ----- Modified: trunk/daimonin/src/daieditor/MultiArchData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 18:42:44 UTC (rev 717) +++ trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 19:00:58 UTC (rev 718) @@ -25,8 +25,8 @@ package daieditor; -import daieditor.gameobject.GameObject; import java.util.ArrayList; +import net.sf.gridarta.gameobject.GameObject; /** * Class related to {@link GameObject} to store multipart information. This @@ -38,7 +38,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author Andreas Kirschbaum */ -public final class MultiArchData { +public final class MultiArchData<G extends GameObject> { /** * Maximum coordinate of any part; it is never negative. @@ -69,14 +69,14 @@ * All parts belonging to this multi-part object; the first element is the * head part. */ - private final ArrayList<GameObject> parts = new ArrayList<GameObject>(); + private final ArrayList<G> parts = new ArrayList<G>(); /** * Create a new instance. * * @param head the head part of the multi-part object */ - public MultiArchData(final GameObject head) { + public MultiArchData(final G head) { assert head.getMultiX() == 0 && head.getMultiY() == 0; parts.add(head); } @@ -171,7 +171,7 @@ * * @return the head part */ - public GameObject getHead() { + public G getHead() { return parts.get(0); } @@ -182,7 +182,7 @@ * * @return the part following the current part */ - public GameObject getNext(final GameObject ob) { + public G getNext(final G ob) { assert ob != null; final int index = parts.indexOf(ob); assert index != -1; @@ -194,7 +194,7 @@ * * @param tail the tail part to add */ - public void addPart(final GameObject tail) { + public void addPart(final G tail) { assert tail != null; parts.add(tail); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 18:42:44 UTC (rev 717) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 19:00:58 UTC (rev 718) @@ -79,7 +79,7 @@ * Data for multitile-arches. * Stays null for singlesquare-arches. */ - @Nullable private MultiArchData multi = null; + @Nullable private MultiArchData<GameObject> multi = null; private int multiPartNr = 0; @@ -353,7 +353,7 @@ */ private void initMultiData() { if (multi == null) { - multi = new MultiArchData(this); + multi = new MultiArchData<GameObject>(this); } } // ----- end multi-arch get/set ----- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 19:20:42
|
Revision: 719 http://svn.sourceforge.net/gridarta/?rev=719&view=rev Author: akirschbaum Date: 2006-11-26 11:20:41 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Move unified MultiArchData to gridarta. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/MultiArchData.java trunk/daimonin/src/daieditor/MultiArchData.java Deleted: trunk/crossfire/src/cfeditor/MultiArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 19:00:58 UTC (rev 718) +++ trunk/crossfire/src/cfeditor/MultiArchData.java 2006-11-26 19:20:41 UTC (rev 719) @@ -1,217 +0,0 @@ -/* - * Crossfire Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 Andreas Kirschbaum - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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; - -import java.util.ArrayList; -import net.sf.gridarta.gameobject.GameObject; - -/** - * Class related to {@link GameObject} to store multipart information. This - * data is only used for multi-part objects. When the editor is running, - * usually a big number of <code>GameObject</code>s exist - most of them - * single-part objects. The encapsulation of this "multi-part-only" data can - * save a little bit of memory. - * - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author Andreas Kirschbaum - */ -public final class MultiArchData<G extends GameObject> { - - /** - * Maximum coordinate of any part; it is never negative. - */ - private int maxX = 0; - - /** - * Maximum coordinate of any part; it is never negative. - */ - private int maxY = 0; - - /** - * Minimum coordinate of any part; it is never positive. - */ - private int minX = 0; - - /** - * Minimum coordinate of any part; it is never positive. - */ - private int minY = 0; - - /** - * The shape ID of this object. - */ - private int multiShapeID; - - /** - * All parts belonging to this multi-part object; the first element is the - * head part. - */ - private final ArrayList<G> parts = new ArrayList<G>(); - - /** - * Create a new instance. - * - * @param head the head part of the multi-part object - */ - public MultiArchData(final G head) { - assert head.getMultiX() == 0 && head.getMultiY() == 0; - parts.add(head); - } - - /** - * Return the number of parts this multi-part objects contains. - */ - public int getMultiRefCount() { - return parts.size(); - } - - /** - * Determine the horizontal extent in tiles. For single-part objects 1 is - * returned. - * - * @return the horizontal extent - */ - public int getSizeX() { - return maxX - minX + 1; - } - - /** - * Determine the vertical extent in tiles. For single-part objects 1 is - * returned. - * - * @return the vertical extent - */ - public int getSizeY() { - return maxY - minY + 1; - } - - /** - * Determine the maximum x-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the maximum x-coordinate - */ - public int getMaxX() { - return maxX; - } - - /** - * Determine the maximum y-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the maximum y-coordinate - */ - public int getMaxY() { - return maxY; - } - - /** - * Determine the minimum x-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the minimum x-coordinate - */ - public int getMinX() { - return minX; - } - - /** - * Determine the minimum y-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the minimum y-coordinate - */ - public int getMinY() { - return minY; - } - - /** - * Return the shape ID of this object. - * - * @return the shape ID of this object - */ - public int getMultiShapeID() { - return multiShapeID; - } - - /** - * Set the shape ID of this object. - * - * @param multiShapeID the new shape ID of this object - */ - public void setMultiShapeID(final int multiShapeID) { - this.multiShapeID = multiShapeID; - } - - /** - * Return the head part of this multi-part object. - * - * @return the head part - */ - public G getHead() { - return parts.get(0); - } - - /** - * Return the part following a given part. - * - * @param the current part - * - * @return the part following the current part - */ - public G getNext(final G ob) { - assert ob != null; - final int index = parts.indexOf(ob); - assert index != -1; - return index + 1 < parts.size() ? parts.get(index + 1) : null; - } - - /** - * Add a part to this multi-part object. - * - * @param tail the tail part to add - */ - public void addPart(final G tail) { - assert tail != null; - - parts.add(tail); - - final int x = tail.getMultiX(); - if (x < minX) { - minX = x; - } else if (x > maxX) { - maxX = x; - } - - final int y = tail.getMultiY(); - if (y < minY) { - minY = y; - } else if (y > maxY) { - maxY = y; - } - } - -} // class MultiArchData Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-26 19:00:58 UTC (rev 718) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-11-26 19:20:41 UTC (rev 719) @@ -29,7 +29,6 @@ import cfeditor.CFArchTypeList; import cfeditor.CMapArchPanel; import cfeditor.IGUIConstants; -import cfeditor.MultiArchData; import cfeditor.ScriptArchData; import java.io.BufferedReader; import java.io.IOException; @@ -37,6 +36,7 @@ import java.util.Collections; import java.util.List; import javax.swing.JList; +import net.sf.gridarta.gameobject.MultiArchData; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Deleted: trunk/daimonin/src/daieditor/MultiArchData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 19:00:58 UTC (rev 718) +++ trunk/daimonin/src/daieditor/MultiArchData.java 2006-11-26 19:20:41 UTC (rev 719) @@ -1,217 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 Andreas Kirschbaum - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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; - -import java.util.ArrayList; -import net.sf.gridarta.gameobject.GameObject; - -/** - * Class related to {@link GameObject} to store multipart information. This - * data is only used for multi-part objects. When the editor is running, - * usually a big number of <code>GameObject</code>s exist - most of them - * single-part objects. The encapsulation of this "multi-part-only" data can - * save a little bit of memory. - * - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author Andreas Kirschbaum - */ -public final class MultiArchData<G extends GameObject> { - - /** - * Maximum coordinate of any part; it is never negative. - */ - private int maxX = 0; - - /** - * Maximum coordinate of any part; it is never negative. - */ - private int maxY = 0; - - /** - * Minimum coordinate of any part; it is never positive. - */ - private int minX = 0; - - /** - * Minimum coordinate of any part; it is never positive. - */ - private int minY = 0; - - /** - * The shape ID of this object. - */ - private int multiShapeID; - - /** - * All parts belonging to this multi-part object; the first element is the - * head part. - */ - private final ArrayList<G> parts = new ArrayList<G>(); - - /** - * Create a new instance. - * - * @param head the head part of the multi-part object - */ - public MultiArchData(final G head) { - assert head.getMultiX() == 0 && head.getMultiY() == 0; - parts.add(head); - } - - /** - * Return the number of parts this multi-part objects contains. - */ - public int getMultiRefCount() { - return parts.size(); - } - - /** - * Determine the horizontal extent in tiles. For single-part objects 1 is - * returned. - * - * @return the horizontal extent - */ - public int getSizeX() { - return maxX - minX + 1; - } - - /** - * Determine the vertical extent in tiles. For single-part objects 1 is - * returned. - * - * @return the vertical extent - */ - public int getSizeY() { - return maxY - minY + 1; - } - - /** - * Determine the maximum x-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the maximum x-coordinate - */ - public int getMaxX() { - return maxX; - } - - /** - * Determine the maximum y-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the maximum y-coordinate - */ - public int getMaxY() { - return maxY; - } - - /** - * Determine the minimum x-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the minimum x-coordinate - */ - public int getMinX() { - return minX; - } - - /** - * Determine the minimum y-coordinate of any part. The value is relative to - * the head part. For single-part objects 0 is returned. - * - * @return the minimum y-coordinate - */ - public int getMinY() { - return minY; - } - - /** - * Return the shape ID of this object. - * - * @return the shape ID of this object - */ - public int getMultiShapeID() { - return multiShapeID; - } - - /** - * Set the shape ID of this object. - * - * @param multiShapeID the new shape ID of this object - */ - public void setMultiShapeID(final int multiShapeID) { - this.multiShapeID = multiShapeID; - } - - /** - * Return the head part of this multi-part object. - * - * @return the head part - */ - public G getHead() { - return parts.get(0); - } - - /** - * Return the part following a given part. - * - * @param the current part - * - * @return the part following the current part - */ - public G getNext(final G ob) { - assert ob != null; - final int index = parts.indexOf(ob); - assert index != -1; - return index + 1 < parts.size() ? parts.get(index + 1) : null; - } - - /** - * Add a part to this multi-part object. - * - * @param tail the tail part to add - */ - public void addPart(final G tail) { - assert tail != null; - - parts.add(tail); - - final int x = tail.getMultiX(); - if (x < minX) { - minX = x; - } else if (x > maxX) { - maxX = x; - } - - final int y = tail.getMultiY(); - if (y < minY) { - minY = y; - } else if (y > maxY) { - maxY = y; - } - } - -} // class MultiArchData Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 19:00:58 UTC (rev 718) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 19:20:41 UTC (rev 719) @@ -30,7 +30,6 @@ import daieditor.CMainControl; import daieditor.CMapArchPanel; import daieditor.IGUIConstants; -import daieditor.MultiArchData; import daieditor.ScriptArchData; import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.anim.AnimationObjects; @@ -38,6 +37,7 @@ import javax.swing.ImageIcon; import javax.swing.JList; import net.sf.gridarta.gameobject.GameObjectContainer; +import net.sf.gridarta.gameobject.MultiArchData; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Added: trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.java 2006-11-26 19:20:41 UTC (rev 719) @@ -0,0 +1,215 @@ +/* + * Gridarta Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 Andreas Kirschbaum + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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; + +import java.util.ArrayList; + +/** + * Class related to {@link GameObject} to store multipart information. This + * data is only used for multi-part objects. When the editor is running, + * usually a big number of <code>GameObject</code>s exist - most of them + * single-part objects. The encapsulation of this "multi-part-only" data can + * save a little bit of memory. + * + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author Andreas Kirschbaum + */ +public final class MultiArchData<G extends GameObject> { + + /** + * Maximum coordinate of any part; it is never negative. + */ + private int maxX = 0; + + /** + * Maximum coordinate of any part; it is never negative. + */ + private int maxY = 0; + + /** + * Minimum coordinate of any part; it is never positive. + */ + private int minX = 0; + + /** + * Minimum coordinate of any part; it is never positive. + */ + private int minY = 0; + + /** + * The shape ID of this object. + */ + private int multiShapeID; + + /** + * All parts belonging to this multi-part object; the first element is the + * head part. + */ + private final ArrayList<G> parts = new ArrayList<G>(); + + /** + * Create a new instance. + * + * @param head the head part of the multi-part object + */ + public MultiArchData(final G head) { + assert head.getMultiX() == 0 && head.getMultiY() == 0; + parts.add(head); + } + + /** + * Return the number of parts this multi-part objects contains. + */ + public int getMultiRefCount() { + return parts.size(); + } + + /** + * Determine the horizontal extent in tiles. For single-part objects 1 is + * returned. + * + * @return the horizontal extent + */ + public int getSizeX() { + return maxX - minX + 1; + } + + /** + * Determine the vertical extent in tiles. For single-part objects 1 is + * returned. + * + * @return the vertical extent + */ + public int getSizeY() { + return maxY - minY + 1; + } + + /** + * Determine the maximum x-coordinate of any part. The value is relative to + * the head part. For single-part objects 0 is returned. + * + * @return the maximum x-coordinate + */ + public int getMaxX() { + return maxX; + } + + /** + * Determine the maximum y-coordinate of any part. The value is relative to + * the head part. For single-part objects 0 is returned. + * + * @return the maximum y-coordinate + */ + public int getMaxY() { + return maxY; + } + + /** + * Determine the minimum x-coordinate of any part. The value is relative to + * the head part. For single-part objects 0 is returned. + * + * @return the minimum x-coordinate + */ + public int getMinX() { + return minX; + } + + /** + * Determine the minimum y-coordinate of any part. The value is relative to + * the head part. For single-part objects 0 is returned. + * + * @return the minimum y-coordinate + */ + public int getMinY() { + return minY; + } + + /** + * Return the shape ID of this object. + * + * @return the shape ID of this object + */ + public int getMultiShapeID() { + return multiShapeID; + } + + /** + * Set the shape ID of this object. + * + * @param multiShapeID the new shape ID of this object + */ + public void setMultiShapeID(final int multiShapeID) { + this.multiShapeID = multiShapeID; + } + + /** + * Return the head part of this multi-part object. + * + * @return the head part + */ + public G getHead() { + return parts.get(0); + } + + /** + * Return the part following a given part. + * + * @param the current part + * + * @return the part following the current part + */ + public G getNext(final G ob) { + assert ob != null; + final int index = parts.indexOf(ob); + assert index != -1; + return index + 1 < parts.size() ? parts.get(index + 1) : null; + } + + /** + * Add a part to this multi-part object. + * + * @param tail the tail part to add + */ + public void addPart(final G tail) { + assert tail != null; + + parts.add(tail); + + final int x = tail.getMultiX(); + if (x < minX) { + minX = x; + } else if (x > maxX) { + maxX = x; + } + + final int y = tail.getMultiY(); + if (y < minY) { + minY = y; + } else if (y > maxY) { + maxY = y; + } + } + +} // class MultiArchData Property changes on: trunk/src/app/net/sf/gridarta/gameobject/MultiArchData.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: <aki...@us...> - 2006-11-26 19:38:59
|
Revision: 721 http://svn.sourceforge.net/gridarta/?rev=721&view=rev Author: akirschbaum Date: 2006-11-26 11:38:59 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 19:33:16 UTC (rev 720) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 19:38:59 UTC (rev 721) @@ -53,18 +53,24 @@ /** Flag that indicates if the level has been changed since last save. */ private boolean levelChanged = false; - /** CMainControl. */ + /** + * The CMainControl used for various operations. + * @deprecated it's not a good idea to require the MapModel implementation to know such a heavy-weight strongly UI-related glue class like {@link CMainControl}. + */ private final CMainControl mainControl; - /** The MapControl that controls this MapModel. */ + /** + * The MapControl that controls this MapModel. + * @deprecated it's not a good idea to require the MapModel implementation to know such a heavy-weight strongly UI-related glue class like {@link MapControl}. + * @todo care about Serialization if this field remains + */ private final MapControl mapControl; /** * Constructs a level model. * @param mainControl main controller * @param mapControl the controller of this view - * @param objects the <code>GameObject</code> list of this map or - * <code>null</code> for an empty map + * @param objects the <code>GameObject</code> list of this map or <code>null</code> for an empty map * @param mapArch the map header (<code>MapArchObject</code>) */ public DefaultMapModel(final CMainControl mainControl, final MapControl mapControl, final List<GameObject> objects, final MapArchObject mapArch) { @@ -746,7 +752,7 @@ /** * Get a default {@link GameObject} instance. * - * @param archName arch naem + * @param archName the archetype name * * @return the default arch object instance corresponding to * <code>archName</code>, or <code>null</code> if it does not exist Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 19:33:16 UTC (rev 720) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 19:38:59 UTC (rev 721) @@ -294,7 +294,7 @@ } /** - * Get an Archetype. + * Get a default {@link GameObject} instance. * * @param archName the archetype name * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-26 19:53:35
|
Revision: 722 http://svn.sourceforge.net/gridarta/?rev=722&view=rev Author: christianhujer Date: 2006-11-26 11:53:35 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Improved comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 19:38:59 UTC (rev 721) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 19:53:35 UTC (rev 722) @@ -750,14 +750,14 @@ */ /** - * Get a default {@link GameObject} instance. + * Get an Archetype. * * @param archName the archetype name * - * @return the default arch object instance corresponding to + * @return the Archetype corresponding to * <code>archName</code>, or <code>null</code> if it does not exist */ - private GameObject getArchetype(final String archName) { + @Nullable private GameObject getArchetype(final String archName) { return mainControl.getArchetypeSet().getArchetype(archName); } Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 19:38:59 UTC (rev 721) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 19:53:35 UTC (rev 722) @@ -294,14 +294,14 @@ } /** - * Get a default {@link GameObject} instance. + * Get an Archetype. * * @param archName the archetype name * - * @return the default arch object instance corresponding to + * @return the Archetype corresponding to * <code>archName</code>, or <code>null</code> if it does not exist */ - private GameObject getArchetype(final String archName) { + @Nullable private GameObject getArchetype(final String archName) { return mainControl.getArchetypeSet().getArchetype(archName); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-28 21:35:35
|
Revision: 740 http://svn.sourceforge.net/gridarta/?rev=740&view=rev Author: akirschbaum Date: 2006-11-28 13:35:33 -0800 (Tue, 28 Nov 2006) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CNewMapDialog.java Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-28 20:41:37 UTC (rev 739) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-28 21:35:33 UTC (rev 740) @@ -165,8 +165,7 @@ gbcField.insets = new Insets(2, 2, 2, 2); gbcLabel.anchor = GridBagConstraints.EAST; gbcField.gridwidth = GridBagConstraints.REMAINDER; - mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == TYPE_PICKMAP ? "Pickmap Size" : "Map Size"), - IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n + mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == TYPE_PICKMAP ? "Pickmap Size" : "Map Size"), IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth")), gbcLabel); if (mapType == TYPE_PICKMAP) { mapWidthField.setValue(IGUIConstants.DEF_PICKMAP_WIDTH); @@ -215,34 +214,34 @@ // Get and validate the width final int width; final int height; - try { - width = (Integer) mapWidthField.getValue(); - } catch (final IllegalArgumentException e) { - final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; - ACTION_FACTORY.showMessageDialog(this, key); - mapWidthField.requestFocus(); - return false; - } - if (width < 1) { - ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); - mapWidthField.requestFocus(); - return false; - } + try { + width = (Integer) mapWidthField.getValue(); + } catch (final IllegalArgumentException e) { + final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; + ACTION_FACTORY.showMessageDialog(this, key); + mapWidthField.requestFocus(); + return false; + } + if (width < 1) { + ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); + mapWidthField.requestFocus(); + return false; + } - // Get and validate the height - try { - height = (Integer) mapHeightField.getValue(); - } catch (final IllegalArgumentException e) { - final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; - ACTION_FACTORY.showMessageDialog(this, key); - mapHeightField.requestFocus(); - return false; - } - if (height < 1) { - ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); - mapHeightField.requestFocus(); - return false; - } + // Get and validate the height + try { + height = (Integer) mapHeightField.getValue(); + } catch (final IllegalArgumentException e) { + final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; + ACTION_FACTORY.showMessageDialog(this, key); + mapHeightField.requestFocus(); + return false; + } + if (height < 1) { + ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); + mapHeightField.requestFocus(); + return false; + } maparch.setMapSize(new Size2D(width, height)); @@ -255,9 +254,7 @@ // arches must be loaded to create a new map if (mainControl.getArchetypeSet().getLoadStatus() != ArchetypeSet.LoadStatus.COMPLETE) { - mainControl.showMessage("Cannot Create Map", - "All arches have to be loaded before you can open a map.\n" + - "Just be patient and wait a few seconds..."); + mainControl.showMessage("Cannot Create Map", "All arches have to be loaded before you can open a map.\nJust be patient and wait a few seconds..."); return false; } Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-28 20:41:37 UTC (rev 739) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-28 21:35:33 UTC (rev 740) @@ -190,8 +190,7 @@ gbcField.insets = new Insets(2, 2, 2, 2); gbcLabel.anchor = GridBagConstraints.EAST; gbcField.gridwidth = GridBagConstraints.REMAINDER; - mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == MapType.PICKMAP ? "Pickmap Size" : "Map Size"), - IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n + mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == MapType.PICKMAP ? "Pickmap Size" : "Map Size"), IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth")), gbcLabel); if (mapType == MapType.PICKMAP) { mapWidthField.setValue(IGUIConstants.DEF_PICKMAP_WIDTH); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-28 21:40:29
|
Revision: 741 http://svn.sourceforge.net/gridarta/?rev=741&view=rev Author: akirschbaum Date: 2006-11-28 13:40:27 -0800 (Tue, 28 Nov 2006) Log Message: ----------- Add German translation for new map dialog. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-28 21:40:27 UTC (rev 741) @@ -133,9 +133,9 @@ // file name panel final JPanel fileNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); if (mapType == TYPE_PICKMAP) { - fileNamePanel.add(new JLabel("Pickmap Name:")); // TODO cher: i18n/l10n + fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapPickmapName"))); } else { - fileNamePanel.add(new JLabel("File Name:")); // TODO cher: i18n/l10n + fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapFileName"))); } if (filename != null && filename.length() > 0) { fileNameField.setText(filename); @@ -149,7 +149,7 @@ if (mapType == TYPE_CFMAP) { // map name panel final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - mapNamePanel.add(new JLabel("Map Name:")); // TODO cher: i18n/l10n + mapNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapMapName"))); mapNamePanel.add(mapNameField); newLevelFromScratchPanel.add(mapNamePanel); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); @@ -165,7 +165,7 @@ gbcField.insets = new Insets(2, 2, 2, 2); gbcLabel.anchor = GridBagConstraints.EAST; gbcField.gridwidth = GridBagConstraints.REMAINDER; - mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == TYPE_PICKMAP ? "Pickmap Size" : "Map Size"), IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n + mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), ACTION_FACTORY.getString("newMapParameters")), IGUIConstants.DIALOG_BORDER)); mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth")), gbcLabel); if (mapType == TYPE_PICKMAP) { mapWidthField.setValue(IGUIConstants.DEF_PICKMAP_WIDTH); Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-11-28 21:40:27 UTC (rev 741) @@ -4,6 +4,10 @@ # New Map newMap.title=Create New Map newPickmap.title=Create New Pickmap +newMapFileName=File name: +newMapMapName=Map name: +newMapParameter=Parameters +newMapPickmapName=Pickmap name: newMapDimensionOutOfRange.title=Illegal Value newMapDimensionOutOfRange.message=Map dimensions must be greater or equal 1 and less or equal 2147483647 newMapDimensionNotANumber.title=Illegal Value Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-11-28 21:40:27 UTC (rev 741) @@ -1,6 +1,20 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +# New Map +newMap.title=Neue Karte erstellen +newPickmap.title=Neue Pickmap erstellen +newMapFileName=Dateiname: +newMapMapName=Name: +newMapParameter=Parameter +newMapPickmapName=Name: +newMapDimensionOutOfRange.title=Ung\xFCltiger Wert +newMapDimensionOutOfRange.message=Die Kartengr\xF6\xDFe muss positiv sein +newMapDimensionNotANumber.title=Ung\xFCltiger Wert +newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. +newMapNoName.title=Kartenname fehlt +newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. + mapWidth=Breite mapHeight=H\xF6he mapOkay.text=Ok Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-28 21:40:27 UTC (rev 741) @@ -158,9 +158,9 @@ // file name panel final JPanel fileNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); if (mapType == MapType.PICKMAP) { - fileNamePanel.add(new JLabel("Pickmap Name:")); // TODO cher: i18n/l10n + fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapPickmapName"))); } else { - fileNamePanel.add(new JLabel("File Name:")); // TODO cher: i18n/l10n + fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapFileName"))); } if (filename != null && filename.length() > 0) { fileNameField.setText(filename); @@ -174,7 +174,7 @@ if (mapType == MapType.GAMEMAP) { // map name panel final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - mapNamePanel.add(new JLabel("Map Name:")); // TODO cher: i18n/l10n + mapNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapMapName"))); mapNamePanel.add(mapNameField); newLevelFromScratchPanel.add(mapNamePanel); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); @@ -190,7 +190,7 @@ gbcField.insets = new Insets(2, 2, 2, 2); gbcLabel.anchor = GridBagConstraints.EAST; gbcField.gridwidth = GridBagConstraints.REMAINDER; - mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), mapType == MapType.PICKMAP ? "Pickmap Size" : "Map Size"), IGUIConstants.DIALOG_BORDER)); // TODO cher: i18n/l10n + mapSizePanel.setBorder(new CompoundBorder(new TitledBorder(new EtchedBorder(), ACTION_FACTORY.getString("newMapParameters")), IGUIConstants.DIALOG_BORDER)); mapSizePanel.add(new JLabel(ACTION_FACTORY.getString("mapWidth")), gbcLabel); if (mapType == MapType.PICKMAP) { mapWidthField.setValue(IGUIConstants.DEF_PICKMAP_WIDTH); Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/daimonin/src/daieditor/messages.properties 2006-11-28 21:40:27 UTC (rev 741) @@ -138,6 +138,10 @@ # New Map newMap.title=Create New Map newPickmap.title=Create New Pickmap +newMapFileName=File name: +newMapMapName=Map name: +newMapParameter=Parameters +newMapPickmapName=Pickmap name: newMapDimensionOutOfRange.title=Illegal Value newMapDimensionOutOfRange.message=Map dimensions must be greater or equal 1 and less or equal 2147483647 newMapDimensionNotANumber.title=Illegal Value Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-11-28 21:35:33 UTC (rev 740) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-11-28 21:40:27 UTC (rev 741) @@ -33,6 +33,20 @@ overwriteOtherFile.title=Datei \xFCberschreiben? overwriteOtherFile=Eine Datei mit Namen "{0}" existiert bereits.\n\nWirklich \xFCberschreiben? +# New Map +newMap.title=Neue Karte erstellen +newPickmap.title=Neue Pickmap erstellen +newMapFileName=Dateiname: +newMapMapName=Name: +newMapParameter=Parameter +newMapPickmapName=Name: +newMapDimensionOutOfRange.title=Ung\xFCltiger Wert +newMapDimensionOutOfRange.message=Die Kartengr\xF6\xDFe muss positiv sein +newMapDimensionNotANumber.title=Ung\xFCltiger Wert +newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. +newMapNoName.title=Kartenname fehlt +newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. + mapTitle={0} ({1}) - Karteneigenschaften mapMap=Karte mapName=Name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-29 18:55:53
|
Revision: 745 http://svn.sourceforge.net/gridarta/?rev=745&view=rev Author: akirschbaum Date: 2006-11-29 10:55:53 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Add javadoc comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CPickmapPanel.java Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 18:52:27 UTC (rev 744) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 18:55:53 UTC (rev 745) @@ -177,6 +177,8 @@ /** * Create a new pickmap and display it. * @param maparch MapArchObject containing map name and -size + * @return <code>true</code> if the pickmap was added, <code>false</code> + * if an error has occurred */ public boolean addNewPickmap(final MapArchObject maparch) { Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 18:52:27 UTC (rev 744) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 18:55:53 UTC (rev 745) @@ -172,6 +172,8 @@ /** * Create a new pickmap and display it. * @param maparch MapArchObject containing map name and -size + * @return <code>true</code> if the pickmap was added, <code>false</code> + * if an error has occurred */ public boolean addNewPickmap(final MapArchObject maparch) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-29 19:02:42
|
Revision: 746 http://svn.sourceforge.net/gridarta/?rev=746&view=rev Author: akirschbaum Date: 2006-11-29 11:02:36 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Properly center error message in create new pickmap dialog. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPickmapPanel.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-11-29 18:55:53 UTC (rev 745) +++ trunk/crossfire/ChangeLog 2006-11-29 19:02:36 UTC (rev 746) @@ -1,3 +1,7 @@ +2006-11-29 Andreas Kirschbaum + + * Properly center error message in create new pickmap dialog. + 2006-11-24 Andreas Kirschbaum * Do not crash in cut or delete when the region contains Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-29 18:55:53 UTC (rev 745) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-29 19:02:36 UTC (rev 746) @@ -192,7 +192,7 @@ /** Action method for okay. */ public void mapOkay() { - if (createNewLevel()) { + if (createNewLevel(this)) { setValue(okButton); } } @@ -204,9 +204,10 @@ /** * Checks the given values and creates a new level. + * @param parent the parent component to be used for error messages * @return True if the level was created, false if the parameters were wrong. */ - private boolean createNewLevel() { + private boolean createNewLevel(final Component parent) { // Create a new level from scratch final MapArchObject maparch = new MapArchObject(); @@ -287,7 +288,7 @@ if (mapType == TYPE_CFMAP) { mainControl.newLevel(null, maparch, null); } else if (mapType == TYPE_PICKMAP) { - return CPickmapPanel.getInstance().addNewPickmap(maparch); + return CPickmapPanel.getInstance().addNewPickmap(parent, maparch); } return true; Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 18:55:53 UTC (rev 745) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 19:02:36 UTC (rev 746) @@ -28,6 +28,7 @@ import cfeditor.io.CMapReader; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; +import java.awt.Component; import java.io.File; import java.io.IOException; import java.util.Arrays; @@ -176,15 +177,16 @@ /** * Create a new pickmap and display it. + * @param parent the parent component to be used for error messages * @param maparch MapArchObject containing map name and -size * @return <code>true</code> if the pickmap was added, <code>false</code> * if an error has occurred */ - public boolean addNewPickmap(final MapArchObject maparch) { + public boolean addNewPickmap(final Component parent, final MapArchObject maparch) { final File mapFile = new File(IGUIConstants.PICKMAP_DIR, maparch.getFileName()); if (mapFile.exists()) { - ACTION_FACTORY.showMessageDialog(tabpane, "pickmapExists", mapFile); + ACTION_FACTORY.showMessageDialog(parent, "pickmapExists", mapFile); return false; } if (!mapFile.getParentFile().exists()) { Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-29 18:55:53 UTC (rev 745) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-29 19:02:36 UTC (rev 746) @@ -222,7 +222,7 @@ /** Action method for okay. */ public void mapOkay() { - if (createNewLevel()) { + if (createNewLevel(this)) { setValue(okButton); } } @@ -234,9 +234,10 @@ /** * Checks the given values and creates a new level. + * @param parent the parent component to be used for error messages * @return True if the level was created, false if the parameters were wrong. */ - private boolean createNewLevel() { + private boolean createNewLevel(final Component parent) { // Create a new level from scratch final MapArchObject maparch = new MapArchObject(); @@ -324,7 +325,7 @@ if (mapType == MapType.GAMEMAP) { mainControl.newLevel(null, maparch, true); } else if (mapType == MapType.PICKMAP) { - return CPickmapPanel.getInstance().addNewPickmap(maparch); + return CPickmapPanel.getInstance().addNewPickmap(parent, maparch); } return true; Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 18:55:53 UTC (rev 745) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 19:02:36 UTC (rev 746) @@ -28,6 +28,7 @@ import daieditor.io.CMapReader; import daieditor.map.MapArchObject; import daieditor.map.MapControl; +import java.awt.Component; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -171,15 +172,16 @@ /** * Create a new pickmap and display it. + * @param parent the parent component to be used for error messages * @param maparch MapArchObject containing map name and -size * @return <code>true</code> if the pickmap was added, <code>false</code> * if an error has occurred */ - public boolean addNewPickmap(final MapArchObject maparch) { + public boolean addNewPickmap(final Component parent, final MapArchObject maparch) { final File mapFile = new File(new File(CMainControl.getInstance().getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), maparch.getFileName()); if (mapFile.exists()) { - ACTION_FACTORY.showMessageDialog(tabpane, "pickmapExists", mapFile); + ACTION_FACTORY.showMessageDialog(parent, "pickmapExists", mapFile); return false; } if (!mapFile.getParentFile().exists()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-29 19:11:35
|
Revision: 748 http://svn.sourceforge.net/gridarta/?rev=748&view=rev Author: akirschbaum Date: 2006-11-29 11:11:35 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CPickmapPanel.java Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 19:05:26 UTC (rev 747) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-29 19:11:35 UTC (rev 748) @@ -215,17 +215,17 @@ * @return basic mapview */ @Nullable private CMapViewBasic newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile) { - final MapControl map = new MapControl(mainControl, objects, maparch, true, null); - map.getMapViewFrame().setAutoscrolls(true); - map.setMapFile(mapFile); + final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, null); + mapControl.getMapViewFrame().setAutoscrolls(true); + mapControl.setMapFile(mapFile); // add pickmap to hashtable - pickmaps.put(mapFile.getName(), map); + pickmaps.put(mapFile.getName(), mapControl); - currentPickMap = map; - map.getMapModel().resetLevelChangedFlag(); + currentPickMap = mapControl; + mapControl.getMapModel().resetLevelChangedFlag(); - return map.getMapViewFrame().getBasicView(); + return mapControl.getMapViewFrame().getBasicView(); } /** Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 19:05:26 UTC (rev 747) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-29 19:11:35 UTC (rev 748) @@ -207,30 +207,30 @@ * @return basic mapview */ private CMapViewBasic newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile, final int index) { - final MapControl map = new MapControl(mainControl, objects, maparch, true, true); - map.getMapViewFrame().setAutoscrolls(true); - map.setMapFile(mapFile); + final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, true); + mapControl.getMapViewFrame().setAutoscrolls(true); + mapControl.setMapFile(mapFile); // add pickmap to vector if (index < 0 || index >= pickmaps.size()) { - pickmaps.add(map); + pickmaps.add(mapControl); } else { - pickmaps.add(index, map); + pickmaps.add(index, mapControl); } - currentPickMap = map; - return map.getMapViewFrame().getBasicView(); + currentPickMap = mapControl; + return mapControl.getMapViewFrame().getBasicView(); } /** * Close a pickmap: Remove it from the panel and the data vector. - * @param map MapControl of the pickmap to remove + * @param mapControl MapControl of the pickmap to remove * @return true when closing successful */ - public boolean closePickmap(final MapControl map) { + public boolean closePickmap(final MapControl mapControl) { boolean mapClosed = false; for (int i = 0; !mapClosed && i < pickmaps.size(); i++) { final MapControl tmpMap = pickmaps.get(i); - if (tmpMap == map) { + if (tmpMap == mapControl) { pickmaps.remove(i); tabpane.remove(i); mapClosed = true; @@ -246,12 +246,12 @@ /** * Get tab index of a pickmap in the JTabbedPane. - * @param map control + * @param mapControl control * @return tab index of pickmap, or -1 if it doesn't exist */ - public int getPickmapTabIndex(final MapControl map) { + public int getPickmapTabIndex(final MapControl mapControl) { for (int i = 0; i < pickmaps.size(); i++) { - if (pickmaps.get(i) == map) { + if (pickmaps.get(i) == mapControl) { return i; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-29 21:04:19
|
Revision: 756 http://svn.sourceforge.net/gridarta/?rev=756&view=rev Author: christianhujer Date: 2006-11-29 13:04:12 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Added unified message properties for default Locale. ActionFactories are set with parent factory for that. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/messages.properties trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/messages.properties trunk/src/app/net/sf/gridarta/action.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-11-29 19:40:40 UTC (rev 755) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-11-29 21:04:12 UTC (rev 756) @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; +import net.sf.japi.swing.ActionFactory; /** * Main class, launches the level editor application. @@ -51,6 +52,8 @@ * @param args The command line parameters given to the level editor. */ public static void main(final String[] args) { + final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + actionFactory.addParent(ActionFactory.getFactory("net.sf.gridarta")); final List<String> infiles = new ArrayList<String>(); // map file names to open initially String outfile = null; // if specified in the parameters, create image of map and exit String inlist = null; Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-11-29 19:40:40 UTC (rev 755) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-11-29 21:04:12 UTC (rev 756) @@ -2,59 +2,5 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding # Dialogs -pickmapExists.title=Cannot Create Pickmap -pickmapExists.message=A pickmap named {0} already exists.\nEither remove the existing one or choose a different name. -# New Map -newMap.title=Create New Map -newPickmap.title=Create New Pickmap -newMapFileName=File name: -newMapMapName=Map name: -newMapParameter=Parameters -newMapPickmapName=Pickmap name: -newMapDimensionOutOfRange.title=Illegal Value -newMapDimensionOutOfRange.message=Map dimensions must be greater or equal 1 and less or equal 2147483647 -newMapDimensionNotANumber.title=Illegal Value -newMapDimensionNotANumber.message=Map dimensions must be numerical integer values! -newMapNoName.title=Map Name is missing -newMapNoName.message=You must enter a map name! This name will appear\nin the game, so it should be a descriptive name.\nMap names do not need to be unique. -mapWidth=Width -mapHeight=Height -mapOkay.text=Ok -mapCancel.text=Cancel - -#replace -replaceTitle=Replace -replaceOn=On -replaceOnMap=entire map -replaceOnSelection=selected squares of -replaceDelete=delete objects with -replaceBy=and replace by -replaceByObject=object -replaceByNothing=nothing - -replaceMapGone.title=Error with Replace -replaceMapGone.message=Map {0} is no longer available.\n -replaceMapNoSelection.title=No selection -replaceMapNoSelection.message=You chose to replace on selected squares of\nmap "{0}", but there is no selected area. -replacedZero.title=Replace failed -replacedZero.message=No matching object found. -replacedOne.title=Replace successful -replacedOne.message=1 Object has been replaced. -replacedMany.title=Replace successful -replacedMany.message={0} Objects have been replaced. - -replaceOk.text=OK -replaceCancel.text=Cancel - -#attribute dialog -attribTitle=Object Attributes -attribHelp.text=Help -attribSummary.text=Summary -attribEdit.text=Edit -attribOk.text=Ok -attribApply.text=Apply -attribCancel.text=Cancel - -fileDialog.filter.python=Python Scripts Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-29 19:40:40 UTC (rev 755) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-29 21:04:12 UTC (rev 756) @@ -67,7 +67,9 @@ Locale.setDefault(new Locale(locName)); } // Now add prefs to the ActionFactory. - ActionFactory.getFactory("daieditor").addPref(CMainControl.class); + final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + actionFactory.addPref(CMainControl.class); + actionFactory.addParent(ActionFactory.getFactory("net.sf.gridarta")); final SplashScreen splashScreen = new SplashScreen(); splashScreen.show(); final List<String> infiles = new ArrayList<String>(); // map file names to open initially Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-11-29 19:40:40 UTC (rev 755) +++ trunk/daimonin/src/daieditor/messages.properties 2006-11-29 21:04:12 UTC (rev 756) @@ -1,4 +1,4 @@ -#mapDifficultyField.getValue()); Warning: This file MUST be ISO-8859-1 +# Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding mainWindow.title=Gridarta for Daimonin {0} @@ -51,8 +51,6 @@ overwriteOtherFile.title=Overwrite file? overwriteOtherFile.message=A file named "{0}" already exists.\n\nReally overwrite it? -pickmapExists.title=Cannot Create Pickmap -pickmapExists.message=A pickmap named {0} already exists.\nEither remove the existing one or choose a different name. mapOutOfMemory.title=Out Of Memory mapOutOfMemory.message=<html>Not enough memory available to open this map!<br>You can increase the memory limit by using the <code>-Xmx</code> runtime flag.<br>For example: <code>java -Xmx128m -jar DaimoninEditor.jar</code></html> @@ -135,19 +133,6 @@ createNewEventException.message=Can''t create script path from map. Perhaps you should save your map first. openScriptNotFound.title=Script file not found openScriptNotFound.message=The file ''{0}'' does not exist.\nPlease correct the path. -# New Map -newMap.title=Create New Map -newPickmap.title=Create New Pickmap -newMapFileName=File name: -newMapMapName=Map name: -newMapParameter=Parameters -newMapPickmapName=Pickmap name: -newMapDimensionOutOfRange.title=Illegal Value -newMapDimensionOutOfRange.message=Map dimensions must be greater or equal 1 and less or equal 2147483647 -newMapDimensionNotANumber.title=Illegal Value -newMapDimensionNotANumber.message=Map dimensions must be numerical integer values! -newMapNoName.title=Map Name is missing -newMapNoName.message=You must enter a map name! This name will appear\nin the game, so it should be a descriptive name.\nMap names do not need to be unique. newMapDifficultyNotANumber.title=Illegal Value newMapDifficultyNotANumber.message=Map difficulty must be a numerical integer value. newMapDifficultyOutOfRange.title=Illegal Value @@ -183,8 +168,6 @@ mapMap=Map mapName=Name mapSound=Background sound -mapWidth=Width -mapHeight=Height mapOutdoor=Outdoor mapFixedReset=Fixed Reset mapOptions=Options @@ -222,9 +205,7 @@ mapShrink.title=Confirm shrinking map mapShrink.message=You selected a new map size of {0,number,integer} \xD7 {1,number,integer}. If the map was\nresized in this way, some objects would get cut off and deleted.\nAre you really sure you want this? mapHelp.text=Help -mapOkay.text=Ok mapRestore.text=Restore -mapCancel.text=Cancel mapSizeDefault.text=default map size (24 \xD7 24) mapErrorUnsaved.title=Missing File Path mapErrorUnsaved.message=Can''t attach unsaved map.\nMap must be saved to the map folder first! @@ -259,33 +240,10 @@ mapTileChoose.shortdescription=Choose path to tile map mapTilePathMode.shortdescription=Switch between relative and absolute path -#replace -replaceTitle=Replace -replaceOn=On -replaceOnMap=entire map -replaceOnSelection=selected squares of -replaceDelete=delete objects with -replaceBy=and replace by -replaceByObject=object replaceByCopyBuffer=clipboard replaceByPickmap=pickmap -replaceByNothing=nothing -replaceMapGone.title=Error with Replace -replaceMapGone.message=Map {0} is no longer available.\n -replaceMapNoSelection.title=No selection -replaceMapNoSelection.message=You chose to replace on selected squares of\nmap "{0}", but there is no selected area. -replacedZero.title=Replace failed -replacedZero.message=No matching object found. -replacedOne.title=Replace successful -replacedOne.message=1 Object has been replaced. -replacedMany.title=Replace successful -replacedMany.message={0} Objects have been replaced. -replaceOk.text=OK -replaceCancel.text=Cancel - - arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Functionality of {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> # Options @@ -324,15 +282,6 @@ oldLibsFound.message=Old libraries found.\nLocation: {0}\nThey aren''t used anymore.\nDelete them? oldLibsFound.title=Delete old libraries? -#attribute dialog -attribTitle=Object Attributes -attribHelp.text=Help -attribSummary.text=Summary -attribEdit.text=Edit -attribOk.text=Ok -attribApply.text=Apply -attribCancel.text=Cancel - archCollectArches=Collecting Arches... archCollectAnimations=Collecting Animations... archCollectAnimationTree=Collecting Animation Tree... @@ -368,7 +317,6 @@ file.mnemonic=F fileDialog.title=Open Map Or Script Files fileDialog.filter.maps=Map Files -fileDialog.filter.python=Python Scripts fileDialog.filter.lua=Lua Scripts fileDialog.filter.png=PNG Images fileDialog.filter.arc=Archetype definitions Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2006-11-29 19:40:40 UTC (rev 755) +++ trunk/src/app/net/sf/gridarta/action.properties 2006-11-29 21:04:12 UTC (rev 756) @@ -1,9 +1,4 @@ -namedTreeNodeWithoutPath=No path! Object Path: {0} Object Name: {1} Object Type: {2} -chooseNamedObject.title=Choose a {0} -archCollectArches=Collecting Arches... -archCollectAnimations=Collecting Animations... -archCollectAnimationTree=Collecting Animation Tree... -archCollectImages=Collecting Images... -archCollectDone=Collect Arches: done -nameOfAnimationObject=Animation -nameOfFaceObject=Face +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +ActionFactory.additionalBundles=net.sf.gridarta.messages Added: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties (rev 0) +++ trunk/src/app/net/sf/gridarta/messages.properties 2006-11-29 21:04:12 UTC (rev 756) @@ -0,0 +1,72 @@ +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +namedTreeNodeWithoutPath=No path! Object Path: {0} Object Name: {1} Object Type: {2} +chooseNamedObject.title=Choose a {0} +archCollectArches=Collecting Arches... +archCollectAnimations=Collecting Animations... +archCollectAnimationTree=Collecting Animation Tree... +archCollectImages=Collecting Images... +archCollectDone=Collect Arches: done +nameOfAnimationObject=Animation +nameOfFaceObject=Face + + +# Dialogs +pickmapExists.title=Cannot Create Pickmap +pickmapExists.message=A pickmap named {0} already exists.\nEither remove the existing one or choose a different name. + +# New Map +newMap.title=Create New Map +newPickmap.title=Create New Pickmap +newMapFileName=File name: +newMapMapName=Map name: +newMapParameter=Parameters +newMapPickmapName=Pickmap name: +newMapDimensionOutOfRange.title=Illegal Value +newMapDimensionOutOfRange.message=Map dimensions must be greater or equal 1 and less or equal 2147483647 +newMapDimensionNotANumber.title=Illegal Value +newMapDimensionNotANumber.message=Map dimensions must be numerical integer values! +newMapNoName.title=Map Name is missing +newMapNoName.message=You must enter a map name! This name will appear\nin the game, so it should be a descriptive name.\nMap names do not need to be unique. + +# Other Strings +mapWidth=Width +mapHeight=Height +mapOkay.text=Ok +mapCancel.text=Cancel + +#replace +replaceTitle=Replace +replaceOn=On +replaceOnMap=entire map +replaceOnSelection=selected squares of +replaceDelete=delete objects with +replaceBy=and replace by +replaceByObject=object +replaceByNothing=nothing + +replaceMapGone.title=Error with Replace +replaceMapGone.message=Map {0} is no longer available.\n +replaceMapNoSelection.title=No selection +replaceMapNoSelection.message=You chose to replace on selected squares of\nmap "{0}", but there is no selected area. +replacedZero.title=Replace failed +replacedZero.message=No matching object found. +replacedOne.title=Replace successful +replacedOne.message=1 Object has been replaced. +replacedMany.title=Replace successful +replacedMany.message={0} Objects have been replaced. + +replaceOk.text=OK +replaceCancel.text=Cancel + +#attribute dialog +attribTitle=Object Attributes +attribHelp.text=Help +attribSummary.text=Summary +attribEdit.text=Edit +attribOk.text=Ok +attribApply.text=Apply +attribCancel.text=Cancel + +fileDialog.filter.python=Python Scripts Property changes on: trunk/src/app/net/sf/gridarta/messages.properties ___________________________________________________________________ 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: <aki...@us...> - 2006-11-30 19:51:47
|
Revision: 757 http://svn.sourceforge.net/gridarta/?rev=757&view=rev Author: akirschbaum Date: 2006-11-30 11:51:40 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Improve new map dialog: remove file name field which was never shown; correctly set name and file name for pickmaps; start with empty map name to force the user to enter a name. Modified Paths: -------------- trunk/crossfire/resource/pickmaps/NPC trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/messages_de.properties trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/crossfire/resource/pickmaps/NPC =================================================================== --- trunk/crossfire/resource/pickmaps/NPC 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/crossfire/resource/pickmaps/NPC 2006-11-30 19:51:40 UTC (rev 757) @@ -1,51 +1,51 @@ arch map name pickmap +width 7 +height 15 msg Creator: CF Java Map Editor Date: 8/29/2002 endmsg -width 7 -height 15 end arch guildmaster name cleric face cleric.151 hp 100 maxhp 100 +randomitems throw_stnd pick_up 0 -randomitems throw_stnd end arch guildmaster name mage face mage.151 hp 100 maxhp 100 +y 1 +randomitems standard pick_up 0 -randomitems standard -y 1 end arch guildmaster name sorcerer face sorcerer.151 hp 100 maxhp 100 +y 2 +randomitems standard pick_up 0 -randomitems standard -y 2 end arch fireborn +Con 10 +Cha 10 +hp 100 +maxhp 100 +exp 100 +dam 3 +y 3 +level 10 type 0 -level 10 -exp 100 randomitems standard -dam 3 -hp 100 -maxhp 100 -Con 10 +monster 1 unaggressive 1 -monster 1 -Cha 10 -y 3 end arch a_townsman y 5 @@ -76,40 +76,40 @@ face monk.151 hp 100 maxhp 100 +x 1 +randomitems throw_stnd pick_up 0 -randomitems throw_stnd -x 1 end arch guildmaster name swashbuckler face swashbuckl.171 hp 100 maxhp 100 -pick_up 0 -randomitems pirate x 1 y 1 +randomitems pirate +pick_up 0 end arch guildmaster name summoner face wizard_yellow.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 1 y 2 +randomitems standard +pick_up 0 end arch guildmaster name quetzalcoatl +race reptile face quetzalcoatl.131 hp 100 maxhp 100 -pick_up 0 -randomitems standard -race reptile x 1 y 3 +randomitems standard +pick_up 0 end arch a_townsman2 x 1 @@ -148,40 +148,40 @@ face paladin.151 hp 100 maxhp 100 +x 2 +randomitems throw_stnd pick_up 0 -randomitems throw_stnd -x 2 end arch guildmaster name warlock face mage.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 2 y 1 +randomitems standard +pick_up 0 end arch guildmaster name wizard face wizard.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 2 y 2 +randomitems standard +pick_up 0 end arch guildmaster name dragon hatchling +race dragon face pl_dragon.171 hp 100 maxhp 100 -pick_up 0 -randomitems standard -race dragon x 2 y 3 +randomitems standard +pick_up 0 end arch a_townsman3 x 2 @@ -196,9 +196,9 @@ y 7 end arch sailor -random_movement 0 x 2 y 8 +random_movement 0 end arch dwarf_wiz x 2 @@ -221,39 +221,39 @@ face priestnew.151 hp 100 maxhp 100 +x 3 +randomitems standard pick_up 0 -randomitems standard -x 3 end arch guildmaster name warrior face warrior.151 hp 100 maxhp 100 -pick_up 0 -randomitems throw_stnd x 3 y 1 +randomitems throw_stnd +pick_up 0 end arch guildmaster name human face human.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 3 y 2 +randomitems standard +pick_up 0 end arch guildmaster name viking face viking.151 hp 100 maxhp 100 -pick_up 0 -randomitems viking x 3 y 3 +randomitems viking +pick_up 0 end arch beggar x 3 @@ -292,56 +292,56 @@ face ninja.151 hp 100 maxhp 100 +x 4 +randomitems npc_ninja pick_up 0 -randomitems npc_ninja -x 4 end arch guildmaster name alchemist face alchemist.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 4 y 1 +randomitems standard +pick_up 0 end arch guildmaster name dwarf face dwarf_p.111 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 4 y 2 +randomitems standard +pick_up 0 end arch guildmaster name wraith +race undead face wraithp.151 -race undead -randomitems standard -undead 1 hp 100 maxhp 100 -pick_up 0 x 4 y 3 +randomitems standard +undead 1 +pick_up 0 end arch conjurer x 4 y 5 end arch gnome +x 4 +y 6 type 0 unaggressive 1 -x 4 -y 6 end arch fatman -random_movement 0 x 4 y 7 +random_movement 0 end arch greater_dwarven_guard x 4 @@ -360,44 +360,44 @@ face thief.151 hp 100 maxhp 100 +x 5 +randomitems thief_1 pick_up 0 -randomitems thief_1 -x 5 end arch guildmaster name devotee face wizard_white.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 5 y 1 +randomitems standard +pick_up 0 end arch guildmaster name elf face elf.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 5 y 2 +randomitems standard +pick_up 0 end arch guildmaster name half orc face pl_half_orc.111 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 5 y 3 +randomitems standard +pick_up 0 end arch pirate -unaggressive 1 x 5 y 5 +unaggressive 1 end arch charwoman x 5 @@ -420,34 +420,34 @@ face barbarian.151 hp 100 maxhp 100 +x 6 +randomitems viking pick_up 0 -randomitems viking -x 6 end arch guildmaster name evoker face evoker.151 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 6 y 1 +randomitems standard +pick_up 0 end arch guildmaster name halfling face halfling.111 hp 100 maxhp 100 -pick_up 0 -randomitems standard x 6 y 2 +randomitems standard +pick_up 0 end arch small_troll -unaggressive 1 x 6 y 3 +unaggressive 1 end arch dancing_girl x 6 Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-11-30 19:51:40 UTC (rev 757) @@ -75,6 +75,9 @@ /** type of map to create: pickmap or normal map? */ private final MapType mapType; + /** Desired filename for new map, null if not specified. */ + private final String filename; + /** * Textfield for the name of the map. * This is only used for {@link MapType#GAMEMAP} to determine the title of the new map. @@ -83,13 +86,6 @@ private final JTextField mapNameField = new JTextField(16); /** - * Textfield for the filename of the map. - * This is only used for {@link MapType#PICKMAP} to determine the filename of the new pickmap. - * The title of the pickmap will be set to "pickmap" always. - */ - private final JTextField fileNameField = new JTextField(16); - - /** * Textfield for the width of the new map. */ private final JFormattedTextField mapWidthField = new JFormattedTextField(); @@ -117,38 +113,22 @@ this.mainControl = mainControl; this.mapType = mapType; - setMessage(createPanel(filename)); + this.filename = filename; + setMessage(createPanel()); } - private JPanel createPanel(final String filename) { + private JPanel createPanel() { final JPanel newLevelFromScratchPanel = new JPanel(); newLevelFromScratchPanel.setLayout(new BoxLayout(newLevelFromScratchPanel, BoxLayout.Y_AXIS)); newLevelFromScratchPanel.setBorder(IGUIConstants.DIALOG_BORDER); - // file name panel - final JPanel fileNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - if (mapType == MapType.PICKMAP) { - fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapPickmapName"))); - } else { - fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapFileName"))); - } - if (filename != null && filename.length() > 0) { - fileNameField.setText(filename); - } - fileNamePanel.add(fileNameField); - if (mapType == MapType.PICKMAP) { - newLevelFromScratchPanel.add(fileNamePanel); - newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); - } - if (mapType == MapType.GAMEMAP) { - // map name panel - final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - mapNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapMapName"))); - mapNamePanel.add(mapNameField); - newLevelFromScratchPanel.add(mapNamePanel); - newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); - } + // map name panel + final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + mapNamePanel.add(new JLabel(ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newMapPickmapName" : "newMapMapName"))); + mapNamePanel.add(mapNameField); + newLevelFromScratchPanel.add(mapNamePanel); + newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); @@ -241,10 +221,10 @@ maparch.setMapSize(new Size2D(width, height)); - // the mapmaker must enter a mapname to create a new map + // the mapmaker must enter a name -- both for maps and pickmaps final String mapName = mapNameField.getText(); - if (mapType == MapType.GAMEMAP && (mapName == null || mapName.length() <= 0)) { - ACTION_FACTORY.showMessageDialog(this, "newMapNoName"); + if (mapName == null || mapName.length() <= 0) { + ACTION_FACTORY.showMessageDialog(this, mapType == MapType.PICKMAP ? "newPickmapNoName" : "newMapNoName"); mapNameField.requestFocus(); return false; } @@ -261,18 +241,13 @@ settings.setProperty(DEFAULT_LEVEL_HEIGHT_KEY, String.valueOf(height)); } - // set file name - String strfileName = fileNameField.getText(); - if (strfileName.length() < 1) { - strfileName = IGUIConstants.DEF_MAPFNAME; - } - maparch.setFileName(strfileName); - - // set map name + // set map name and file name if (mapType == MapType.GAMEMAP) { maparch.setMapName(mapName); + maparch.setFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); } else if (mapType == MapType.PICKMAP) { maparch.setMapName("pickmap"); + maparch.setFileName(mapName); } // default map text: @@ -303,12 +278,8 @@ dialog.getRootPane().setDefaultButton(pane.okButton); dialog.setModal(false); - // TODO: localize - pane.mapNameField.setText("Unnamed Map"); - dialog.setVisible(true); pane.mapNameField.selectAll(); - pane.fileNameField.selectAll(); pane.mapWidthField.selectAll(); pane.mapHeightField.selectAll(); } Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-11-30 19:51:40 UTC (rev 757) @@ -4,7 +4,6 @@ # New Map newMap.title=Neue Karte erstellen newPickmap.title=Neue Pickmap erstellen -newMapFileName=Dateiname: newMapMapName=Name: newMapParameter=Parameter newMapPickmapName=Name: @@ -14,6 +13,8 @@ newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. newMapNoName.title=Kartenname fehlt newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. +newPickmapNoName.title=Pickmap fehlt +newPickmapNoName.message=Der Pickmapname fehlt. Es ist ein eindeutiger Name erforderlich. mapWidth=Breite mapHeight=H\xF6he Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-30 19:51:40 UTC (rev 757) @@ -94,6 +94,9 @@ /** type of map to create: pickmap or normal map? */ private final MapType mapType; + /** Desired filename for new map, null if not specified. */ + private final String filename; + /** * Textfield for the name of the map. * This is only used for {@link MapType#GAMEMAP} to determine the title of the new map. @@ -102,13 +105,6 @@ private final JTextField mapNameField = new JTextField(16); /** - * Textfield for the filename of the map. - * This is only used for {@link MapType#PICKMAP} to determine the filename of the new pickmap. - * The title of the pickmap will be set to "pickmap" always. - */ - private final JTextField fileNameField = new JTextField(16); - - /** * Checkbox to set whether the default width / height should be overridden. */ private final JCheckBox mapSizeDefaultCheckbox = new JCheckBox(ACTION_FACTORY.createToggle(false, "mapSizeDefault", this)); @@ -146,38 +142,22 @@ this.mainControl = mainControl; this.mapType = mapType; - setMessage(createPanel(filename)); + this.filename = filename; + setMessage(createPanel()); } - private JPanel createPanel(final String filename) { + private JPanel createPanel() { final JPanel newLevelFromScratchPanel = new JPanel(); newLevelFromScratchPanel.setLayout(new BoxLayout(newLevelFromScratchPanel, BoxLayout.Y_AXIS)); newLevelFromScratchPanel.setBorder(IGUIConstants.DIALOG_BORDER); - // file name panel - final JPanel fileNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - if (mapType == MapType.PICKMAP) { - fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapPickmapName"))); - } else { - fileNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapFileName"))); - } - if (filename != null && filename.length() > 0) { - fileNameField.setText(filename); - } - fileNamePanel.add(fileNameField); - if (mapType == MapType.PICKMAP) { - newLevelFromScratchPanel.add(fileNamePanel); - newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); - } - if (mapType == MapType.GAMEMAP) { - // map name panel - final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - mapNamePanel.add(new JLabel(ACTION_FACTORY.getString("newMapMapName"))); - mapNamePanel.add(mapNameField); - newLevelFromScratchPanel.add(mapNamePanel); - newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); - } + // map name panel + final JPanel mapNamePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + mapNamePanel.add(new JLabel(ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newMapPickmapName" : "newMapMapName"))); + mapNamePanel.add(mapNameField); + newLevelFromScratchPanel.add(mapNamePanel); + newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); newLevelFromScratchPanel.add(mapSizeDefaultCheckbox); newLevelFromScratchPanel.add(Box.createVerticalStrut(5)); @@ -281,10 +261,10 @@ maparch.setMapSize(new Size2D(width, height)); - // the mapmaker must enter a mapname to create a new map + // the mapmaker must enter a name -- both for maps and pickmaps final String mapName = mapNameField.getText(); - if (mapType == MapType.GAMEMAP && (mapName == null || mapName.length() <= 0)) { - ACTION_FACTORY.showMessageDialog(this, "newMapNoName"); + if (mapName == null || mapName.length() <= 0) { + ACTION_FACTORY.showMessageDialog(this, mapType == MapType.PICKMAP ? "newPickmapNoName" : "newMapNoName"); mapNameField.requestFocus(); return false; } @@ -294,16 +274,10 @@ prefs.putInt(DEFAULT_LEVEL_HEIGHT_KEY, height); } - // set file name - String strfileName = fileNameField.getText(); - if (strfileName.length() < 1) { - strfileName = IGUIConstants.DEF_MAPFNAME; - } - maparch.setFileName(strfileName); - - // set map name + // set map name, file name and difficulty if (mapType == MapType.GAMEMAP) { maparch.setMapName(mapName); + maparch.setFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); try { maparch.setDifficulty((Integer) mapDifficultyField.getValue()); } catch (final IllegalArgumentException e) { @@ -314,6 +288,7 @@ } } else if (mapType == MapType.PICKMAP) { maparch.setMapName("pickmap"); + maparch.setFileName(mapName); } // default map text: @@ -342,13 +317,10 @@ dialog.getRootPane().setDefaultButton(pane.okButton); dialog.setModal(false); - // TODO: localize - pane.mapNameField.setText("Unnamed Map"); pane.setMapSizeDefault(true); dialog.setVisible(true); pane.mapNameField.selectAll(); - pane.fileNameField.selectAll(); pane.mapWidthField.selectAll(); pane.mapHeightField.selectAll(); } Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-11-30 19:51:40 UTC (rev 757) @@ -36,7 +36,6 @@ # New Map newMap.title=Neue Karte erstellen newPickmap.title=Neue Pickmap erstellen -newMapFileName=Dateiname: newMapMapName=Name: newMapParameter=Parameter newMapPickmapName=Name: @@ -46,6 +45,8 @@ newMapDimensionNotANumber.message=Die Kartengr\xF6\xDFe muss ganzzahlig sein. newMapNoName.title=Kartenname fehlt newMapNoName.message=Der Kartenname fehlt. Jede Karte muss einen Namen besitzen.\nEr wird in-game verwendet und sollte die Karte beschreiben.\nKartennamen m\xFCssen nicht eindeutig sein. +newPickmapNoName.title=Pickmap fehlt +newPickmapNoName.message=Der Pickmapname fehlt. Es ist ein eindeutiger Name erforderlich. mapTitle={0} ({1}) - Karteneigenschaften mapMap=Karte Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2006-11-29 21:04:12 UTC (rev 756) +++ trunk/src/app/net/sf/gridarta/messages.properties 2006-11-30 19:51:40 UTC (rev 757) @@ -19,7 +19,6 @@ # New Map newMap.title=Create New Map newPickmap.title=Create New Pickmap -newMapFileName=File name: newMapMapName=Map name: newMapParameter=Parameters newMapPickmapName=Pickmap name: @@ -29,6 +28,8 @@ newMapDimensionNotANumber.message=Map dimensions must be numerical integer values! newMapNoName.title=Map Name is missing newMapNoName.message=You must enter a map name! This name will appear\nin the game, so it should be a descriptive name.\nMap names do not need to be unique. +newPickmapNoName.title=Pickmap name is missing +newPickmapNoName.message=You must enter a pickmap name! # Other Strings mapWidth=Width This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 22:00:39
|
Revision: 765 http://svn.sourceforge.net/gridarta/?rev=765&view=rev Author: akirschbaum Date: 2006-12-01 14:00:38 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-01 21:49:33 UTC (rev 764) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-01 22:00:38 UTC (rev 765) @@ -73,9 +73,15 @@ private ImageIcon tmpIcon; - private final boolean isPickmap; // true if the map is a pickmap (those have different layout!) + /** + * Declares this <code>DefaultLevelRenderer</code> as a renderer for a + * Pickmap. Pickmaps have a special behaviour that's different from normal + * maps. Value: <code>true</code> if pickmap, otherwise <code>false</code>. + */ + private final boolean isPickmap; - private int bOffset; // offset to map borders (32 for std. rect. maps, 0 for pickmaps) + /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ + private int bOffset; private final CMainControl mainControl; @@ -134,12 +140,16 @@ } } - /** @return wether rendered map is a pickmap */ + /** + * @return whether rendered map is a pickmap + */ public boolean isPickmap() { return isPickmap; } - /** @return an image of the entire mapview */ + /** + * @return an image of the entire mapview + */ public BufferedImage getFullImage() { final int storeOffset; // tmp. storage to save map offset @@ -159,7 +169,6 @@ bOffset = 0; paintComponent((Graphics2D) bufGrfx, true); bOffset = storeOffset; - //return bufImage.getScaledInstance(16*mapControl.getMapWidth(), 16*mapControl.getMapHeight(), Image.SCALE_SMOOTH); return bufImage; } @@ -169,7 +178,6 @@ } else { ((Graphics2D) grfx).drawImage(backBuffer, renderTransform, null); } - //paintHighLight(grfx); } public void modelChanged() { @@ -189,7 +197,7 @@ /** * Paints this component. - * @param grfx The graphics context to paint to. + * @param grfx The graphics context to paint to. * @param isSnapshot true when this drawing is for a * "screenshot"-image, false for normal drawing */ @@ -410,7 +418,8 @@ } /** - * Painting the highlited (selected) area on the map + * Paints the highlighted (selected) area on the map. + * * @param grfx graphics context of mapview */ public void paintHighlightArea(final Graphics grfx) { @@ -453,8 +462,8 @@ } /** - * Returns the map location at the given point or null if no map - * location is at the point. + * Returns the map location at the given point or null if no map location + * is at the point. * @param point The coordinates in the renderer view. * @return The map location. */ @@ -515,4 +524,4 @@ tmpImage = null; } -} +} // class DefaultLevelRenderer Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-01 21:49:33 UTC (rev 764) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-12-01 22:00:38 UTC (rev 765) @@ -60,9 +60,9 @@ private static final long serialVersionUID = 1L; /** - * Declares this CLevelRenderer as a renderer for a Pickmap. - * Pickmaps have a special behaviour that's different from normal maps. - * Value: <code>true</code> if pickmap, otherwise <code>false</code>. + * Declares this <code>DefaultLevelRenderer</code> as a renderer for a + * Pickmap. Pickmaps have a special behaviour that's different from normal + * maps. Value: <code>true</code> if pickmap, otherwise <code>false</code>. */ private final boolean isPickmap; @@ -492,5 +492,4 @@ this.erraneousMapSquares = erraneousMapSquares; } -} // class CLevelRenderer - +} // class DefaultLevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 23:07:41
|
Revision: 775 http://svn.sourceforge.net/gridarta/?rev=775&view=rev Author: akirschbaum Date: 2006-12-01 15:07:38 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Unify field initialization. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchType.java trunk/daimonin/src/daieditor/CFArchType.java Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-01 23:04:08 UTC (rev 774) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-01 23:07:38 UTC (rev 775) @@ -69,21 +69,21 @@ /** Section Element Name. */ public static final String XML_SECTION = "section"; - private int typenr; // type number of this CF type + private int typenr = 0; // type number of this CF type private String typeName; // type name (artificial) - private String[] typeAttributes; // list of aditional attributes that an object + private String[] typeAttributes = null; // list of aditional attributes that an object // must have, in order to be of this type: // typeAttributes[0] is attr. name, typeAttributes[1] is attr. value, ... private final CFArchType defaultArchType; // contains default attributes - private CFArchType next; // next CFArchType in the list + private CFArchType next = null; // next CFArchType in the list - private String desc; // descrption of this type + private String desc = null; // descrption of this type - private String use; // notes on usage of this type + private String use = null; // notes on usage of this type private CFArchAttrib[] attr; // list of arch attributes (/array)) @@ -98,12 +98,7 @@ * @param defaultArchType default archetype */ public CFArchType(final CFArchType defaultArchType) { - next = null; - desc = null; - use = null; - typenr = 0; typeName = ""; - typeAttributes = null; sectionNum = 2; // there's always the "general" and "special" sections (even if empty) this.defaultArchType = defaultArchType; // set head of list } Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-01 23:04:08 UTC (rev 774) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-01 23:07:38 UTC (rev 775) @@ -72,19 +72,19 @@ /** Section Element Name. */ public static final String XML_SECTION = "section"; - private int typenr; // type number of this CF type + private int typenr = 0; // type number of this CF type private String typeName; // type name (artificial) - private String[] typeAttributes; // list of aditional attributes that an object + private String[] typeAttributes = null; // list of aditional attributes that an object // must have, in order to be of this type: // typeAttributes[0] is attr. name, typeAttributes[1] is attr. value, ... private final CFArchType defaultArchType; // contains default attributes - private String desc; // descrption of this type + private String desc = null; // descrption of this type - private String use; // notes on usage of this type + private String use = null; // notes on usage of this type private CFArchAttrib[] attr; // list of arch attributes (/array)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 23:19:59
|
Revision: 777 http://svn.sourceforge.net/gridarta/?rev=777&view=rev Author: akirschbaum Date: 2006-12-01 15:19:59 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-01 23:09:48 UTC (rev 776) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-01 23:19:59 UTC (rev 777) @@ -64,9 +64,9 @@ private int[] spellNum; // array of spell numbers - private Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) + private final Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) - private Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) + private final Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) private Map<String, List<String>> ignoreListTable; // table with List objects for ignore_lists (value) sorted by name (key) Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-01 23:09:48 UTC (rev 776) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-01 23:19:59 UTC (rev 777) @@ -87,12 +87,12 @@ private final List<CFArchType> archTypeList = new ArrayList<CFArchType>(); // All but the default ArchType // spell info: - private final Map<String, CAttribBitmask> bitmaskTable; // table with CAttrBitmask objects (value) sorted by name (key) + private final Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) // TODO: Find value type of List - private final Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) + private final Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) - private Map<String, List<String>> ignoreListTable; // table with List objects for ignore_lists (value) sorted by name (key) + private Map<String, List<String>> ignoreListTable; // table with List objects for ignore_lists (value) sorted by name (key) /** * Check whether the GameObject is an exit. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-01 23:57:07
|
Revision: 781 http://svn.sourceforge.net/gridarta/?rev=781&view=rev Author: akirschbaum Date: 2006-12-01 15:57:05 -0800 (Fri, 01 Dec 2006) Log Message: ----------- Unify whitespace. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchAttrib.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/CFArchAttrib.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/crossfire/src/cfeditor/CFArchAttrib.java 2006-12-01 23:57:05 UTC (rev 781) @@ -208,7 +208,6 @@ } else if (atype.startsWith("list")) { // got a bitmask attribute final String listName = atype.substring(5).trim(); - if (tlist.getListTable().containsKey(listName)) { // the list is well defined dataType = ArchAttribType.LIST; Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-01 23:57:05 UTC (rev 781) @@ -294,7 +294,6 @@ // 'realNode' is the real instance of that treasurelist final TreasureTreeNode realNode = treasureTable.get(node.getTreasureObj().getName()); - if (realNode != null) { // set accurate type of treausrelist (one/multi) node.getTreasureObj().setType(realNode.getTreasureObj().getType()); @@ -314,7 +313,6 @@ // 'realNode' is the real instance of that treasurelist final TreasureTreeNode realNode = treasureTable.get(node.getTreasureObj().getName()); - if (realNode != null) { // set accurate type of treausrelist (one/multi) node.getTreasureObj().setType(realNode.getTreasureObj().getType()); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-01 23:57:05 UTC (rev 781) @@ -226,6 +226,7 @@ // Initialise the main view mainView.init(doShow); loadDefTiles(); + if (autoPopupDocu) { // do an automated help popup because the docu version has increased // (people won't notice the docu otherwise - nobody expects a docu in opensource) @@ -243,6 +244,7 @@ // load the list with archtype-data from "types.txt" typeList = new CFArchTypeList(); + GameObject.setTypeList(typeList); // set reference in GameObject // now collect all arch you can find in the arch path!! @@ -954,6 +956,7 @@ */ boolean collectTempList(final List<GameObject> objects, final File file) { final List<GameObject> tailList = new ArrayList<GameObject>(); + // first: attach our map sucker to a default arch we have loaded for (final Iterator<GameObject> it = objects.iterator(); it.hasNext();) { final GameObject gameObject = it.next(); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-01 23:57:05 UTC (rev 781) @@ -599,7 +599,6 @@ /** Gives focus to the next window. */ public void previousWindowWanted() { - if (mapViews.size() > 1) { final MapViewIFrame view = mapViews.get(0); mapViews.remove(view); @@ -610,13 +609,11 @@ /** Gives focus to the previous window. */ public void nextWindowWanted() { - if (mapViews.size() > 1) { final MapViewIFrame view = mapViews.get(mapViews.size() - 1); mapViews.remove(view); mapViews.add(0, view); } - updateFocus(false); } @@ -665,7 +662,6 @@ final MapControl level = view.getLevel(); mainControl.setCurrentLevel(level); //statusBar.setLevelInfo(level); - } /** @@ -680,10 +676,8 @@ * @param e the occurred <code>InternalFrameEvent</code> */ public void internalFrameClosing(final InternalFrameEvent e) { - final MapViewIFrame view = (MapViewIFrame) e.getSource(); removeLevelView(view); - } /** Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-12-01 23:57:05 UTC (rev 781) @@ -220,11 +220,13 @@ log.warn("Nullpointer in getListCategoryArray()!", e); } } + return catList; } void showArchList() { final int index = jbox.getSelectedIndex(); + model.removeAllElements(); for (PanelEntry p : archList) { if (index >= 0) { @@ -290,6 +292,7 @@ setIcon(icon); } } + return this; } Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-01 23:57:05 UTC (rev 781) @@ -271,7 +271,6 @@ for (final TreasureTreeNode node : needSecondLink) { // 'realNode' is the real instance of that treasurelist final TreasureTreeNode realNode = treasureTable.get(node.getTreasureObj().getName()); - if (realNode != null) { // set accurate type of treausrelist (one/multi) node.getTreasureObj().setType(realNode.getTreasureObj().getType()); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-01 23:57:05 UTC (rev 781) @@ -637,6 +637,7 @@ for (final MapControl level : levels) { level.addEditType(newType); // calculate new type } + setTileEdit(newType); // activate the new type for all views } @@ -1161,7 +1162,6 @@ } } - /** * Load a mapfile and create a view. * @param file mapfile Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-01 23:57:05 UTC (rev 781) @@ -606,7 +606,6 @@ mapViews.add(view); updateFocus(true); } - } /** @@ -621,7 +620,6 @@ level.setFocus(view); mainControl.setCurrentLevel(level); //statusBar.setLevelInfo(level); - } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-01 23:57:05 UTC (rev 781) @@ -181,6 +181,7 @@ } } } + for (final GameObject gameObject : gameObjectsToDelete) { gameObject.remove(); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-12-01 23:57:05 UTC (rev 781) @@ -286,6 +286,7 @@ /** Load all arches and pngs from the collected files "archtypes" and "daimonin.0" */ private void loadArchFromCollected() { setLoadedFromArchive(true); // load from the collected files + try { mainControl.getAnimationObjects().loadAnimTree( new File(new File(mainControl.getArchDefaultFolder(), IGUIConstants.CONFIG_DIR), IGUIConstants.ANIMTREE_FILE)); Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-12-01 23:39:02 UTC (rev 780) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-12-01 23:57:05 UTC (rev 781) @@ -122,6 +122,7 @@ } } } + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-02 11:44:13
|
Revision: 788 http://svn.sourceforge.net/gridarta/?rev=788&view=rev Author: akirschbaum Date: 2006-12-02 03:44:12 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:42:16 UTC (rev 787) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:44:12 UTC (rev 788) @@ -265,15 +265,15 @@ } } - void moveTileUp(final GameObject arch, final boolean refresh) { - arch.moveUp(); + void moveTileUp(final GameObject gameObject, final boolean refresh) { + gameObject.moveUp(); if (refresh) { refreshCurrentMap(); } } - void moveTileDown(final GameObject arch, final boolean refresh) { - arch.moveDown(); + void moveTileDown(final GameObject gameObject, final boolean refresh) { + gameObject.moveDown(); if (refresh) { refreshCurrentMap(); } @@ -491,8 +491,8 @@ } // setup quick view window - public void showArchPanelQuickObject(final GameObject arch) { - mainView.showArchPanelQuickObject(arch); + public void showArchPanelQuickObject(final GameObject gameObject) { + mainView.showArchPanelQuickObject(gameObject); } /** {@inheritDoc} */ @@ -921,12 +921,12 @@ * Open an attribute dialog window for the specified arch * @param arch attr. window is opened for this arch */ - public void openAttrDialog(final GameObject arch) { + public void openAttrDialog(final GameObject gameObject) { if (typeList.isEmpty()) { // types.txt is missing! showMessage("File Missing", "The definitions-file \"types.txt\" is missing! The\nattribute interface doesn't work without that file."); - } else if (arch != null && arch.getArchetypeName() != null) { - CAttribDialog.showAttribDialog(typeList, arch, this); + } else if (gameObject != null && gameObject.getArchetypeName() != null) { + CAttribDialog.showAttribDialog(typeList, gameObject, this); } } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 11:42:16 UTC (rev 787) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 11:44:12 UTC (rev 788) @@ -1234,12 +1234,12 @@ * Open an attribute dialog window for the specified arch * @param arch attr. window is opened for this arch */ - public void openAttrDialog(final GameObject arch) { + public void openAttrDialog(final GameObject gameObject) { if (typeList.isEmpty()) { // types.txt is missing! ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoTypes"); } else if (arch != null && arch.hasArchetype()) { - CAttribDialog.showAttribDialog(typeList, arch, this); + CAttribDialog.showAttribDialog(typeList, gameObject, this); } else { ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-02 11:47:03
|
Revision: 789 http://svn.sourceforge.net/gridarta/?rev=789&view=rev Author: akirschbaum Date: 2006-12-02 03:47:03 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Make method private. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:44:12 UTC (rev 788) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:47:03 UTC (rev 789) @@ -385,7 +385,7 @@ * Set all global settings (mostly read from the * 'CFJavaEditor.ini'-file) */ - public void readGlobalSettings() { + private void readGlobalSettings() { // Get the directories strMapDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(MAP_DIR_KEY, DEFAULT_MAP_DIR); strArchDir = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(ARCH_DIR_KEY, DEFAULT_ARCH_DIR); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 11:44:12 UTC (rev 788) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 11:47:03 UTC (rev 789) @@ -681,7 +681,7 @@ } /** Set all global settings from the preferences. */ - void readGlobalSettings() { + private void readGlobalSettings() { initDirs(); loadFromArchive = prefs.getBoolean(LOAD_ARCH_COLL, true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-02 18:27:47
|
Revision: 792 http://svn.sourceforge.net/gridarta/?rev=792&view=rev Author: christianhujer Date: 2006-12-02 10:27:47 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Unified CMainControl, made Daimonin compilable again. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 11:52:03 UTC (rev 791) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-02 18:27:47 UTC (rev 792) @@ -919,13 +919,13 @@ /** * Open an attribute dialog window for the specified arch - * @param arch attr. window is opened for this arch + * @param gameObject GameObject to open attribute dialog window for. */ public void openAttrDialog(final GameObject gameObject) { if (typeList.isEmpty()) { // types.txt is missing! showMessage("File Missing", "The definitions-file \"types.txt\" is missing! The\nattribute interface doesn't work without that file."); - } else if (gameObject != null && gameObject.getArchetypeName() != null) { + } else if (gameObject != null && gameObject.hasArchetype()) { CAttribDialog.showAttribDialog(typeList, gameObject, this); } } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 11:52:03 UTC (rev 791) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-02 18:27:47 UTC (rev 792) @@ -1229,13 +1229,13 @@ /** * Open an attribute dialog window for the specified arch - * @param arch attr. window is opened for this arch + * @param gameObject GameObject to open attribute dialog window for. */ public void openAttrDialog(final GameObject gameObject) { if (typeList.isEmpty()) { // types.txt is missing! ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoTypes"); - } else if (arch != null && arch.hasArchetype()) { + } else if (gameObject != null && gameObject.hasArchetype()) { CAttribDialog.showAttribDialog(typeList, gameObject, this); } else { ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); @@ -1247,7 +1247,7 @@ * @param file File to save to * @param mapModel MapModel to save */ - public void encodeMapFile(final File file, final MapModel mapModel) { + public void encodeMapFile(@NotNull final File file, final MapModel mapModel) { try { final CMapWriter mapFileEncoder = new CMapWriter(file); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-02 18:32:39
|
Revision: 794 http://svn.sourceforge.net/gridarta/?rev=794&view=rev Author: christianhujer Date: 2006-12-02 10:32:40 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Documented the reason for preventing instantiation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFJavaEditor.java Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-02 18:28:27 UTC (rev 793) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-02 18:32:40 UTC (rev 794) @@ -31,8 +31,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; -import net.sf.japi.swing.ActionFactory; /** * Main class, launches the level editor application. @@ -43,7 +43,7 @@ private static final Logger log = Logger.getLogger(CFJavaEditor.class); - /** Prevent instantiation. */ + /** Prevent instantiation (UtilityClass). */ private CFJavaEditor() { } Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-02 18:28:27 UTC (rev 793) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-02 18:32:40 UTC (rev 794) @@ -44,7 +44,7 @@ private static final Logger log = Logger.getLogger(CFJavaEditor.class); - /** Prevent instantiation. */ + /** Prevent instantiation (UtilityClass). */ private CFJavaEditor() { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-02 18:42:43
|
Revision: 795 http://svn.sourceforge.net/gridarta/?rev=795&view=rev Author: christianhujer Date: 2006-12-02 10:42:43 -0800 (Sat, 02 Dec 2006) Log Message: ----------- Some unification of CFArchTypeList. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-02 18:32:40 UTC (rev 794) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-02 18:42:43 UTC (rev 795) @@ -64,11 +64,22 @@ private int[] spellNum; // array of spell numbers - private final Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) + /** + * Table with CAttribBitmask objects (value) accessible by name (key). + */ + private final Map<String, CAttribBitmask> bitmaskTable; - private final Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) + /** + * Table with List objects for lists (value) accessible by name (key). + * The value type of the list is <code><?></code> because the lists elements are altering Integers and Strings. + * @todo Refactor the List to contain Pairs or something like that so it doesn't contain two types. + */ + private final Map<String, List<?>> listTable; - private Map<String, List<String>> ignoreListTable; // table with List objects for ignore_lists (value) sorted by name (key) + /** + * Table with List objects for ignore_lists (value) accessible by name (key). + */ + private Map<String, List<String>> ignoreListTable; private int length = 0; // Number of types in the list @@ -235,11 +246,6 @@ return list; } - /** @return true if this typelist contains no data */ - public boolean isEmpty() { - return head == null || head.getNext() == null; - } - /** * @return Number of CFArchTypes in the list. * (Not counting the default type.) @@ -268,10 +274,6 @@ return bitmaskTable; } - public Map<String, List<?>> getListTable() { - return listTable; - } - /** * Return the ignore list table which contains all definitions of ignore lists for arch attributes. * @return ignore list table @@ -281,6 +283,14 @@ } /** + * Returns the list table which contains all definitions of list types for arch attributes. + * @return list table + */ + public Map<String, List<?>> getListTable() { + return listTable; + } + + /** * Read the spells from "spells.xml" into the arrays 'spellName' * and 'spellNum'. This method is called at startup */ @@ -573,11 +583,21 @@ return type; } + /** + * Returns whether this typelist contains no data. + * @return <code>true</code> if this typelist contains no data, otherwise <code>false</code>. + */ + public boolean isEmpty() { + return head == null || head.getNext() == null; + } + + /** * Find and return the type-structure (<code>CFArchType</code>) that * matches the given 'typeName'. These type-names are "artificial" * names, defined in "types.txt". They appear in the type selection box * in the attribute-dialog. + * @param typeName Name of the type to get. * @return the <code>CFArchType</code> that matches, * or the first (misc) type if no match is found. */ Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-02 18:32:40 UTC (rev 794) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-02 18:42:43 UTC (rev 795) @@ -73,7 +73,9 @@ /** The XPath for using XPath. */ private XPath xpath; - // table with type numbers as keys (Integer), and type names as values (String) + /** + * Table with type numbers as keys (Integer), and type names as values (String). + */ private final Map<Integer, String> archTypeNumbers = new HashMap<Integer, String>(); /** List with arch object matchers. */ @@ -87,12 +89,22 @@ private final List<CFArchType> archTypeList = new ArrayList<CFArchType>(); // All but the default ArchType // spell info: - private final Map<String, CAttribBitmask> bitmaskTable; // table with CAttribBitmask objects (value) sorted by name (key) + /** + * Table with CAttribBitmask objects (value) accessible by name (key). + */ + private final Map<String, CAttribBitmask> bitmaskTable; - // TODO: Find value type of List - private final Map<String, List<?>> listTable; // table with List objects for lists (value) sorted by name (key) + /** + * Table with List objects for lists (value) accessible by name (key). + * The value type of the list is <code><?></code> because the lists elements are altering Integers and Strings. + * @todo Refactor the List to contain Pairs or something like that so it doesn't contain two types. + */ + private final Map<String, List<?>> listTable; - private Map<String, List<String>> ignoreListTable; // table with List objects for ignore_lists (value) sorted by name (key) + /** + * Table with List objects for ignore_lists (value) accessible by name (key). + */ + private Map<String, List<String>> ignoreListTable; /** * Check whether the GameObject is an exit. @@ -347,20 +359,6 @@ /** * Find and return the type-structure (<code>CFArchType</code>) that - * matches the given 'typeName'. These type-names are "artificial" - * names, defined in "types.txt". They appear in the type selection box - * in the attribute-dialog. - * @return the <code>CFArchType</code> that matches, - * or the first (misc) type if no match is found. - */ - public CFArchType getTypeByName(final String typeName) { - // return: matching type or first type (misc) if no other found - final CFArchType type = archTypeNames.get(typeName.trim()); - return type == null ? archTypeList.get(0) : type; - } - - /** - * Find and return the type-structure (<code>CFArchType</code>) that * matches for the given arch. This is not only a comparison between * type numbers - special type-attributes must also be dealt with. * <p/> @@ -405,9 +403,27 @@ return archTypeList.get(0); } - /** @return true if this typelist contains no data */ + /** + * Returns whether this typelist contains no data. + * @return <code>true</code> if this typelist contains no data, otherwise <code>false</code>. + */ public boolean isEmpty() { return archTypeList.size() == 0; } + /** + * Find and return the type-structure (<code>CFArchType</code>) that + * matches the given 'typeName'. These type-names are "artificial" + * names, defined in "types.txt". They appear in the type selection box + * in the attribute-dialog. + * @param typeName Name of the type to get. + * @return the <code>CFArchType</code> that matches, + * or the first (misc) type if no match is found. + */ + public CFArchType getTypeByName(final String typeName) { + // return: matching type or first type (misc) if no other found + final CFArchType type = archTypeNames.get(typeName.trim()); + return type == null ? archTypeList.get(0) : type; + } + } // class CFArchTypeList This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |