You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-08-27 14:46:12
|
Revision: 283 Author: akirschbaum Date: 2006-08-27 07:27:17 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=283&view=rev Log Message: ----------- Remove variable that always is null. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-27 14:25:53 UTC (rev 282) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-08-27 14:27:17 UTC (rev 283) @@ -626,25 +626,18 @@ * is inserted below */ public void addArchObjectToMap(final ArchObject arch, final boolean insertBelow) { - ArchObject oldarch, startarch; // our new suckers (copys, not ref ptrs) + ArchObject startarch; // our new suckers (copys, not ref ptrs) // Make sure this arch has the proper edit_type if (arch.getEditType() == IGUIConstants.TILE_EDIT_NONE) { arch.calculateEditType(mapControl.getActiveEditType()); } - oldarch = null; startarch = null; final int mapx = arch.getMapX(); final int mapy = arch.getMapY(); - if (oldarch != null) { - arch.setMapMultiHead(startarch); - oldarch.setMapMultiNext(arch); - } else { - startarch = arch; - } - oldarch = arch; + startarch = arch; // insert ít in map or add to arch in map ArchObject node = mapGrid[mapx][mapy]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 14:35:05
|
Revision: 284 Author: christianhujer Date: 2006-08-27 07:34:53 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=284&view=rev Log Message: ----------- Removed duplicate classes MapEvent and MapListener. Modified Paths: -------------- trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/daieditor/map/MapModelEvent.java trunk/daimonin/src/daieditor/map/MapModelListener.java Removed Paths: ------------- trunk/daimonin/src/daieditor/map/MapEvent.java trunk/daimonin/src/daieditor/map/MapListener.java Deleted: trunk/daimonin/src/daieditor/map/MapEvent.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapEvent.java 2006-08-27 14:27:17 UTC (rev 283) +++ trunk/daimonin/src/daieditor/map/MapEvent.java 2006-08-27 14:34:53 UTC (rev 284) @@ -1,148 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2005 Christian Hujer - * - * (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.map; - -import daieditor.arch.ArchObject; -import java.util.EventObject; - -/** - * Class for Map events. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo to improve speed, the event should also be capable of reporting the changed arches - * @todo think about an intelligent way to detect whether repainting is required - * @serial exclude - */ -public final class MapEvent extends EventObject { - - /** The Map that's changed. */ - private final MapModel map; - - /** The squares that have changed. */ - private final MapSquare[] squares; - - /** The arches that have been changed. */ - private final ArchObject[] arches; - - /** The type of this event. */ - private Type type; - - /** - * Create a MapEvent. - * @param map Map that's changed by that event (serves as src) - * @param type Type of this event - */ - public MapEvent(final MapModel map, final Type type) { - this(map, type, null, null); - } - - /** - * Create a MapEvent. - * @param map Map that's changed by that event (serves as src) - * @param type Type of this event - * @param squares Squares that have changed - */ - public MapEvent(final MapModel map, final Type type, final MapSquare... squares) { - this(map, type, squares, null); - } - - /** - * Create a MapEvent. - * @param map Map that's changed by that event (serves as src) - * @param type Type of this event - * @param arches ArchObjects that have changed - */ - public MapEvent(final MapModel map, final Type type, final ArchObject... arches) { - this(map, type, null, arches); - } - - /** - * Create a MapEvent. - * @param map Map that's changed by that event (serves as src) - * @param type Type of this event - * @param squares Squares that have changed - * @param arches ArchObjects that have changed - */ - public MapEvent(final MapModel map, final Type type, final MapSquare[] squares, final ArchObject[] arches) { - super(map); - this.map = map; - this.type = type; - this.squares = squares; - this.arches = arches; - } - - /** - * Get the map that's changed by this event. - * @return map that's changed by this event - */ - public MapModel getMap() { - return map; - } - - /** - * Get the Squares that have been changed by this event. - * @return squares that have been changed or <code>null</code> if the change did not affect specific squares - */ - public MapSquare[] getSquares() { - return squares; - } - - /** - * Get the Arches that have been changed by this event. - * @return arches that have been changed or <code>null</code> if the change did not affect specific arches - */ - public ArchObject[] getArches() { - return arches; - } - - /** - * Get the type of this event. - * @return type of this event - */ - public Type getType() { - return type; - } - - /** The types of Map Events. */ - public enum Type { - - /** Size has changed. */ - SIZE_CHANGED, - - /** - * A Square has changed. - * This is used when new arches were added, arches were removed or the order of arches inside a square has changed. - */ - SQUARES_CHANGED, - - /** - * Arch inside a Square have changed. - * This is used when the attributes of one or more arches were changed. - */ - ARCHES_CHANGED - - } // enum Type - -} // class MapEvent Deleted: trunk/daimonin/src/daieditor/map/MapListener.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapListener.java 2006-08-27 14:27:17 UTC (rev 283) +++ trunk/daimonin/src/daieditor/map/MapListener.java 2006-08-27 14:34:53 UTC (rev 284) @@ -1,54 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2005 Christian Hujer - * - * (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.map; - -import java.util.EventListener; - -/** - * Interface for listeners listening on MapEvents. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public interface MapListener extends EventListener { - - /** - * Map size has changed. - * @param e EventObject with event information - */ - void mapSizeChanged(MapEvent e); - - /** - * Map Squares have changed. - * @param e EventObject with event information - */ - void mapSquaresChanged(MapEvent e); - - /** - * Map Arches have changed. - * @param e EventObject with event information - */ - void mapArchesChanged(MapEvent e); - -} // interface MapListener Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-27 14:27:17 UTC (rev 283) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-08-27 14:34:53 UTC (rev 284) @@ -128,13 +128,13 @@ /** * Register a map listener. - * @param listener MapListener to register + * @param listener MapModelListener to register */ void addMapModelListener(@NotNull MapModelListener listener); /** * Unregister a map listener. - * @param listener MapListener to unregsiter + * @param listener MapModelListener to unregsiter */ void removeMapModelListener(@NotNull MapModelListener listener); Modified: trunk/daimonin/src/daieditor/map/MapModelEvent.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModelEvent.java 2006-08-27 14:27:17 UTC (rev 283) +++ trunk/daimonin/src/daieditor/map/MapModelEvent.java 2006-08-27 14:34:53 UTC (rev 284) @@ -50,7 +50,7 @@ private Type type; /** - * Create a MapEvent. + * Create a MapModelEvent. * @param map Map that's changed by that event (serves as src) * @param type Type of this event */ @@ -59,7 +59,7 @@ } /** - * Create a MapEvent. + * Create a MapModelEvent. * @param map Map that's changed by that event (serves as src) * @param type Type of this event * @param squares Squares that have changed @@ -69,7 +69,7 @@ } /** - * Create a MapEvent. + * Create a MapModelEvent. * @param map Map that's changed by that event (serves as src) * @param type Type of this event * @param arches ArchObjects that have changed @@ -79,7 +79,7 @@ } /** - * Create a MapEvent. + * Create a MapModelEvent. * @param map Map that's changed by that event (serves as src) * @param type Type of this event * @param squares Squares that have changed @@ -145,4 +145,4 @@ } // enum Type -} // class MapEvent +} // class MapModelEvent Modified: trunk/daimonin/src/daieditor/map/MapModelListener.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModelListener.java 2006-08-27 14:27:17 UTC (rev 283) +++ trunk/daimonin/src/daieditor/map/MapModelListener.java 2006-08-27 14:34:53 UTC (rev 284) @@ -51,4 +51,4 @@ */ void mapArchesChanged(MapModelEvent e); -} // interface MapListener +} // interface MapModelListener This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 14:26:05
|
Revision: 282 Author: christianhujer Date: 2006-08-27 07:25:53 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=282&view=rev Log Message: ----------- Removed manually linked lists for containers in ArchObjects. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java trunk/daimonin/src/daieditor/map/MapSquare.java Removed Paths: ------------- trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-27 12:22:46 UTC (rev 281) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-27 14:25:53 UTC (rev 282) @@ -53,6 +53,7 @@ * @todo this class maybe could be split into 3 classes: AbstractArchObject as * abstract base class, DefArchObject for default arches and ArchObject for * normal arches. + * @todo this class is not always the best place for multipart object handling, see also {@link ArchObjectContainer} for issues about this */ public final class ArchObject /*extends NamedObject*/ extends ArchObjectContainer implements Cloneable, net.sf.gridarta.arch.ArchObject { @@ -104,7 +105,7 @@ * Data for multitile-arches. * Stays null for singlesquare-arches. */ - private MultiArchData multi; + @Nullable private MultiArchData multi; /** * Data for scripted events. @@ -132,10 +133,6 @@ */ private boolean artifact; - private ArchObject next; // to chain ArchObjects in maps - - private ArchObject prev; // same - /** * Container of this ArchObject. * There are two possibilities for the container: @@ -528,7 +525,7 @@ * @param node ArchObject to append */ public void insertBefore(final ArchObject node) { - add(prev, node, this); + getContainer().insertBefore(node, this); } /** @@ -536,7 +533,7 @@ * @param node ArchObject to append */ public void insertAfter(final ArchObject node) { - add(this, node, next); + getContainer().insertAfter(this, node); } /** {@inheritDoc} */ @@ -809,38 +806,6 @@ } } - /** - * Set Next link. - * @param arch Arch to point next to - */ - void setNext(final ArchObject arch) { - next = arch; - } - - /** - * Set Prev link. - * @param arch Arch to point prev to - */ - void setPrev(final ArchObject arch) { - prev = arch; - } - - /** - * Get Next link. - * @return next link - */ - ArchObject getNext() { - return next; - } - - /** - * Get Prev link. - * @return prev link - */ - ArchObject getPrev() { - return prev; - } - public int getDirection() { return direction; } @@ -1188,8 +1153,6 @@ final ArchObject clone = (ArchObject) super.clone(); clone.mapx = -1; clone.mapy = -1; - clone.next = null; - clone.prev = null; clone.container = null; return clone; } catch (final CloneNotSupportedException e) { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 12:22:46 UTC (rev 281) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-27 14:25:53 UTC (rev 282) @@ -23,6 +23,11 @@ import daieditor.map.MapSquare; import java.util.Iterator; +import java.util.List; +import java.util.ArrayList; +import java.util.ListIterator; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.NotNull; /** * Base class for classes that match contain ArchObjects as children. @@ -32,15 +37,16 @@ * <li>{@link daieditor.map.MapSquare} extends this class to list the tiles on a MapSquare.</li> * </ul> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @todo: In case of MapSquares, this class is most likely bogus regarding multipart objects. This needs to be fixed. */ public abstract class ArchObjectContainer implements Iterable<ArchObject> { - /** First object contained. */ - private ArchObject first; + /** + * The contents of this container. + * @note the order of this container is bottom to top. + */ + private List<ArchObject> contents = new ArrayList<ArchObject>(); - /** Last object contained. */ - private ArchObject last; - /** Iterable implementation for recursice traversal. */ private Iterable<ArchObject> recursive; @@ -57,13 +63,13 @@ recursive = new Iterable<ArchObject>() { /** {@inheritDoc} */ public Iterator<ArchObject> iterator() { - return new RecursiveArchObjectIterator(first); + return new RecursiveArchObjectIterator(ArchObjectContainer.this); } }; reverse = new Iterable<ArchObject>() { /** {@inheritDoc} */ public Iterator<ArchObject> iterator() { - return new ArchObjectIterator(last, false); + return new ReverseIterator(); } }; // Iterable<ArchObject> reverse } @@ -74,7 +80,7 @@ * The Iterator returned is transparent, that means modifying the iterator's collection actually modifies the unterlying ArchObjectContainer. */ public final Iterator<ArchObject> iterator() { - return new ArchObjectIterator(first); + return contents.iterator(); } /** @@ -100,7 +106,7 @@ * @return <code>true</code> if this square is empty, otherwise <code>false</code> */ public boolean isEmpty() { - return first == null; + return contents.isEmpty(); } /** @@ -109,7 +115,7 @@ * @return first object contained */ public final ArchObject getFirst() { - return first; + return contents.get(contents.size() - 1); } /** @@ -118,7 +124,7 @@ * @return last object contained */ public final ArchObject getLast() { - return last; + return contents.get(0); } /** @@ -126,35 +132,16 @@ * @param arch ArchObject to remove */ final void remove(final ArchObject arch) { - if (arch == first) { - first = arch.getNext(); - } - if (arch == last) { - last = arch.getPrev(); - } - if (arch.getNext() != null) { - arch.getNext().setPrev(arch.getPrev()); - } - if (arch.getPrev() != null) { - arch.getPrev().setNext(arch.getNext()); - } arch.setContainer(null); - arch.setNext(null); - arch.setPrev(null); - assert isListOkay() : "List in wrong order"; squareChanged(); } /** Remove all ArchObjects from this container. */ public final void removeAll() { - for (ArchObject arch : this) { + for (final ArchObject arch : contents) { arch.setContainer(null); - arch.setNext(null); - arch.setPrev(null); } - first = null; - last = null; - assert isListOkay() : "List in wrong order"; + contents.clear(); squareChanged(); } @@ -163,11 +150,12 @@ * @param arch item to move to top */ public final void moveTop(final ArchObject arch) { - getMapSquare().getModel().beginTransaction(); - while (last != arch) { - swap(arch, arch.getNext()); + final int oldIndex = contents.indexOf(arch); + if (oldIndex != contents.size() - 1) { + contents.remove(arch); + contents.add(arch); + squareChanged(); } - getMapSquare().getModel().endTransaction(); } /** @@ -175,7 +163,12 @@ * @param arch item to move up */ public final void moveUp(final ArchObject arch) { - swap(arch, arch.getNext()); + final int oldIndex = contents.indexOf(arch); + if (oldIndex < contents.size() - 1) { + contents.remove(arch); + contents.add(oldIndex + 1, arch); + squareChanged(); + } } /** @@ -183,7 +176,12 @@ * @param arch item to move down */ public final void moveDown(final ArchObject arch) { - swap(arch.getPrev(), arch); + final int oldIndex = contents.indexOf(arch); + if (oldIndex > 0) { + contents.remove(arch); + contents.add(oldIndex - 1, arch); + squareChanged(); + } } /** @@ -191,47 +189,15 @@ * @param arch item to move to bottom */ public final void moveBottom(final ArchObject arch) { - getMapSquare().getModel().beginTransaction(); - while (first != arch) { - swap(arch.getPrev(), arch); + final int oldIndex = contents.indexOf(arch); + if (oldIndex != 0) { + contents.remove(arch); + contents.add(0, arch); + squareChanged(); } - getMapSquare().getModel().endTransaction(); } /** - * Swap to ArchObjects, exchanging them with each other. - * If at least one of <var>a1</var> and <var>a2</var> is <code>null</code>, this method simply does nothing. - * @param a1 first ArchObject, maybe <code>null</code> - * @param a2 second ArchObject, maybe <code>null</code> - * @note as a precondition, a1 must be preceding a2 - */ - private void swap(final ArchObject a1, final ArchObject a2) { - if (a1 == null || a2 == null) { - return; - } - assert a1.getNext() == a2; - assert a2.getPrev() == a1; - a1.setNext(a2.getNext()); - a2.setPrev(a1.getPrev()); - if (a1.getPrev() != null) { - a1.getPrev().setNext(a2); - } - if (a2.getNext() != null) { - a2.getNext().setPrev(a1); - } - a1.setPrev(a2); - a2.setNext(a1); - if (first == a1) { - first = a2; - } - if (last == a2) { - last = a1; - } - assert isListOkay() : "List in wrong order"; - squareChanged(); - } - - /** * Get the X coordinate on the map. * @return X coordinate on map */ @@ -248,7 +214,9 @@ * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory */ public void addLast(final ArchObject arch) { - add(last, arch, null); + contents.add(0, arch); + arch.setContainer(this); + squareChanged(); } /** @@ -256,7 +224,9 @@ * @param arch the free yet unlinked <code>ArchObject</code> to be placed in the inventory */ public void addFirst(final ArchObject arch) { - add(null, arch, first); + contents.add(arch); + arch.setContainer(this); + squareChanged(); } /** @@ -265,7 +235,10 @@ * @param arch ArchObject to insert */ public void insertAfter(final ArchObject prev, final ArchObject arch) { - add(prev, arch, prev != null ? prev.getNext() : null); + final int insertIndex = contents.indexOf(prev); + contents.add(insertIndex, arch); + arch.setContainer(this); + squareChanged(); } /** @@ -274,36 +247,9 @@ * @param next next anchor */ public void insertBefore(final ArchObject arch, final ArchObject next) { - add(next != null ? next.getPrev() : null, arch, next); - } - - /** - * Add the given ArchObject in this Container. - * If you need to change add behaviour, override this method. - * @param prev previous anchor, <code>invLast</code> for addLast, <code>null</code> for addFirst - * @param arch ArchObject to add - * @param next next anchor, <code>null</code> for addLast, <code>invStart</code> for addFirst - * @note as a precondition, this method requires that <var>prev</var> and <var>next</var> are either null or linked to each other. - */ - protected void add(final ArchObject prev, final ArchObject arch, final ArchObject next) { - assert prev == null || prev.getNext() == next; - assert next == null || next.getPrev() == prev; - if (prev == null) { - first = arch; - } else { - prev.setNext(arch); - } - arch.setPrev(prev); - arch.setNext(next); - if (next == null) { - last = arch; - } else { - next.setPrev(arch); - } + final int insertIndex = contents.indexOf(next); + contents.add(insertIndex + 1, arch); arch.setContainer(this); - arch.setMapX(getMapX()); - arch.setMapY(getMapY()); - assert isListOkay() : "List in wrong order"; squareChanged(); } @@ -313,28 +259,15 @@ * @param newArch new ArchObject that replaces oldArch */ public void replace(final ArchObject oldArch, final ArchObject newArch) { - final ArchObject prev = oldArch.getPrev(); - final ArchObject next = oldArch.getNext(); - if (prev == null) { - first = newArch; - } else { - prev.setNext(newArch); - } - newArch.setPrev(prev); - newArch.setNext(next); - if (next == null) { - last = newArch; - } else { - next.setPrev(newArch); - } - newArch.setContainer(this); - newArch.setMapX(getMapX()); - newArch.setMapY(getMapY()); - oldArch.setPrev(null); - oldArch.setNext(null); + final int insertIndex = contents.indexOf(oldArch); + contents.remove(oldArch); + contents.add(newArch); oldArch.setContainer(null); - assert isListOkay() : "List in wrong order"; + newArch.setContainer(this); squareChanged(); + newArch.setMapX(getMapX()); // ??? + newArch.setMapY(getMapY()); // ??? + squareChanged(); } /** @@ -354,36 +287,11 @@ } } - /** - * Method that checks whether the linked lists are still in order. - * Usage: <code>assert isListOkay() : "List in wrong order";</code> - * Use this after list manipulation. - * @return <code>true</code> on success (list still in order) - * @throws AssertionError on failure (list disordered) - */ - private boolean isListOkay() throws AssertionError { - ArchObject next, prev = null; - for (ArchObject current = first; current != null; current = next) { - next = current.getNext(); - assert current.getPrev() == prev; - ((ArchObjectContainer) current).isListOkay(); - prev = current; - if (next == null) { - assert current == last; - } - } - // this looks strange, when is false going to be returned? - // quite simple: never. In the "false case", instead an AssertionError is thrown (asserts) by this method itself. - return true; - } - /** {@inheritDoc} */ @Override protected ArchObjectContainer clone() throws CloneNotSupportedException { try { final ArchObjectContainer clone = (ArchObjectContainer) super.clone(); clone.initIterables(); - clone.first = null; - clone.last = null; return clone; } catch (final CloneNotSupportedException e) { assert false; @@ -391,4 +299,21 @@ } } + /** ArchObjectIterator for iterating over this container in reverse order. */ + private class ReverseIterator implements Iterator<ArchObject> { + private ListIterator<ArchObject> delegate = contents.listIterator(contents.size()); + + public boolean hasNext() { + return delegate.hasPrevious(); + } + + public ArchObject next() { + return delegate.previous(); + } + + public void remove() { + delegate.remove(); + } + } // class ReverseIterator + } // interface ArchObjectContainer Deleted: trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java 2006-08-27 12:22:46 UTC (rev 281) +++ trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java 2006-08-27 14:25:53 UTC (rev 282) @@ -1,99 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * - * (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.arch; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * Iterator for ArchObjects. - * This class is only meant for usage during the transition from manually linked lists to encapslued Collections lists in arch handling. - * This Iterator is believed to be safe against concurrent modification. - * Therefore it is not fail-fast, it does not throw ConcurrentModificationException. - * The next link is future-fetched, which means that the invocation of {@link #next()} already prepares the next invocation of {@link #hasNext()} or {@link #next()}. - * This allows to safely perform manipulations on the current object, especially deletion, without loosing traversal. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -class ArchObjectIterator implements Iterator<ArchObject> { - -// /** Current ArchObject, used for {@link #remove()}. */ -// private ArchObject current; - - /** Traversal direction. */ - private final boolean forward; - - /** ArchObject for first iteration step. */ - private ArchObject next; - - /** - * Creates a new instance of ArchObjectIterator (forward iteration). - * @param first first ArchObject to start forward iteration on - */ - ArchObjectIterator(final ArchObject first) { - this(first, true); - } - - /** - * Creates a new instance of ArchObjectIterator. - * @param first first ArchObject to start iteration on - * @param forward <code>true</code> for forward iteration, <code>false</code> for backward iteration - */ - ArchObjectIterator(final ArchObject first, final boolean forward) { - next = first; - this.forward = forward; - } - - /** {@inheritDoc} */ - public boolean hasNext() { - return next != null; - } - - /** {@inheritDoc} */ - public ArchObject next() { - try { - return next; - } finally { - try { - next = forward ? next.getNext() : next.getPrev(); - } catch (final NullPointerException e) { - //noinspection ThrowFromFinallyBlock - throw new NoSuchElementException(); - } - } - } - - /** - * {@inheritDoc} - * @todo eventually, multitile-removal should go here. - */ - public void remove() { - throw new UnsupportedOperationException(); -// ArchObject prev = current.getPrevArch(); -// ArchObject next = current.getNextArch(); -// if (next != null) { next.setPrevArch(prev); } -// if (prev != null) { prev.setPrevArch(next); } - } - -} // class ArchObjectIterator Modified: trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java =================================================================== --- trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java 2006-08-27 12:22:46 UTC (rev 281) +++ trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java 2006-08-27 14:25:53 UTC (rev 282) @@ -2,6 +2,10 @@ import java.util.Iterator; import java.util.NoSuchElementException; +import java.util.ArrayList; +import java.util.List; +import java.util.Stack; +import java.util.EmptyStackException; /** * Iterator for recursively iterating over ArchObjectContainers. @@ -9,48 +13,49 @@ */ class RecursiveArchObjectIterator implements Iterator<ArchObject> { - /** The current iteration element. */ - private ArchObject current; + /** The Iterator stack. */ + private Stack<Iterator<ArchObject>> iteratorStack = new Stack<Iterator<ArchObject>>(); - /** The next iteration element. */ - private ArchObject next; + /** The current iterator. */ + private Iterator<ArchObject> current; /** * Create a recursive ArchObject Iterator. - * @param first ArchObjectContainer to start with + * @param container ArchObjectContainer to start with */ - RecursiveArchObjectIterator(final ArchObject first) { - next = first; + RecursiveArchObjectIterator(final ArchObjectContainer container) { + current = container.iterator(); } /** {@inheritDoc} */ public boolean hasNext() { - return next != null; + return current.hasNext(); } /** {@inheritDoc} */ public ArchObject next() { - current = next; - if (current == null) { - throw new NoSuchElementException(); - } - next = current.isEmpty() ? current.getNext() : current.getFirst(); - if (next == null && current.isInContainer()) { - final Object container = current.getContainer(); - if (container instanceof ArchObject) { - next = ((ArchObject) container).getNext(); + final ArchObject arch = current.next(); + try { + return arch; + } finally { + if (!arch.isEmpty()) { + iteratorStack.push(current); + current = arch.iterator(); + } else { + try { + while (!current.hasNext() ) { + current = iteratorStack.pop(); + } + } catch (final EmptyStackException e) { + /* ignore. */ + } } } - return current; } /** {@inheritDoc} */ public void remove() { - if (current == null) { - throw new IllegalStateException("remove() already invoked!"); - } current.remove(); - current = null; } } // class RecursiveArchObjectIterator Modified: trunk/daimonin/src/daieditor/map/MapSquare.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapSquare.java 2006-08-27 12:22:46 UTC (rev 281) +++ trunk/daimonin/src/daieditor/map/MapSquare.java 2006-08-27 14:25:53 UTC (rev 282) @@ -24,8 +24,8 @@ package daieditor.map; -import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectContainer; +import org.jetbrains.annotations.NotNull; /** * A single Map Square. @@ -37,7 +37,7 @@ public class MapSquare extends ArchObjectContainer { /** The MaoModel this square is associated with. */ - private final MapModel model; + @NotNull private final MapModel model; /** The X Coordinate of this map square within the model's grid. */ private final int x; @@ -51,7 +51,7 @@ * @param x X Coordinate of this map square within the model's grid * @param y Y Coordinate of this map square within the model's grid */ - MapSquare(final MapModel model, final int x, final int y) { + MapSquare(@NotNull final MapModel model, final int x, final int y) { this.model = model; this.x = x; this.y = y; @@ -61,30 +61,10 @@ * Get the MapModel. * @return MapModel */ - public MapModel getModel() { + @NotNull public MapModel getModel() { return model; } - /** - * {@inheritDoc} - * @todo This perhaps is the place to care about addition of multi-tile arches as well - */ - @Override protected void add(final ArchObject prev, final ArchObject arch, final ArchObject next) { -// // Pseudo-Code for adding a multihead at this place -// MultiHeadInfo info = getMultiHeadInfo(arch); -// if (!model.isValid(x + info.getX(), y + info.getY())) { -// return; -// } - super.add(prev, arch, next); - arch.setMapX(this.x); - arch.setMapY(this.y); -// // Pseudo-Code for adding a multihead at this place (continued) -// for (MultiHeadTileInfo tile : info) { -// MapSquare square = model.getMapSquare(x + tile.getX(), y + tile.getY()); -// square.super.add(square.getLast(), tile.createArch(arch), null); -// } - } - /** {@inheritDoc} */ @Override public final int getMapX() { return x; @@ -96,7 +76,7 @@ } /** {@inheritDoc} */ - @Override public final MapSquare getMapSquare() { + @Override @NotNull public final MapSquare getMapSquare() { return this; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 12:23:05
|
Revision: 281 Author: christianhujer Date: 2006-08-27 05:22:46 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=281&view=rev Log Message: ----------- Unified and cleaned I/O handling. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CFileInputStream.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/MultiPositionData.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-08-27 12:22:46 UTC (rev 281) @@ -320,7 +320,6 @@ // This was a directory -> nothing to parse return; } - CFileReader reader = null; try { final String baseDir; @@ -329,39 +328,37 @@ } else { baseDir = CMainControl.getInstance().getArchDefaultFolder(); } - reader = new CFileReader(baseDir, fname); + final CFileReader reader = new CFileReader(baseDir, fname); // read the whole file line by line - for (String rawLine; (rawLine = reader.readLine()) != null;) { - final String line = rawLine.trim(); - if (line.length() > 0 && !line.startsWith("#")) { - TreasureTreeNode node = null; - // reading outside of treasurelist - final int i; - if (line.startsWith("treasure") && (i = line.indexOf(" ")) != -1) { - // start of a new treasure section - node = new TreasureTreeNode(line.substring(i).trim(), - line.startsWith("treasureone") ? TreasureObj.TREASUREONE_LIST : TreasureObj.TREASURE_LIST); - tmpList.add(node); // put this node to tmplist vector - treasureTable.put(node.getTreasureObj().getName(), node); // put it into hashtable - tListCount++; + try { + for (String rawLine; (rawLine = reader.readLine()) != null;) { + final String line = rawLine.trim(); + if (line.length() > 0 && !line.startsWith("#")) { + TreasureTreeNode node = null; + // reading outside of treasurelist + final int i; + if (line.startsWith("treasure") && (i = line.indexOf(" ")) != -1) { + // start of a new treasure section + node = new TreasureTreeNode(line.substring(i).trim(), + line.startsWith("treasureone") ? TreasureObj.TREASUREONE_LIST : TreasureObj.TREASURE_LIST); + tmpList.add(node); // put this node to tmplist vector + treasureTable.put(node.getTreasureObj().getName(), node); // put it into hashtable + tListCount++; - // read this treasurelist till the very end - readInsideList(node, reader, needLink); - } else { - errorLog.append("After treasurelist ").append(node.getTreasureObj().getName()).append(": unexpected line:\n\"").append(line).append("\"\n"); + // read this treasurelist till the very end + readInsideList(node, reader, needLink); + } else { + errorLog.append("After treasurelist ").append(node.getTreasureObj().getName()).append(": unexpected line:\n\"").append(line).append("\"\n"); + } } } + } finally { + reader.close(); } } catch (final FileNotFoundException e) { // FIXME: Either do something or DOCUMENT NOT TO DO SOMETHING! } catch (final IOException e) { // FIXME: Either do something or DOCUMENT NOT TO DO SOMETHING! - } finally { - try { - reader.close(); - } catch (final Exception e) { /* ignore */ } finally { - reader = null; - } } } Modified: trunk/daimonin/src/daieditor/CFileInputStream.java =================================================================== --- trunk/daimonin/src/daieditor/CFileInputStream.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/CFileInputStream.java 2006-08-27 12:22:46 UTC (rev 281) @@ -30,6 +30,10 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; +import java.net.URISyntaxException; +import java.net.MalformedURLException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Class for opening and reading a buffered stream to a BINARY resource-file. @@ -69,7 +73,7 @@ * @return Stream for reading from <var>fname</var> * @throws FileNotFoundException In case all three tries to open the file failed */ - private static InputStream createStream(final String dname, final String fname) throws FileNotFoundException { + @NotNull private static InputStream createStream(final String dname, final String fname) throws FileNotFoundException { try { // 1st try normal binary file relative to specified directory return new FileInputStream(new File(dname, fname)); } catch (final FileNotFoundException e) { @@ -78,8 +82,24 @@ return new FileInputStream(fname); } catch (final FileNotFoundException ex) { // 3rd try via system resource from class loader System.err.println(ex); - final InputStream stream = ClassLoader.getSystemResourceAsStream(fname); + @Nullable InputStream stream = null; + try { + ClassLoader.getSystemResourceAsStream(new File(fname).toURL().toURI().toString()); + } catch (final URISyntaxException e1) { + /* ignore */ + } catch (final MalformedURLException e1) { + /* ignore */ + } if (stream == null) { + try { + stream = ClassLoader.getSystemResourceAsStream(new File(dname, fname).toURL().toURI().toString()); + } catch (final URISyntaxException e1) { + /* ignore */ + } catch (final MalformedURLException e1) { + /* ignore */ + } + } + if (stream == null) { System.err.println("File \"" + fname + "\" was not found!"); throw new FileNotFoundException("File \"" + fname + "\" was not found!"); } Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-27 12:22:46 UTC (rev 281) @@ -72,10 +72,8 @@ */ public synchronized List<ArchObject> decodeMapFile(final File file, final String mapDir) throws FileNotFoundException, IOException { - BufferedReader myInput = null; + final BufferedReader myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); try { - myInput = new BufferedReader(new InputStreamReader(new FileInputStream(file), CMainControl.MAP_ENCODING)); - maxxlen = 0; maxylen = 0; objects = new ArrayList<ArchObject>(); @@ -101,11 +99,7 @@ readArch(myInput, thisLine, null); // all these are map arches } } finally { - try { - myInput.close(); - } catch (final Exception e) { /* ignore */ } finally { - myInput = null; - } + myInput.close(); } // finally... here we go Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-27 12:22:46 UTC (rev 281) @@ -86,8 +86,8 @@ } // x - for (MapSquare square : mapModel) { - for (ArchObject node : square) { + for (final MapSquare square : mapModel) { + for (final ArchObject node : square) { // search only for heads! if (node.getMultiRefCount() > 0 && node.getMapMultiHead() == null) { System.out.println(node.getArchName()); @@ -109,13 +109,9 @@ } // node } // y } // x - writer.close(); } finally { - try { - writer.close(); - } catch (final Exception e) { /* ignore */ } finally { - writer = null; - } + writer.close(); + writer = null; } } Modified: trunk/daimonin/src/daieditor/MultiPositionData.java =================================================================== --- trunk/daimonin/src/daieditor/MultiPositionData.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/MultiPositionData.java 2006-08-27 12:22:46 UTC (rev 281) @@ -71,70 +71,66 @@ * the file don't match expected array dimensions. */ private void load() { - CFileReader reader = null; - // read datafile line by line, parsing numbers into the array try { - reader = new CFileReader(CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR, IGUIConstants.ARCHDEF_FILE); - final Dimension d = new Dimension(); - final Point p = new Point(); - int yp = 0; // y-index in the data array + final CFileReader reader = new CFileReader(CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR, IGUIConstants.ARCHDEF_FILE); + try { + final Dimension d = new Dimension(); + final Point p = new Point(); + int yp = 0; // y-index in the data array - // read the whole file line by line - for (String line; (line = reader.readLine()) != null;) { - line = line.trim(); - if (line.length() > 0 && !line.startsWith("#") && yp < Y_DIM) { - final String[] numbers = line.split(" "); - if (numbers.length == 2) { - try { - // parse and store it as integer - d.width = Integer.parseInt(numbers[0]); - d.height = Integer.parseInt(numbers[1]); - } catch (final NumberFormatException e) { /* ignore */ } - } - final int sum = d.width + d.height; - // Set size or rectangle - if (sum != 0) { - data[yp][0] = sum * IGUIConstants.TILE_ISO_XLEN2; - data[yp][1] = sum * IGUIConstants.TILE_ISO_YLEN2 - 1; - } else { - data[yp][0] = 0; - data[yp][1] = 0; - } - int index = 2; - for (p.y = 0; p.y < d.height; p.y++) { - for (p.x = 0; p.x < d.width; p.x++) { - data[yp][index++] = (p.x + d.height - p.y - 1) * IGUIConstants.TILE_ISO_XLEN2; - data[yp][index++] = (p.x + p.y) * IGUIConstants.TILE_ISO_YLEN2; + // read the whole file line by line + for (String line; (line = reader.readLine()) != null;) { + line = line.trim(); + if (line.length() > 0 && !line.startsWith("#") && yp < Y_DIM) { + final String[] numbers = line.split(" "); + if (numbers.length == 2) { + try { + // parse and store it as integer + d.width = Integer.parseInt(numbers[0]); + d.height = Integer.parseInt(numbers[1]); + } catch (final NumberFormatException e) { /* ignore */ } } + final int sum = d.width + d.height; + // Set size or rectangle + if (sum != 0) { + data[yp][0] = sum * IGUIConstants.TILE_ISO_XLEN2; + data[yp][1] = sum * IGUIConstants.TILE_ISO_YLEN2 - 1; + } else { + data[yp][0] = 0; + data[yp][1] = 0; + } + int index = 2; + for (p.y = 0; p.y < d.height; p.y++) { + for (p.x = 0; p.x < d.width; p.x++) { + data[yp][index++] = (p.x + d.height - p.y - 1) * IGUIConstants.TILE_ISO_XLEN2; + data[yp][index++] = (p.x + p.y) * IGUIConstants.TILE_ISO_YLEN2; + } + } + // Fill rest of row with 0 + while (index < X_DIM) { + data[yp][index++] = 0; + } + yp++; } - // Fill rest of row with 0 - while (index < X_DIM) { - data[yp][index++] = 0; - } - yp++; } - } - // report if there haven't been enough rows in the file - if (yp < Y_DIM) { - log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (Y_DIM - yp) + " entire rows of data."); - } + // report if there haven't been enough rows in the file + if (yp < Y_DIM) { + log.warn("In file " + IGUIConstants.ARCHDEF_FILE + ": Missing " + (Y_DIM - yp) + " entire rows of data."); + } - // confirm load process - if (log.isInfoEnabled()) { - log.info("Loaded multipart position data from '" + IGUIConstants.ARCHDEF_FILE + "'"); + // confirm load process + if (log.isInfoEnabled()) { + log.info("Loaded multipart position data from '" + IGUIConstants.ARCHDEF_FILE + "'"); + } + } finally { + reader.close(); } } catch (final FileNotFoundException e) { // FIXME either do something or DOCUMENT TO IGNORE ME } catch (final IOException e) { // FIXME either do something or DOCUMENT TO IGNORE ME - } finally { - try { - reader.close(); - } catch (final Exception e) { /* ignore */ } finally { - reader = null; - } } } @@ -169,4 +165,5 @@ } return 0; } -} + +} // class MultiPositionData Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-08-27 12:22:46 UTC (rev 281) @@ -303,21 +303,21 @@ /** {@inheritDoc} */ public void run() { try { - final byte[] buf = new byte[4096]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1;) { - appender.append(new String(buf, 0, bytesRead)); + try { + final byte[] buf = new byte[4096]; + for (int bytesRead; (bytesRead = in.read(buf)) != -1;) { + appender.append(new String(buf, 0, bytesRead)); + } + //for (String line; (line = in.readLine()) != null;) { + // appender.append(title, line, "\n"); + //} + } finally { + in.close(); } - //for (String line; (line = in.readLine()) != null;) { - // appender.append(title, line, "\n"); - //} } catch (final IOException e) { appender.append(title, ": ", e.toString()); } finally { - try { - in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; - } + in = null; } } @@ -330,8 +330,8 @@ System.err.println("Trying to stop previous stream."); try { in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; + } catch (final Exception e) { + /* ignore */ } System.err.println("Stopped previous stream."); } Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/Spells.java 2006-08-27 12:22:46 UTC (rev 281) @@ -105,20 +105,22 @@ private static int importSpells(final File spellfile) { final Map<String, String> spells = new HashMap<String, String>(); if ("spellist.h".equalsIgnoreCase(spellfile.getName())) { - BufferedReader in = null; try { - in = new BufferedReader(new FileReader(spellfile.getAbsolutePath())); + final BufferedReader in = new BufferedReader(new FileReader(spellfile.getAbsolutePath())); + try { + CFileReader.readUntil(in, "spell spells", null); + CFileReader.readUntil(in, "{", null); - CFileReader.readUntil(in, "spell spells", null); - CFileReader.readUntil(in, "{", null); + for (int counter = 0; true; counter++) { // XXX this is ugly! + CFileReader.readUntil(in, "{", "}"); + CFileReader.readUntil(in, "\"", null); + final String name = CFileReader.readUntil(in, "\"").trim(); + CFileReader.readUntil(in, "}", null); - for (int counter = 0; true; counter++) { // XXX this is ugly! - CFileReader.readUntil(in, "{", "}"); - CFileReader.readUntil(in, "\"", null); - final String name = CFileReader.readUntil(in, "\"").trim(); - CFileReader.readUntil(in, "}", null); - - spells.put(name, Integer.toString(counter)); + spells.put(name, Integer.toString(counter)); + } + } finally { + in.close(); } } catch (final FileNotFoundException e) { System.err.println("File '" + spellfile.getAbsolutePath() + "' not found!"); @@ -126,12 +128,6 @@ // Eventually expected exception, don't handle. } catch (final IOException e) { System.err.println("Cannot read file '" + spellfile.getAbsolutePath() + "'!"); - } finally { - try { - in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; - } } } @@ -139,55 +135,51 @@ if (spells.size() > 0) { // FIXME: This should use DOM for writing the file. File dfile = null; - PrintWriter out = null; - try { - // create new file for writing (replaces old one if existent) - if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { - final String baseDir = CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR; + // create new file for writing (replaces old one if existent) + if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { + final String baseDir = CMainControl.getInstance().getArchDefaultFolder() + File.separator + IGUIConstants.CONFIG_DIR; - File dir = new File(baseDir); - if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! - // create the config dir - dir = new File("resource"); - dir.mkdir(); - dir = new File(IGUIConstants.CONFIG_DIR); - dir.mkdir(); - } - dfile = new File(baseDir + File.separator + IGUIConstants.SPELL_FILE); - } else { - dfile = new File(IGUIConstants.SPELL_FILE); + File dir = new File(baseDir); + if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! + // create the config dir + dir = new File("resource"); + dir.mkdir(); + dir = new File(IGUIConstants.CONFIG_DIR); + dir.mkdir(); } + dfile = new File(baseDir + File.separator + IGUIConstants.SPELL_FILE); + } else { + dfile = new File(IGUIConstants.SPELL_FILE); + } - out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(dfile), "utf-8")); + try { + final PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(dfile), "utf-8")); + try { + // header: + out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); + out.println("<!DOCTYPE spells SYSTEM \"spells.dtd\">"); + out.println("<!--"); + out.println(" - ##########################################################"); + out.println(" - # You may add new spells to this file, but there's no #"); + out.println(" - # need to do it because the file can be autogenerated. #"); + out.println(" - # In the editor, select menu \"Resources->Collect Spells\" #"); + out.println(" - # to generate a new version of this file. #"); + out.println(" - ##########################################################"); + out.println(" -->"); + out.println("<!-- Generated on: " + new Date() + " -->"); + out.println("<spells>"); - // header: - out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); - out.println("<!DOCTYPE spells SYSTEM \"spells.dtd\">"); - out.println("<!--"); - out.println(" - ##########################################################"); - out.println(" - # You may add new spells to this file, but there's no #"); - out.println(" - # need to do it because the file can be autogenerated. #"); - out.println(" - # In the editor, select menu \"Resources->Collect Spells\" #"); - out.println(" - # to generate a new version of this file. #"); - out.println(" - ##########################################################"); - out.println(" -->"); - out.println("<!-- Generated on: " + new Date() + " -->"); - out.println("<spells>"); - - final String[] spaces = {" ", " ", ""}; - for (final String name : new TreeSet<String>(spells.keySet())) { - final String id = spells.get(name); - out.println(" <spell id=\"" + id + '\"' + spaces[id.length() - 1] + " name=\"" + name + "\" />"); + final String[] spaces = {" ", " ", ""}; + for (final String name : new TreeSet<String>(spells.keySet())) { + final String id = spells.get(name); + out.println(" <spell id=\"" + id + '\"' + spaces[id.length() - 1] + " name=\"" + name + "\" />"); + } + out.println("</spells>"); + } finally { + out.close(); } - out.println("</spells>"); } catch (final IOException e) { System.err.println("Cannot write file '" + dfile.getAbsolutePath() + "'!"); - } finally { - try { - out.close(); - } catch (final Exception e) { /* ignore */ } finally { - out = null; - } } } return spells.size(); Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/Updater.java 2006-08-27 12:22:46 UTC (rev 281) @@ -132,10 +132,9 @@ /** {@inheritDoc} */ public void run() { try { - InputStream pin = null; + final String propUrl = ACTION_FACTORY.getString("update.url"); + final InputStream pin = openStream(propUrl); try { - final String propUrl = ACTION_FACTORY.getString("update.url"); - pin = openStream(propUrl); final ResourceBundle updateBundle = new PropertyResourceBundle(pin); final String downloadUrl = updateBundle.getString("update.url"); final VersionInfo update = new VersionInfo(updateBundle, "update"); @@ -153,18 +152,14 @@ } else { noNewUpdate(active, update, propUrl, downloadUrl); } - } catch (final UnknownHostException e) { - ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e.getLocalizedMessage()); - } catch (final Exception e) { - LOGGER.log(Level.WARNING, "updateError", e); - ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e); } finally { - try { - pin.close(); - } catch (final Exception e) { /* ignore */ } finally { - pin = null; - } + pin.close(); } + } catch (final UnknownHostException e) { + ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e.getLocalizedMessage()); + } catch (final Exception e) { + LOGGER.log(Level.WARNING, "updateError", e); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e); } finally { if (parentComponent != null) { parentComponent.setEnabled(true); @@ -211,44 +206,39 @@ * @param url URL to get update from */ private void downloadAndInstallUpdate(final String url) { - InputStream in = null; - OutputStream out = null; + final File download = new File("DaimoninEditor.jar.tmp"); // TODO: print error message if file already exists + final File backup = new File("DaimoninEditor.jar.bak"); + final File orig = new File("DaimoninEditor.jar"); try { - final File download = new File("DaimoninEditor.jar.tmp"); // TODO: print error message if file already exists - final File backup = new File("DaimoninEditor.jar.bak"); - final File orig = new File("DaimoninEditor.jar"); - in = openStream(url); - out = new FileOutputStream(download); - final byte[] buf = new byte[BUF_SIZE]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1; out.write(buf, 0, bytesRead)) { - ; + final InputStream in = openStream(url); + try { + final OutputStream out = new FileOutputStream(download); + try { + final byte[] buf = new byte[BUF_SIZE]; + for (int bytesRead; (bytesRead = in.read(buf)) != -1; out.write(buf, 0, bytesRead)) { + ; + } + out.close(); + if (/* !backup.delete() || */ !orig.renameTo(backup)) { + ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoBackup"); + } else if (!download.renameTo(orig)) { + backup.renameTo(orig); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoDownload"); + } else { + ACTION_FACTORY.showMessageDialog(parentComponent, "updateRestart"); + CMainControl.getInstance().doExit(); + } + } finally { + out.close(); + } + } finally { + in.close(); } - out.close(); - if (/* !backup.delete() || */ !orig.renameTo(backup)) { - ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoBackup"); - } else if (!download.renameTo(orig)) { - backup.renameTo(orig); - ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoDownload"); - } else { - ACTION_FACTORY.showMessageDialog(parentComponent, "updateRestart"); - CMainControl.getInstance().doExit(); - } } catch (final InterruptedIOException e) { ACTION_FACTORY.showMessageDialog(parentComponent, "updateAborted"); } catch (final Exception e) { LOGGER.log(Level.WARNING, "updateError", e); ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e); - } finally { - try { - in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; - } - try { - out.close(); - } catch (final Exception e) { /* ignore */ } finally { - out = null; - } } } Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-27 11:50:58 UTC (rev 280) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-27 12:22:46 UTC (rev 281) @@ -75,25 +75,22 @@ */ public void parseDefArch(final String fname, final int index) { //Open the file for reading - BufferedReader myInput = null; try { - myInput = new BufferedReader(new FileReader(fname)); - // do the actual parsing - parseDefArchFromStream(myInput, index, fname); + final BufferedReader myInput = new BufferedReader(new FileReader(fname)); + try { + // do the actual parsing + parseDefArchFromStream(myInput, index, fname); + } finally { + myInput.close(); + } } catch (final FileNotFoundException e) { logger.log(Level.WARNING, "archfileNotFound", fname); - } finally { - if (myInput != null) { - try { - myInput.close(); - } catch (final Exception e) { /* ignore */ } finally { - myInput = null; - } - } + } catch (final IOException e) { + // TODO } } - public void parseDefArchFromStream(final BufferedReader myInput, final int index, final String fname) { + public void parseDefArchFromStream(final BufferedReader myInput, final int index, final String fname) throws IOException { parseDefArchFromStream(myInput, null, null, null, index, fname); } @@ -106,307 +103,303 @@ * @param archName arch-object name (only for artifacts) * @param index current index on the ArchPanel * @return TODO + * @throws IOException in case of I/O problems */ @Nullable @SuppressWarnings({"StringContatenationInLoop", "ObjectAllocationInLoop"}) - public ArchObject parseDefArchFromStream(final BufferedReader myInput, @Nullable final ArchObject defArch, @Nullable final String line, @Nullable final String archName, /* TODO: final*/ int index, final String fname) { - try { - - // start with new clean ArchObject instance - ArchObject arch; - ArchObject archlast = null; - if (defArch == null) { - arch = new ArchObject(); + public ArchObject parseDefArchFromStream(final BufferedReader myInput, @Nullable final ArchObject defArch, @Nullable final String line, @Nullable final String archName, /* TODO: final*/ int index, final String fname) throws IOException { + // start with new clean ArchObject instance + ArchObject arch; + ArchObject archlast = null; + if (defArch == null) { + arch = new ArchObject(); + } else { + arch = defArch.createClone(0, 0); + } + String newCat; + final boolean isInternPath; + // path is needed when we don't read from collection because there is no editor_folder in arc files + final String path; + if (!ArchObjectStack.isLoadedFromArchive() && archName == null) { + String tmpPath = (new File(PathManager.getArchPath(fname))).getParent().replace('\\', '/'); + if (tmpPath == null) { + tmpPath = "/"; + newCat = "no category"; } else { - arch = defArch.createClone(0, 0); + newCat = tmpPath.substring(tmpPath.indexOf("/") + 1); + tmpPath = tmpPath.concat("/"); } - String newCat; - final boolean isInternPath; - // path is needed when we don't read from collection because there is no editor_folder in arc files - final String path; - if (!ArchObjectStack.isLoadedFromArchive() && archName == null) { - String tmpPath = (new File(PathManager.getArchPath(fname))).getParent().replace('\\', '/'); - if (tmpPath == null) { - tmpPath = "/"; - newCat = "no category"; - } else { - newCat = tmpPath.substring(tmpPath.indexOf("/") + 1); - tmpPath = tmpPath.concat("/"); - } - isInternPath = tmpPath.contains("/intern/"); - path = tmpPath; - } else { - isInternPath = false; - path = null; - newCat = null; - } - arch.resetArchText(); + isInternPath = tmpPath.contains("/intern/"); + path = tmpPath; + } else { + isInternPath = false; + path = null; + newCat = null; + } + arch.resetArchText(); - String thisLine2; - if (line == null) { + String thisLine2; + if (line == null) { + thisLine2 = myInput.readLine(); + } else { + thisLine2 = line; // pre read "Object" from artifacts file loader + } + boolean isNewCategory = true; + String oldCat = null; + String oldMainFolder = null; + String oldSubFolder = null; + ArchObject firstArch = null; + boolean archmore = false; + boolean parsearch = false; + boolean animflag = false; + boolean msgflag = false; + StringBuilder animText = null; + + while (thisLine2 != null) { + final String thisLine = thisLine2.trim(); + + if (!msgflag && thisLine.startsWith("#")) { + // skip comments (only outside msges) thisLine2 = myInput.readLine(); - } else { - thisLine2 = line; // pre read "Object" from artifacts file loader + continue; } - boolean isNewCategory = true; - String oldCat = null; - String oldMainFolder = null; - String oldSubFolder = null; - ArchObject firstArch = null; - boolean archmore = false; - boolean parsearch = false; - boolean animflag = false; - boolean msgflag = false; - StringBuilder animText = null; - while (thisLine2 != null) { - final String thisLine = thisLine2.trim(); + if (!parsearch) { + if (thisLine.startsWith("More")) { + if (firstArch == null) { + firstArch = archlast; + } + archmore = true; + } else if (thisLine.startsWith("Object")) { + if (arch == null) { + arch = new ArchObject(); + } - if (!msgflag && thisLine.startsWith("#")) { - // skip comments (only outside msges) - thisLine2 = myInput.readLine(); - continue; - } + parsearch = true; + if (archmore) { + // System.err.println("multi part object: part "+ archmore_count); + } else { + firstArch = null; + } - if (!parsearch) { - if (thisLine.startsWith("More")) { - if (firstArch == null) { - firstArch = archlast; + if (archName == null) { + arch.setArchName(thisLine.substring(7)); + } else { + arch.setArchName(archName); + } + } + } else { + if (msgflag) { + if (thisLine.startsWith("endmsg")) { + msgflag = false; + } else { + arch.addMsgText(thisLine2 + '\n'); // thisLine2 allows leading whitespaces + } + } else if (animflag) { + if (thisLine.startsWith("mina")) { + try { + mainControl.getAnimationObjects().addAnimPath(arch.getArchName(), path.concat(arch.getArchName())); + mainControl.getAnimationObjects().addAnimationObject(arch.getArchName(), animText.toString()); + } catch (final DuplicateAnimationException e) { + // TODO: Report to the user + logger.log(Level.WARNING, "duplicateAnimation", e); } - archmore = true; - } else if (thisLine.startsWith("Object")) { - if (arch == null) { - arch = new ArchObject(); - } - parsearch = true; - if (archmore) { - // System.err.println("multi part object: part "+ archmore_count); - } else { - firstArch = null; - } + arch.addArchText("animation " + arch.getArchName() + '\n'); + arch.setAnimName(arch.getArchName()); - if (archName == null) { - arch.setArchName(thisLine.substring(7)); - } else { - arch.setArchName(archName); - } + // here we must add this to AnimationObject + // and add Animation cmd here! + animflag = false; + } else { + animText.append(thisLine).append('\n'); } - } else { - if (msgflag) { - if (thisLine.startsWith("endmsg")) { - msgflag = false; - } else { - arch.addMsgText(thisLine2 + '\n'); // thisLine2 allows leading whitespaces - } - } else if (animflag) { - if (thisLine.startsWith("mina")) { - try { - mainControl.getAnimationObjects().addAnimPath(arch.getArchName(), path.concat(arch.getArchName())); - mainControl.getAnimationObjects().addAnimationObject(arch.getArchName(), animText.toString()); - } catch (final DuplicateAnimationException e) { - // TODO: Report to the user - logger.log(Level.WARNING, "duplicateAnimation", e); - } + } else if (thisLine.startsWith("Object")) { + logger.log(Level.WARNING, "inventoryInDefArch", thisLine); + } else if (thisLine.startsWith("end")) { + //if (arch.getArchTypNr() == 0) { + //System.err.println("Arch "+ arch.getArchName()+" has no type info!"); + //} + // we got full arch + parsearch = false; // we write this sucker - arch.addArchText("animation " + arch.getArchName() + '\n'); - arch.setAnimName(arch.getArchName()); + if (firstArch != null) { + // add to head our x/y position so he can setup refmax + firstArch.setRefMaxX(arch.getMultiRefX()); + firstArch.setRefMaxY(arch.getMultiRefY()); + firstArch.addTail(arch); + } else { + mainControl.incArchObjCount(); - // here we must add this to AnimationObject - // and add Animation cmd here! - animflag = false; - } else { - animText.append(thisLine).append('\n'); - } - } else if (thisLine.startsWith("Object")) { - logger.log(Level.WARNING, "inventoryInDefArch", thisLine); - } else if (thisLine.startsWith("end")) { - //if (arch.getArchTypNr() == 0) { - //System.err.println("Arch "+ arch.getArchName()+" has no type info!"); - //} - // we got full arch - parsearch = false; // we write this sucker - - if (firstArch != null) { - // add to head our x/y position so he can setup refmax - firstArch.setRefMaxX(arch.getMultiRefX()); - firstArch.setRefMaxY(arch.getMultiRefY()); - firstArch.addTail(arch); - } else { - mainControl.incArchObjCount(); - - // add arch to the archpanel - only if it is not the map arch and not in the intern folder - if (!isInternPath && !(newCat != null && newCat.contains("intern"))) { - if (!ArchObjectStack.isLoadedFromArchive() || archName != null) { - // loading from individual files, so we simply add it to list - // ArchObjectStack.loadArchFromFiles() takes care of the panels - mainControl.addArchPanelArch(arch.getArchName(), index); - } else { - // loading from collected files, so we need process panels here - // FIXME this sucks. This takes 50% of the time of collecting arches!!! - if (isNewCategory) { - final String mainFolder; - final String subFolder; - final int indOfSlash = newCat.indexOf("/"); - if (indOfSlash > 0) { - mainFolder = newCat.substring(0, indOfSlash); - // Do not use subsub folders - final String tmpSubFolder = newCat.substring(indOfSlash + 1); - final int indOfSubSlash = tmpSubFolder.indexOf("/"); - if (indOfSubSlash > 0) { - subFolder = tmpSubFolder.substring(0, indOfSubSlash); - } else { - subFolder = tmpSubFolder; - } + // add arch to the archpanel - only if it is not the map arch and not in the intern folder + if (!isInternPath && !(newCat != null && newCat.contains("intern"))) { + if (!ArchObjectStack.isLoadedFromArchive() || archName != null) { + // loading from individual files, so we simply add it to list + // ArchObjectStack.loadArchFromFiles() takes care of the panels + mainControl.addArchPanelArch(arch.getArchName(), index); + } else { + // loading from collected files, so we need process panels here + // FIXME this sucks. This takes 50% of the time of collecting arches!!! + if (isNewCategory) { + final String mainFolder; + final String subFolder; + final int indOfSlash = newCat.indexOf("/"); + if (indOfSlash > 0) { + mainFolder = newCat.substring(0, indOfSlash); + // Do not use subsub folders + final String tmpSubFolder = newCat.substring(indOfSlash + 1); + final int indOfSubSlash = tmpSubFolder.indexOf("/"); + if (indOfSubSlash > 0) { + subFolder = tmpSubFolder.substring(0, indOfSubSlash); } else { - mainFolder = newCat; - subFolder = mainFolder; + subFolder = tmpSubFolder; } + } else { + mainFolder = newCat; + subFolder = mainFolder; + } - if (!mainFolder.equals(oldMainFolder)) { - // an entire new panel must be opened - mainControl.addArchPanel(mainFolder); - mainControl.addArchPanelCombo("show all"); - mainControl.addArchPanelCombo(mainFolder); - index = 1; - oldMainFolder = mainFolder; - oldSubFolder = null; - } + if (!mainFolder.equals(oldMainFolder)) { + // an entire new panel must be opened + mainControl.addArchPanel(mainFolder); + mainControl.addArchPanelCombo("show all"); + mainControl.addArchPanelCombo(mainFolder); + index = 1; + oldMainFolder = mainFolder; + oldSubFolder = null; + } - if (mainFolder.equals(subFolder)) { - index = 1; // add to the base folder - } else if (!subFolder.equals(oldSubFolder)) { - // a new JComboBox must be added - index = mainControl.addArchPanelCombo(subFolder); - oldSubFolder = subFolder; - } - - isNewCategory = false; - oldCat = newCat; + if (mainFolder.equals(subFolder)) { + index = 1; // add to the base folder + } else if (!subFolder.equals(oldSubFolder)) { + // a new JComboBox must be added + index = mainControl.addArchPanelCombo(subFolder); + oldSubFolder = subFolder; } - mainControl.addArchPanelArch(arch.getArchName(), index); + + isNewCategory = false; + oldCat = newCat; } + mainControl.addArchPanelArch(arch.getArchName(), index); } } - postParseDefArch(arch); - arch.setDefaultArch(); - arch.setEditorFolder(newCat); - mainControl.addArchToList(arch); + } + postParseDefArch(arch); + arch.setDefaultArch(); + arch.setEditorFolder(newCat); + mainControl.addArchToList(arch); - if (archmore) { - calcLowestMulti(arch); - } - archmore = false; // we assume this is last... but perhaps.. + if (archmore) { + calcLowestMulti(arch); + } + archmore = false; // we assume this is last... but perhaps.. - // if this arch was from Artifacts file - return here: - if (archName != null) { - arch.setArtifact(true); - // here we add all unchanged arch text lines from defArch back to arch - if (defArch != null) { - arch.addArchText(arch.diffArchText(defArch.getArchText(), true)); - } - return arch; + // if this arch was from Artifacts file - return here: + if (archName != null) { + arch.setArtifact(true); + // here we add all unchanged arch text lines from defArch back to arch + if (defArch != null) { + arch.addArchText(arch.diffArchText(defArch.getArchText(), true)); } - archlast = arch; - arch = null; - } else { - if (thisLine.startsWith("msg")) { - msgflag = true; - } else if (thisLine.startsWith("animation ")) { + return arch; + } + archlast = arch; + arch = null; + } else { + if (thisLine.startsWith("msg")) { + msgflag = true; + } else if (thisLine.startsWith("animation ")) { + arch.addArchText(thisLine + '\n'); + final String animName = thisLine.substring(10).trim(); + arch.setAnimName(animName); + //arch.setAnimNr(mainControl.animationObjects.findAnimObject(animName)); // probably not needed, but better not delete it yet + } else if (thisLine.startsWith("anim_speed ")) { + arch.addArchText(thisLine + '\n'); + } else if (thisLine.startsWith("anim")) { + animflag = true; + animText = new StringBuilder(); + } else if (thisLine.startsWith("visibility ")) { + // System.err.println("Remove visibility: "+arch.getArchName()); + } else if (thisLine.startsWith("magicmap ")) { + // System.err.println("Remove magicmap: "+arch.getArchName()); + } else if (thisLine.startsWith("color_fg ")) { + // System.err.println("Remove color_fg: "+arch.getArchName()); + } else if (thisLine.startsWith("color_bg ")) { + // System.err.println("Remove color_bg: "+arch.getArchName()); + } else if (thisLine.startsWith("x ")) { + if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { + logger.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"x", arch.getArchName()}); arch.addArchText(thisLine + '\n'); - final String animName = thisLine.substring(10).trim(); - arch.setAnimName(animName); - //arch.setAnimNr(mainControl.animationObjects.findAnimObject(animName)); // probably not needed, but better not delete it yet - } else if (thisLine.startsWith("anim_speed ")) { + } + arch.setRefX(Integer.parseInt(thisLine.substring(2))); + } else if (thisLine.startsWith("y ")) { + if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { + logger.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"y", arch.getArchName()}); arch.addArchText(thisLine + '\n'); - } else if (thisLine.startsWith("anim")) { - animflag = true; - animText = new StringBuilder(); - } else if (thisLine.startsWith("visibility ")) { - // System.err.println("Remove visibility: "+arch.getArchName()); - } else if (thisLine.startsWith("magicmap ")) { - // System.err.println("Remove magicmap: "+arch.getArchName()); - } else if (thisLine.startsWith("color_fg ")) { - // System.err.println("Remove color_fg: "+arch.getArchName()); - } else if (thisLine.startsWith("color_bg ")) { - // System.err.println("Remove color_bg: "+arch.getArchName()); - } else if (thisLine.startsWith("x ")) { - if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - logger.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"x", arch.getArchName()}); - arch.addArchText(thisLine + '\n'); + } + arch.setRefY(Integer.parseInt(thisLine.substring(2))); + } else if (thisLine.startsWith("type ")) { + try { + final int i = Integer.parseInt(thisLine.substring(5)); + arch.setArchTypNr(i); + if (i == 0) { + logger.log(Level.WARNING, "defArchWithZeroType", arch.getArchName()); } - arch.setRefX(Integer.parseInt(thisLine.substring(2))); - } else if (thisLine.startsWith("y ")) { - if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - logger.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"y", arch.getArchName()}); - arch.addArchText(thisLine + '\n'); - } - arch.setRefY(Integer.parseInt(thisLine.substring(2))); - } else if (thisLine.startsWith("type ")) { - try { - final int i = Integer.parseInt(thisLine.substring(5)); - arch.setArchTypNr(i); - if (i == 0) { - logger.log(Level.WARNING, "defArchWithZeroType", arch.getArchName()); - } - } catch (final NumberFormatException e) { - logger.log(Level.WARNING, "defArchWithInvalidTypeNr", new Object[]{arch.getArchName(), thisLine.substring(5)}); - arch.addArchText(thisLine + '\n'); - } - } else if (thisLine.startsWith("direction ")) { - try { - arch.setDirection(Integer.parseInt(thisLine.substring(10))); - } catch (final NumberFormatException e) { - logger.log(Level.WARNING, "defArchWithInvalidDirection", new Object[]{arch.getArchName(), thisLine.substring(10)}); - } + } catch (final NumberFormatException e) { + logger.log(Level.WARNING, "defArchWithInvalidTypeNr", new Object[]{arch.getArchName(), thisLine.substring(5)}); arch.addArchText(thisLine + '\n'); - } else if (thisLine.startsWith("face "))... [truncated message content] |
From: <chr...@us...> - 2006-08-27 11:51:05
|
Revision: 280 Author: christianhujer Date: 2006-08-27 04:50:58 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=280&view=rev Log Message: ----------- Added TODO. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/ConnectionView.java Modified: trunk/daimonin/src/daieditor/gui/ConnectionView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ConnectionView.java 2006-08-27 11:49:33 UTC (rev 279) +++ trunk/daimonin/src/daieditor/gui/ConnectionView.java 2006-08-27 11:50:58 UTC (rev 280) @@ -42,6 +42,7 @@ * @todo more user interface features * @todo make this a MapHighlightModel * @todo better react on changes, don't always scan the whole map + * @todo attach * @serial exclude */ public final class ConnectionView extends JPanel implements MapModelListener { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 11:49:39
|
Revision: 279 Author: christianhujer Date: 2006-08-27 04:49:33 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=279&view=rev Log Message: ----------- Added TODO. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java Modified: trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-08-27 10:53:31 UTC (rev 278) +++ trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-08-27 11:49:33 UTC (rev 279) @@ -207,7 +207,9 @@ return fileField; } - /** Class for selecting a file. */ + /** Class for selecting a file. + * @todo replace with JFileField from JAPI + */ private static class FileField extends JComponent { /** The label. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 10:53:36
|
Revision: 278 Author: christianhujer Date: 2006-08-27 03:53:31 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=278&view=rev Log Message: ----------- Minor documentation improvements. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObject.java Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-27 10:42:20 UTC (rev 277) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-27 10:53:31 UTC (rev 278) @@ -49,7 +49,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo the archobject should be directly asked for a face, and eventually it - * should cache faces itself ; that would speed up painting maps + * should cache faces itself; that would speed up painting maps * @todo this class maybe could be split into 3 classes: AbstractArchObject as * abstract base class, DefArchObject for default arches and ArchObject for * normal arches. @@ -238,9 +238,9 @@ * determined by the various attributes of the arch (->archText). * @param checkType bitmask containing the edit type(s) to be calculated * @return new editType for this arch - * @todo use arch object matchers, eventually deprecated this method and remove it + * @deprecated use arch object matchers, this method will be removed */ - public int calculateEditType(final int checkType) { + @Deprecated public int calculateEditType(final int checkType) { // ATTENTION! BE VERY CAREFUL WHEN YOU TRY TO UNIFY MORE OF THIS WITH CROSSFIRE! /* if one of the types in checkType already is in editType, // we exclude that one This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 10:42:25
|
Revision: 277 Author: christianhujer Date: 2006-08-27 03:42:20 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=277&view=rev Log Message: ----------- Improved documentation. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java Modified: trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java 2006-08-27 10:40:22 UTC (rev 276) +++ trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java 2006-08-27 10:42:20 UTC (rev 277) @@ -24,7 +24,8 @@ import daieditor.arch.ArchObject; /** - * TODO + * An AttribArchObjectMatcher is an ArchObjectMatcher that matches an attribute value. + * @todo care about int comparison * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class AttribArchObjectMatcher implements ArchObjectMatcher { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 10:40:27
|
Revision: 276 Author: christianhujer Date: 2006-08-27 03:40:22 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=276&view=rev Log Message: ----------- Improved I/O handling. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/face/FaceObjects.java Modified: trunk/daimonin/src/daieditor/arch/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceObjects.java 2006-08-27 10:37:03 UTC (rev 275) +++ trunk/daimonin/src/daieditor/arch/face/FaceObjects.java 2006-08-27 10:40:22 UTC (rev 276) @@ -86,12 +86,11 @@ */ public void loadFacesCollection(final File faceFile, final File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { FaceFacade.setNormal(new DaimoninFaceProvider(faceFile)); - FileInputStream in = null; final String actualFilename = faceFile.toString(); byte[] data; + // open a bytestream to the resource file + final FileInputStream in = new FileInputStream(faceFile); try { - // open a bytestream to the resource file - in = new FileInputStream(faceFile); final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) faceFile.length()); final byte[] buf = new byte[1 << 12]; for (int r; (r = in.read(buf)) != -1;) { @@ -99,12 +98,10 @@ } data = bufOut.toByteArray(); } finally { - try { - in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; - } + in.close(); } + + // Note: treeIn might stay null, this is optional data. BufferedReader treeIn = null; try { treeIn = new BufferedReader(new InputStreamReader(new FileInputStream(treeFile), "us-ascii")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 10:37:10
|
Revision: 275 Author: christianhujer Date: 2006-08-27 03:37:03 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=275&view=rev Log Message: ----------- Added TODO to FaceObject because of its (Non-)Serializability. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/face/FaceObject.java Modified: trunk/daimonin/src/daieditor/arch/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-27 10:34:48 UTC (rev 274) +++ trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-27 10:37:03 UTC (rev 275) @@ -36,6 +36,8 @@ * <li>File size</li> * </ul> * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> + * @todo this class should be Serializable because it's used as an Exception field. + * @todo think how this class could be serialized because size, offset etc. are not serializable. */ public class FaceObject extends NamedObject { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-27 10:34:53
|
Revision: 274 Author: christianhujer Date: 2006-08-27 03:34:48 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=274&view=rev Log Message: ----------- Made AnimationObject Serializable because it's used in an exception. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java Modified: trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-08-26 23:33:17 UTC (rev 273) +++ trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-08-27 10:34:48 UTC (rev 274) @@ -30,6 +30,7 @@ import daieditor.arch.face.FaceFacade; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.swing.ImageIcon; /** @@ -39,8 +40,11 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class AnimationObject extends NamedObject { +public final class AnimationObject extends NamedObject implements Serializable { + /** Serial Version. */ + private static final long serialVersionUID = 1L; + /** The name of this animation. */ private final String animName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-26 23:33:25
|
Revision: 273 Author: christianhujer Date: 2006-08-26 16:33:17 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=273&view=rev Log Message: ----------- Improved I/O handling. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/AboutDialog.java Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-08-26 23:28:35 UTC (rev 272) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-08-26 23:33:17 UTC (rev 273) @@ -94,26 +94,23 @@ * @return component for XY license tab */ private JComponent buildLicenseSubTab(final String number) { - Reader in = null; String licenseText; try { - final StringBuilder sb = new StringBuilder(); - in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("license." + number + ".file")).openStream())); - final char[] buf = new char[4096]; - for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { - ; - } - licenseText = sb.toString(); - } catch (final IOException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } catch (final NullPointerException e) { - licenseText = ACTION_FACTORY.getString("license.missing"); - } finally { + final Reader in = new InputStreamReader(new BufferedInputStream(getClass().getClassLoader().getResource(ACTION_FACTORY.getString("license." + number + ".file")).openStream())); try { + final StringBuilder sb = new StringBuilder(); + final char[] buf = new char[4096]; + for (int bytesRead; (bytesRead = in.read(buf)) != -1; sb.append(buf, 0, bytesRead)) { + ; + } + licenseText = sb.toString(); + } finally { in.close(); - } catch (final Exception e) { /* ignore */ } finally { - in = null; } + } catch (final NullPointerException e) { + licenseText = ACTION_FACTORY.getString("license.missing"); + } catch (final IOException e) { + licenseText = ACTION_FACTORY.getString("license.missing"); } final JTextArea license = new JTextArea(licenseText, 16, 80); license.setLineWrap(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-26 23:28:44
|
Revision: 272 Author: christianhujer Date: 2006-08-26 16:28:35 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=272&view=rev Log Message: ----------- Annotated Action methods as @ActionMethod. Modified Paths: -------------- trunk/daimonin/src/daieditor/CPreview.java Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-08-19 20:36:10 UTC (rev 271) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-08-26 23:28:35 UTC (rev 272) @@ -45,6 +45,7 @@ import javax.swing.JScrollPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.ActionMethod; import static net.sf.japi.swing.ActionFactory.getFactory; /** @@ -115,7 +116,7 @@ * Zoom to 24x24. * @used */ - public void zoom0() { + @ActionMethod public void zoom0() { setScale(48, 23); } @@ -123,7 +124,7 @@ * Zoom to 12.5%. * @used */ - public void zoom12() { + @ActionMethod public void zoom12() { setScale(0.125); } @@ -131,7 +132,7 @@ * Zoom to 25%. * @used */ - public void zoom25() { + @ActionMethod public void zoom25() { setScale(0.25); } @@ -139,7 +140,7 @@ * Zoom to 50%. * @used */ - public void zoom50() { + @ActionMethod public void zoom50() { setScale(0.5); } @@ -147,7 +148,7 @@ * Zoom to 100%. * @used */ - public void zoom100() { + @ActionMethod public void zoom100() { setScale(1.0); } @@ -155,7 +156,7 @@ * Zoom to 150%. * @used */ - public void zoom150() { + @ActionMethod public void zoom150() { setScale(1.5); } @@ -163,7 +164,7 @@ * Zoom to 200%. * @used */ - public void zoom200() { + @ActionMethod public void zoom200() { setScale(2.0); } @@ -171,7 +172,7 @@ * Zoom to 250%. * @used */ - public void zoom250() { + @ActionMethod public void zoom250() { setScale(2.5); } @@ -179,7 +180,7 @@ * Zoom to 300%. * @used */ - public void zoom300() { + @ActionMethod public void zoom300() { setScale(3.0); } @@ -187,7 +188,7 @@ * Zoom to 400%. * @used */ - public void zoom400() { + @ActionMethod public void zoom400() { setScale(4.0); } @@ -195,7 +196,7 @@ * Zoom save. * @used */ - public void zoomSave() { + @ActionMethod public void zoomSave() { final JFileChooser chooser = new JFileChooser(); chooser.setFileFilter(CMainControl.pngFileFilter); if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) { @@ -224,7 +225,7 @@ * Close the preview. * @used */ - public void zoomClose() { + @ActionMethod public void zoomClose() { frame.dispose(); } @@ -232,7 +233,7 @@ * Zoom Algorithm: Default. * @used */ - public void zoomAlgDefault() { + @ActionMethod public void zoomAlgDefault() { setAlgorithm(SCALE_DEFAULT); } @@ -240,7 +241,7 @@ * Zoom Algorithm: Fast. * @used */ - public void zoomAlgFast() { + @ActionMethod public void zoomAlgFast() { setAlgorithm(SCALE_FAST); } @@ -248,7 +249,7 @@ * Zoom Algorithm: Smooth. * @used */ - public void zoomAlgSmooth() { + @ActionMethod public void zoomAlgSmooth() { setAlgorithm(SCALE_SMOOTH); } @@ -256,7 +257,7 @@ * Zoom Algorithm: Replicate. * @used */ - public void zoomAlgReplicate() { + @ActionMethod public void zoomAlgReplicate() { setAlgorithm(SCALE_REPLICATE); } @@ -264,7 +265,7 @@ * Zoom Algorithm: Area Averaging. * @used */ - public void zoomAlgAreaAveraging() { + @ActionMethod public void zoomAlgAreaAveraging() { setAlgorithm(SCALE_AREA_AVERAGING); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-19 20:38:45
|
Revision: 271 Author: christianhujer Date: 2006-08-19 13:36:10 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=271&view=rev Log Message: ----------- Updated my email address to be consistent. Modified Paths: -------------- trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java trunk/daimonin/src/daieditor/ArchUpdater.java trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/CAttribBitmask.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFileInputStream.java trunk/daimonin/src/daieditor/CFileReader.java trunk/daimonin/src/daieditor/CGUIUtils.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/PathManager.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ResourceFileManager.java trunk/daimonin/src/daieditor/SplashScreen.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/ArchAttribType.java trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java trunk/daimonin/src/daieditor/arch/ArchObjectParser.java trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/arch/DuplicateArchException.java trunk/daimonin/src/daieditor/arch/NamedObject.java trunk/daimonin/src/daieditor/arch/NamedObjects.java trunk/daimonin/src/daieditor/arch/NamedTreeNode.java trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java trunk/daimonin/src/daieditor/arch/anim/AnimationParseException.java trunk/daimonin/src/daieditor/arch/anim/DuplicateAnimationException.java trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java trunk/daimonin/src/daieditor/arch/face/FaceFacade.java trunk/daimonin/src/daieditor/arch/face/FaceObject.java trunk/daimonin/src/daieditor/arch/face/FaceObjects.java trunk/daimonin/src/daieditor/arch/match/AndArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ArchObjectMatchers.java trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/MutableNameArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/MutableOrArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/NamedArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/NotArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/OrArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/TypeNrsArchObjectMatcher.java trunk/daimonin/src/daieditor/arch/match/ViewArchObjectMatcherManager.java trunk/daimonin/src/daieditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/ConnectionView.java trunk/daimonin/src/daieditor/gui/DirectionLayout.java trunk/daimonin/src/daieditor/gui/ErrorListView.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java trunk/daimonin/src/daieditor/icons/AbstractFaceProvider.java trunk/daimonin/src/daieditor/icons/ArchFaceProvider.java trunk/daimonin/src/daieditor/icons/DaimoninFaceProvider.java trunk/daimonin/src/daieditor/icons/FaceProvider.java trunk/daimonin/src/daieditor/icons/FilterFaceProvider.java trunk/daimonin/src/daieditor/map/ArchOutOfMapBoundsException.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapEvent.java trunk/daimonin/src/daieditor/map/MapListener.java trunk/daimonin/src/daieditor/map/MapModelEvent.java trunk/daimonin/src/daieditor/map/MapModelListener.java trunk/daimonin/src/daieditor/map/MapSquare.java trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java trunk/daimonin/src/daieditor/map/validation/ArchValidationError.java trunk/daimonin/src/daieditor/map/validation/ArchValidator.java trunk/daimonin/src/daieditor/map/validation/ArchesValidationError.java trunk/daimonin/src/daieditor/map/validation/CorrectableError.java trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java trunk/daimonin/src/daieditor/map/validation/DelegatingMapValidator.java trunk/daimonin/src/daieditor/map/validation/ErrorCollector.java trunk/daimonin/src/daieditor/map/validation/ErrorHandler.java trunk/daimonin/src/daieditor/map/validation/MapValidationError.java trunk/daimonin/src/daieditor/map/validation/MapValidator.java trunk/daimonin/src/daieditor/map/validation/SquareValidationError.java trunk/daimonin/src/daieditor/map/validation/SquareValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/daimonin/src/daieditor/map/validation/Validator.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedInsideContainerError.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ConnectedPickableError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleArchChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleArchError.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerChecker.java trunk/daimonin/src/daieditor/map/validation/checks/DoubleLayerError.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/EmptySpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/ExitChecker.java trunk/daimonin/src/daieditor/map/validation/checks/ExitError.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyError.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointChecker.java trunk/daimonin/src/daieditor/map/validation/checks/MobOutsideSpawnPointError.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SlayingError.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SquareWithoutFloorError.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectOnLayerZeroChecker.java trunk/daimonin/src/daieditor/map/validation/checks/SysObjectOnLayerZeroError.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsChecker.java trunk/daimonin/src/daieditor/map/validation/checks/TilePathsError.java trunk/daimonin/src/test/daieditor/PathManagerTest.java trunk/daimonin/src/test/daieditor/gui/prefs/AppPrefsTest.java trunk/daimonin/src/test/daieditor/gui/prefs/ResPrefsTest.java trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java trunk/src/app/net/sf/gridarta/help/Help.java trunk/src/doc/hist/MergingEditors.xhtml Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIterator.java 2006-08-19 20:36:10 UTC (rev 271) @@ -34,7 +34,7 @@ * Therefore it is not fail-fast, it does not throw ConcurrentModificationException. * The next link is future-fetched, which means that the invocation of {@link #next()} already prepares the next invocation of {@link #hasNext()} or {@link #next()}. * This allows to safely perform manipulations on the current object, especially deletion, without loosing traversal. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class ArchObjectIterator implements Iterator<ArchObject> { Modified: trunk/daimonin/src/daieditor/ArchUpdater.java =================================================================== --- trunk/daimonin/src/daieditor/ArchUpdater.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/ArchUpdater.java 2006-08-19 20:36:10 UTC (rev 271) @@ -3,7 +3,7 @@ /** * The ArchUpdater is a class designed for updating the arch/ directory. * In its first versions, it will only update the <code>arch/dev/editor/conf/</code> directory, but in future versions maybe it will be extended to keep the whole <code>arch/</code> directory tree up to date. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class ArchUpdater { Modified: trunk/daimonin/src/daieditor/CArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanel.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CArchPanel.java 2006-08-19 20:36:10 UTC (rev 271) @@ -43,7 +43,7 @@ * The <code>CArchPanel</code> holds the tile palette. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CArchPanel extends JPanel { Modified: trunk/daimonin/src/daieditor/CAttribBitmask.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribBitmask.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CAttribBitmask.java 2006-08-19 20:36:10 UTC (rev 271) @@ -43,7 +43,7 @@ * Attacktype, spellpath and material are such bitmasks. They are disguised for * the user, with the help of the attribute dialog. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CAttribBitmask { Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-08-19 20:36:10 UTC (rev 271) @@ -114,7 +114,7 @@ /** * CAttribDialog poses the GUI for Daimonin object attributes. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @fixme I suck */ public final class CAttribDialog extends JOptionPane implements FocusListener { Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-08-19 20:36:10 UTC (rev 271) @@ -41,7 +41,7 @@ * The data is read from a definitions file called 'types.txt'. * It is mainly used as info-base for the arch-attribute GUI. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CFArchType { Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-08-19 20:36:10 UTC (rev 271) @@ -38,7 +38,7 @@ /** * Main class, launches the level editor application. * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:ch...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> */ @SuppressWarnings({"UtilityClass", "UseOfSystemOutOrSystemErr"}) public final class CFJavaEditor { Modified: trunk/daimonin/src/daieditor/CFileInputStream.java =================================================================== --- trunk/daimonin/src/daieditor/CFileInputStream.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CFileInputStream.java 2006-08-19 20:36:10 UTC (rev 271) @@ -46,7 +46,7 @@ * </ol> * Only if all tries failed, creating the stream fails. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @see CFileReader */ public final class CFileInputStream extends BufferedInputStream { Modified: trunk/daimonin/src/daieditor/CFileReader.java =================================================================== --- trunk/daimonin/src/daieditor/CFileReader.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CFileReader.java 2006-08-19 20:36:10 UTC (rev 271) @@ -47,7 +47,7 @@ * </ol> * Only if all tries failed, creating the stream fails. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo eventually remove readUntil - this is afaik only used for reading arches and such, and since there should be an integrated arch editor... * @see CFileInputStream */ Modified: trunk/daimonin/src/daieditor/CGUIUtils.java =================================================================== --- trunk/daimonin/src/daieditor/CGUIUtils.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CGUIUtils.java 2006-08-19 20:36:10 UTC (rev 271) @@ -35,7 +35,7 @@ * Mainly focusing on resource management. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CGUIUtils { Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-08-19 20:36:10 UTC (rev 271) @@ -131,7 +131,7 @@ * The main controller of the level editor. Basically the main application. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian.Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> * @fixme I'm 2200 lines long, therefor I suck. */ public final class CMainControl implements ThrowableHandler, MapModelListener { Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-08-19 20:36:10 UTC (rev 271) @@ -50,7 +50,7 @@ * panels. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> * @todo Separate labels and methods for mouse coordinates */ Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-08-19 20:36:10 UTC (rev 271) @@ -71,7 +71,7 @@ * windows, tile palette, menu, status- and toolbar. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo shouldn't extend JFrame */ public final class CMainView extends JFrame implements ErrorHandler, InternalFrameListener, ThrowableHandler, WindowListener { Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-08-19 20:36:10 UTC (rev 271) @@ -77,7 +77,7 @@ * the currently selected ArchObject on the map. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CMapArchPanel extends JPanel implements ErrorHandler { Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-08-19 20:36:10 UTC (rev 271) @@ -42,7 +42,7 @@ * Warning: This class is NOT Thread safe! * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo unify CMapFileDecode and CMapFileEncode about the usage of CMainControl */ public final class CMapFileDecode { Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-08-19 20:36:10 UTC (rev 271) @@ -41,7 +41,7 @@ * The <code>CMapFileEncode</code> * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CMapFileEncode { Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-08-19 20:36:10 UTC (rev 271) @@ -62,7 +62,7 @@ * The panel that displays the arches of the currently selected map square. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo turn this into a tree */ public final class CMapTileList extends JPanel implements ListSelectionListener, MouseListener, MapCursorListener { Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-08-19 20:36:10 UTC (rev 271) @@ -76,7 +76,7 @@ * </dl> * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> */ public final class CMapViewBasic extends JScrollPane implements ErrorHandler, MapModelListener, MapCursorListener { Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-08-19 20:36:10 UTC (rev 271) @@ -57,7 +57,7 @@ * scratch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class CNewMapDialog extends JOptionPane { Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-08-19 20:36:10 UTC (rev 271) @@ -51,7 +51,7 @@ * The map preview of the level editor. * This allows the user to zoom in and out of the map. * @author <a href="mailto:pli...@ho...">Peter Plischewsky</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo add user definable previews * @todo add zoom increase, zoom decrease */ Modified: trunk/daimonin/src/daieditor/PathManager.java =================================================================== --- trunk/daimonin/src/daieditor/PathManager.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/PathManager.java 2006-08-19 20:36:10 UTC (rev 271) @@ -26,7 +26,7 @@ /** * This class contains methods for converting relative map paths to absolute map paths and vice versa. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class PathManager { Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-08-19 20:36:10 UTC (rev 271) @@ -49,7 +49,7 @@ /** * Class to run an external process. - * @author <a href="mailto:Chr...@it...">Christian.Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> */ public final class ProcessRunner extends JPanel { Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-08-19 20:36:10 UTC (rev 271) @@ -51,7 +51,7 @@ /** * This dialog manages the replace action. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian.Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> */ public final class ReplaceDialog extends JOptionPane implements ItemListener { Modified: trunk/daimonin/src/daieditor/ResourceFileManager.java =================================================================== --- trunk/daimonin/src/daieditor/ResourceFileManager.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/ResourceFileManager.java 2006-08-19 20:36:10 UTC (rev 271) @@ -2,7 +2,7 @@ /** * TODO - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class ResourceFileManager { Modified: trunk/daimonin/src/daieditor/SplashScreen.java =================================================================== --- trunk/daimonin/src/daieditor/SplashScreen.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/SplashScreen.java 2006-08-19 20:36:10 UTC (rev 271) @@ -36,7 +36,7 @@ /** * Class for a splash screen that's displayed while loading. * It is mainly a workaround to load stuff in the background which speeds up startup significantly. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class SplashScreen { Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/Updater.java 2006-08-19 20:36:10 UTC (rev 271) @@ -50,7 +50,7 @@ /** * This class handles updating the map editor. - * @author <a href="mailto:Chr...@it...">Christian.Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> * @fixme the updater fails on windows, the user is notified of this but still it isn't nice. * The updater should be a separate application. * @todo move the updater to JAPI Modified: trunk/daimonin/src/daieditor/arch/ArchAttribType.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchAttribType.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchAttribType.java 2006-08-19 20:36:10 UTC (rev 271) @@ -23,7 +23,7 @@ /** * Enumeration for Archetype Attribute Types. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public enum ArchAttribType { Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-19 20:36:10 UTC (rev 271) @@ -47,7 +47,7 @@ * Usually, an ArchObject that is really used is derived from a (replacable) default arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo the archobject should be directly asked for a face, and eventually it * should cache faces itself ; that would speed up painting maps * @todo this class maybe could be split into 3 classes: AbstractArchObject as Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-08-19 20:36:10 UTC (rev 271) @@ -31,7 +31,7 @@ * <li>{@link ArchObject} extends this class for containing other arches, like bag contents or attached events.</li> * <li>{@link daieditor.map.MapSquare} extends this class to list the tiles on a MapSquare.</li> * </ul> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public abstract class ArchObjectContainer implements Iterable<ArchObject> { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchObjectIterator.java 2006-08-19 20:36:10 UTC (rev 271) @@ -34,7 +34,7 @@ * Therefore it is not fail-fast, it does not throw ConcurrentModificationException. * The next link is future-fetched, which means that the invocation of {@link #next()} already prepares the next invocation of {@link #hasNext()} or {@link #next()}. * This allows to safely perform manipulations on the current object, especially deletion, without loosing traversal. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ class ArchObjectIterator implements Iterator<ArchObject> { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchObjectParser.java 2006-08-19 20:36:10 UTC (rev 271) @@ -48,7 +48,7 @@ * loading arches in map files. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class ArchObjectParser { Modified: trunk/daimonin/src/daieditor/arch/ArchObjectStack.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectStack.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/ArchObjectStack.java 2006-08-19 20:36:10 UTC (rev 271) @@ -69,7 +69,7 @@ * The <code>ArchObjectStack</code> contains all the default arches. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class ArchObjectStack { Modified: trunk/daimonin/src/daieditor/arch/DuplicateArchException.java =================================================================== --- trunk/daimonin/src/daieditor/arch/DuplicateArchException.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/DuplicateArchException.java 2006-08-19 20:36:10 UTC (rev 271) @@ -23,7 +23,7 @@ /** * Exception that's thrown in case an arch name was not unique. - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> * @serial exclude */ public class DuplicateArchException extends Exception { Modified: trunk/daimonin/src/daieditor/arch/NamedObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/NamedObject.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/NamedObject.java 2006-08-19 20:36:10 UTC (rev 271) @@ -27,7 +27,7 @@ * A <code>NamedObject</code> has a name and tree position source and provides an icon for display. * <code>NamedObject</code> is the superclass of {@link daieditor.arch.face.FaceObject} and * {@link daieditor.arch.anim.AnimationObject}. - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> */ public abstract class NamedObject implements Comparable<NamedObject> { Modified: trunk/daimonin/src/daieditor/arch/NamedObjects.java =================================================================== --- trunk/daimonin/src/daieditor/arch/NamedObjects.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/NamedObjects.java 2006-08-19 20:36:10 UTC (rev 271) @@ -45,7 +45,7 @@ * This class manages NamedObjects, managing their tree as well as providing a method for showing a dialog for browsing their tree and selecting one from it. * NamedObjects are iterated in Unicode (=ASCII) order. * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public abstract class NamedObjects<T extends NamedObject> implements Iterable<T> { Modified: trunk/daimonin/src/daieditor/arch/NamedTreeNode.java =================================================================== --- trunk/daimonin/src/daieditor/arch/NamedTreeNode.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/NamedTreeNode.java 2006-08-19 20:36:10 UTC (rev 271) @@ -35,7 +35,7 @@ /** * TreeNode implementation for Named Objects (like arches, faces, animations, artifacts etc.), used for displaying faces in a {@link javax.swing.JTree}. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class NamedTreeNode<T extends NamedObject> implements TreeNode, Comparable<NamedTreeNode<T>> { Modified: trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java =================================================================== --- trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/RecursiveArchObjectIterator.java 2006-08-19 20:36:10 UTC (rev 271) @@ -5,7 +5,7 @@ /** * Iterator for recursively iterating over ArchObjectContainers. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ class RecursiveArchObjectIterator implements Iterator<ArchObject> { Modified: trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/anim/AnimationObject.java 2006-08-19 20:36:10 UTC (rev 271) @@ -37,7 +37,7 @@ * It holds the information like the number of frames used and the frames to display, as well as facings, which is the number of different * subanimations, for instance for different directions. * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class AnimationObject extends NamedObject { Modified: trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/anim/AnimationObjects.java 2006-08-19 20:36:10 UTC (rev 271) @@ -44,7 +44,7 @@ * The <code>AnimationObject</code>. * AnimationObjects are iterated in Unicode (=ASCII) order. * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class AnimationObjects extends NamedObjects<AnimationObject> { Modified: trunk/daimonin/src/daieditor/arch/anim/AnimationParseException.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/AnimationParseException.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/anim/AnimationParseException.java 2006-08-19 20:36:10 UTC (rev 271) @@ -27,7 +27,7 @@ * This exception is thrown when parsing an animation definition file (<code>arch/animations</code> and <code>arch/**.anim</code>) revealed that such * a file contains an error. * In future, it might as well be used if a user defines or changes an animation. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class AnimationParseException extends Exception { Modified: trunk/daimonin/src/daieditor/arch/anim/DuplicateAnimationException.java =================================================================== --- trunk/daimonin/src/daieditor/arch/anim/DuplicateAnimationException.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/anim/DuplicateAnimationException.java 2006-08-19 20:36:10 UTC (rev 271) @@ -23,7 +23,7 @@ /** * Exception that's thrown in case an animation name was not unique. - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> * @serial exclude */ public class DuplicateAnimationException extends Exception { Modified: trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/face/DuplicateFaceException.java 2006-08-19 20:36:10 UTC (rev 271) @@ -23,7 +23,7 @@ /** * Exception that's thrown in case a face name was not unique. - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> * @serial exclude */ public class DuplicateFaceException extends Exception { Modified: trunk/daimonin/src/daieditor/arch/face/FaceFacade.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceFacade.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/face/FaceFacade.java 2006-08-19 20:36:10 UTC (rev 271) @@ -31,7 +31,7 @@ * The FaceFacade hides the internals of the icons package in case the implementation changes. * Access to features of the icons package is limited by the FaceFacade as well. * The design of this class violates some oop rules to give as direct acess to faces as possible. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class FaceFacade { Modified: trunk/daimonin/src/daieditor/arch/face/FaceObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/face/FaceObject.java 2006-08-19 20:36:10 UTC (rev 271) @@ -35,7 +35,7 @@ * <li>File offset in the file name</li> * <li>File size</li> * </ul> - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Chrsitian Hujer</a> */ public class FaceObject extends NamedObject { Modified: trunk/daimonin/src/daieditor/arch/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/arch/face/FaceObjects.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/face/FaceObjects.java 2006-08-19 20:36:10 UTC (rev 271) @@ -37,7 +37,7 @@ /** * This class manages the FaceObjects. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class FaceObjects extends NamedObjects<FaceObject> { Modified: trunk/daimonin/src/daieditor/arch/match/AndArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/AndArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/AndArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -28,7 +28,7 @@ /** * ArchObjectMatcher that And-combines other ArchObjectMatchers. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class AndArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/ArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -25,7 +25,7 @@ /** * Interface for classes that match ArchObjects. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/ArchObjectMatchers.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/ArchObjectMatchers.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/ArchObjectMatchers.java 2006-08-19 20:36:10 UTC (rev 271) @@ -34,7 +34,7 @@ /** * Class for some default ArchObjectMatchers. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class ArchObjectMatchers { Modified: trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/AttribArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -25,7 +25,7 @@ /** * TODO - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class AttribArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/MutableNameArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/MutableNameArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/MutableNameArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -26,7 +26,7 @@ /** * An {@link ArchObjectMatcher} that simply matches an arch name. * This is probably the most basic and most simple implementation of {@link ArchObjectMatcher}. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class MutableNameArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/MutableOrArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/MutableOrArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/MutableOrArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -30,7 +30,7 @@ /** * An ArchObjectMatcher that delegates to other ArchObjectMatchers. * If empty, {@link #isMatching(daieditor.arch.ArchObject)} returns <code>true</code> always. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class MutableOrArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/NamedArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/NamedArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/NamedArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -27,7 +27,7 @@ /** * A NamedArchObjectMatcher decorates an arbitrary ArchObjectMatcher with a localized name that is suitable for the user interface. * That name can be used to for instance for menu item labels that are used on menu items to toggle the ArchObjectMatcher on / off. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class NamedArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/NotArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/NotArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/NotArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -25,7 +25,7 @@ /** * ArchObjectMatcher that negates another ArchObjectMatcher. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class NotArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/OrArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/OrArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/OrArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -28,7 +28,7 @@ /** * ArchObjectMatcher that Or-combines other ArchObjectMatchers. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class OrArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/TypeNrsArchObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/TypeNrsArchObjectMatcher.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/TypeNrsArchObjectMatcher.java 2006-08-19 20:36:10 UTC (rev 271) @@ -28,7 +28,7 @@ /** * An ArchObjectMatcher matching certain ArchObjectTypes. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class TypeNrsArchObjectMatcher implements ArchObjectMatcher { Modified: trunk/daimonin/src/daieditor/arch/match/ViewArchObjectMatcherManager.java =================================================================== --- trunk/daimonin/src/daieditor/arch/match/ViewArchObjectMatcherManager.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/arch/match/ViewArchObjectMatcherManager.java 2006-08-19 20:36:10 UTC (rev 271) @@ -30,7 +30,7 @@ /** * TODO - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class ViewArchObjectMatcherManager { Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-08-19 20:36:10 UTC (rev 271) @@ -27,7 +27,7 @@ * TODO Refactor to use less memory * TODO extract JAPI class * TODO change ActionFactory - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class AboutDialog extends JPanel { Modified: trunk/daimonin/src/daieditor/gui/ConnectionView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ConnectionView.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/ConnectionView.java 2006-08-19 20:36:10 UTC (rev 271) @@ -38,7 +38,7 @@ /** * A Panel that holds information about the connections of the selected arch on the selected map. * It is unfinished. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo more user interface features * @todo make this a MapHighlightModel * @todo better react on changes, don't always scan the whole map Modified: trunk/daimonin/src/daieditor/gui/DirectionLayout.java =================================================================== --- trunk/daimonin/src/daieditor/gui/DirectionLayout.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/DirectionLayout.java 2006-08-19 20:36:10 UTC (rev 271) @@ -43,7 +43,7 @@ * This LayoutManager respects the components preferred size for suggesting a preferred size to the container. * This LayoutManager does not respect the components individual sizes when doing the overall layout. * The overall layout is solely determined by the container's width and height. - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @SuppressWarnings({"EnumeratedConstantNamingConvention", "InstanceVariableNamingConvention"}) public final class DirectionLayout implements LayoutManager2, Serializable { Modified: trunk/daimonin/src/daieditor/gui/ErrorListView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ErrorListView.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/ErrorListView.java 2006-08-19 20:36:10 UTC (rev 271) @@ -41,7 +41,7 @@ /** * An ErrorPanel displays errors to the user. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class ErrorListView extends JPanel implements ErrorHandler, ListSelectionListener { Modified: trunk/daimonin/src/daieditor/gui/MapFileFilter.java =================================================================== --- trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-08-19 20:36:10 UTC (rev 271) @@ -33,7 +33,7 @@ /** * Swing FileFilter implementation that filters Daimonin map files. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class MapFileFilter extends EndingFileFilter { Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-19 20:36:10 UTC (rev 271) @@ -64,7 +64,7 @@ * A dialog to change the properties of a map, like several flags and settings about the environment and the map tiles. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class MapPropertiesDialog extends JOptionPane { Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-08-19 20:36:10 UTC (rev 271) @@ -67,7 +67,7 @@ * It creates a Panel for a map where the user can manage the tile paths. * He can choose files to tile, attach tiles, clear all or individual tile paths and switch between relative and absolute paths. * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:Chr...@it...">Chrsitian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public final class MapTilePane extends JPanel { Modified: trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2006-08-19 20:36:10 UTC (rev 271) @@ -28,7 +28,7 @@ /** * Container for settings that affect the rendering of maps. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class MapViewSettings { Modified: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2006-08-19 20:36:10 UTC (rev 271) @@ -26,7 +26,7 @@ /** * Event Object encapsulating events on MapViewSettings. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class MapViewSettingsEvent extends EventObject { Modified: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2006-08-19 20:36:10 UTC (rev 271) @@ -26,7 +26,7 @@ /** * Interface for event listeners that are interested in changes on {@link daieditor.gui.map.MapViewSettings}. * Usually you would implement this class in renderers for Maps. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public interface MapViewSettingsListener extends EventListener { Modified: trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -52,7 +52,7 @@ /** * Preferences Module for application preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class AppPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -41,7 +41,7 @@ /** * Preferences Module for developer preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class DevPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -50,7 +50,7 @@ /** * Preferences Module for user interface preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class GUIPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -45,7 +45,7 @@ /** * Preferences Module for map validator preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class MapValidatorPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -43,7 +43,7 @@ /** * Preferences Module for miscellaneous preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class MiscPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -48,7 +48,7 @@ /** * Preferences Module for networking preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public class NetPrefs extends AbstractPrefs implements ItemListener { Modified: trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-08-19 20:30:05 UTC (rev 270) +++ trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-08-19 20:36:10 UTC (rev 271) @@ -49,7 +49,7 @@ /** * Preferences Module for resource preferences. - * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @serial exclude */ public final class ResPrefs extends AbstractPrefs { Modified: trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.ja... [truncated message content] |
From: <chr...@us...> - 2006-08-19 20:30:16
|
Revision: 270 Author: christianhujer Date: 2006-08-19 13:30:05 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=270&view=rev Log Message: ----------- Added a TODO entry and added some directories to be ignored when loading artifacts from the map path. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/daimonin/src/daieditor/arch/ArchObjectStack.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectStack.java 2006-08-18 08:20:46 UTC (rev 269) +++ trunk/daimonin/src/daieditor/arch/ArchObjectStack.java 2006-08-19 20:30:05 UTC (rev 270) @@ -256,7 +256,8 @@ final String[] traverse = f.list(new FilenameFilter() { public boolean accept(final File d, final String name) { final File fullPath = new File(d, name); - return fullPath.isDirectory() && !name.equalsIgnoreCase("cvs") + // TODO: Replace this with a proper FileFilter. + return fullPath.isDirectory() && !name.equalsIgnoreCase("cvs") && !name.equalsIgnoreCase(".xvpics") && !name.equalsIgnoreCase(".svn") || name.toLowerCase().endsWith(".art"); } }); @@ -298,6 +299,7 @@ final int tIndex = editor.indexOf(":"); if (tIndex != -1) { editorPath = editor.substring(tIndex + 1); + // TODO: use editorPath for determining the place of this ArchObject editorCode = Integer.parseInt(editor.substring(0, tIndex)); } else { editorCode = Integer.parseInt(editor); Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-18 08:20:46 UTC (rev 269) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-19 20:30:05 UTC (rev 270) @@ -76,8 +76,7 @@ /** * Main view of this map. */ - @Nullable - private MapViewIFrame mapViewFrame; + @Nullable private MapViewIFrame mapViewFrame; /** * List of all views of this map. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-18 08:20:57
|
Revision: 269 Author: christianhujer Date: 2006-08-18 01:20:46 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=269&view=rev Log Message: ----------- Added historic document. Added Paths: ----------- trunk/src/doc/hist/ trunk/src/doc/hist/MergingEditors.xhtml Added: trunk/src/doc/hist/MergingEditors.xhtml =================================================================== --- trunk/src/doc/hist/MergingEditors.xhtml (rev 0) +++ trunk/src/doc/hist/MergingEditors.xhtml 2006-08-18 08:20:46 UTC (rev 269) @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title>Merging Map Editors</title> + </head> + <body> + <h2>About this document</h2> + <p> + This document describes changes, dangers and ways about merging the map editors of the MMORPG projects Crossfire and Daimonin. + </p> + <h3>Authors</h3> + <ul> + <li><a href="mailto:ch...@it...">Christian Hujer</a></li> + </ul> + <h2>Introduction</h2> + <p> + The MMORPG Daimonin split from Crossfire several years ago. + At that time, Crossfire had a map editor, which was also split for Daimonin. + Now, approximately 5 years after the split, the formats for maps and other game data still are quite similar. + </p> + <p> + What will probably stay in common for both projects for quite a long time is the game data architecture. + The game data architecture mainly knows the following entities: + </p> + <dl> + <dt>Map</dt> + <dd>A game map consists of map width × map height map squares.</dd> + <dt>Map Square</dt> + <dd>A map square consists of zero or more arch object instances.</dd> + <dt>Arch</dt> + <dd>An arch is a prototype for arch object instances.</dd> + <dt>Arch Object Instance</dt> + <dd>An arch object instance is a game object.</dd> + </dl> + <h3>Current Situation</h3> + <p> + Currently, there exist two editors of interest: The Crossfire Java Editor and the Daimonin Editor, written in Java as well. + The Crossfire Editor has some interesting features the Daimonin Editor does not yet have, most notably a scripting plugin for Python. + The Daimonin Editor also has some interesting features the Crossfire Editor does not yet have, most notably performance, smaller footprint, cleaner code and design, a map validator and more editing possibilities. + </p> + <h3>Technical ways of merging</h3> + <p> + The following possibilities for merging exist: + </p> + <ol> + <li>Throwing away Daimonin Editor and using Crossfire Editor as a base.</li> + <li>Throwing away Crossfire Editor and using Daimonin Editor as a base.</li> + <li>Continueing both editors with the effort of assimilating each other until a state where not a single line of code differs, then spin off a new project for the editor.</li> + </ol> + <p> + The last possibility means the biggest effort of all, but has the advantage of not discriminating either editor and the chance of retaining all useful features of both editors. + This document only discusses the last one of these possibilities. + </p> + <h2>Realization</h2> + <h3>Future Code Base</h3> + <p> + The following possibilities for future code bases exist: + </p> + <ul> + <li>A. Maintaining the editor within Crossfire.</li> + <li>B. Maintaining the editor within Daimonin.</li> + <li> + C. Maintaining the editor within a project of its own, whilst + <ul> + <li>C.1 keeping the differences within each project,</li> + <li> + C.2 Keeping the differences with the editor project + <ul> + <li>C.2.a not apart (means a X editor user will have to load the Y specific parts as well),</li> + <li>C.2.b in separate branches,</li> + <li>C.2.c in separate modules.</li> + </ul> + </li> + </ul> + </li> + </ul> + <p> + The following persons have made statements about the possibilities: + </p> + <ul> + <li>Cher, voting for C.2.c</li> + <li>Zergus, voting for C.2.c</li> + <li>Ragnor and other editor developers: votes missing</li> + <li>Project leaders / admins: votes missing</li> + </ul> + <h3>How to merge</h3> + <p> + There are four possibilities for merging: + </p> + <ul> + <li>D. Using the Crossfire editor as base, merging the Daimonin specific parts into it.</li> + <li>E. Using the Daimonin editor as base, merging the Crossfire specific parts into it.</li> + <li>F. Developing both editors in separate modules or projects whilst assimilating each other, until a merge is easy.</li> + <li>G. Creating a new editor from the scratch, assimilating parts of the old editors.</li> + </ul> + <p> + The following persons have made statements about the possibilities: + </p> + <ul> + <li>Cher, definitely declining D. and E., but unsure whether to do F. or G..</li> + <li>Ragnor, zergus and other editor developers: votes missing</li> + <li>Project leaders / admins: votes missing</li> + </ul> + <h2>Appendix</h2> + <h3>References</h3> + <ul> + <li><a href="http://crossfire.real-time.com/">Crossfire Homepage</a></li> + <li><a href="http://www.daimonin.net/">Daimonin Homepage</a></li> + </ul> + <ul> + <li><a href="http://sourceforge.net/projects/crossfire">SourceForge Crossfire project page</a></li> + <li><a href="http://sourceforge.net/projects/daimonin">SourceForge Daimonin project page</a></li> + </ul> + <ul> + <li><a href="http://japi.sourceforge.net/">JAPI Homepage</a></li> + <li><a href="http://sourceforge.net/projects/japi">SourceForge JAPI project page</a></li> + </ul> + </body> +</html> Property changes on: trunk/src/doc/hist/MergingEditors.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 16:34:01
|
Revision: 268 Author: christianhujer Date: 2006-08-15 09:33:54 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=268&view=rev Log Message: ----------- Added workaround for save problem. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainView.java Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-08-15 16:30:17 UTC (rev 267) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-08-15 16:33:54 UTC (rev 268) @@ -796,8 +796,8 @@ * @todo remove me */ private void refresh2() { - aSave.setEnabled(mainControl.isPlainSaveEnabled()); - aSaveAs.setEnabled(mainControl.isLevelEdited()); + //aSave.setEnabled(mainControl.isPlainSaveEnabled()); + //aSaveAs.setEnabled(mainControl.isLevelEdited()); aUndo.setEnabled(mainControl.isUndoPossible()); //aUndo.setToolTipText( "Undo " + mainControl.getUndoName() ); aRedo.setEnabled(mainControl.isRedoPossible()); @@ -832,8 +832,8 @@ final boolean selState = mapState && mainControl.getCurrentMap().getMapCursor().isActive(); aCreateImg.setEnabled(true); aClose.setEnabled(fLevelEdited); - aSave.setEnabled(mapState && mainControl.isPlainSaveEnabled()); - aSaveAs.setEnabled(fLevelEdited); + //aSave.setEnabled(mapState && mainControl.isPlainSaveEnabled()); + //aSaveAs.setEnabled(fLevelEdited); aMapCreateView.setEnabled(mapState); aMapProperties.setEnabled(mapState); aReplace.setEnabled(mapState); @@ -851,7 +851,7 @@ aRandFillAbove.setEnabled(selState); aRandFillBelow.setEnabled(selState); aEnterExit.setEnabled(selState); - aRevert.setEnabled(mapState && mainControl.getCurrentMap().isLevelChanged()); + //aRevert.setEnabled(mapState && mainControl.getCurrentMap().isLevelChanged()); aPaste.setEnabled(selState && !mainControl.isCopyBufferEmpty()); //aGridToggle.setEnabled(mapState); //((ToggleAction) aGridToggle).setSelected(mapState && mainControl.isGridVisible()); // FIXME IMPORTANT!!! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 16:30:43
|
Revision: 267 Author: christianhujer Date: 2006-08-15 09:30:17 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=267&view=rev Log Message: ----------- Cleaned MapControl and MapModel regarding its responsibilities: Moved level change tracking responsibility from MapModel to MapControl because the model doesn't know about loading / saving. Removed proxy methods for accessing a MapModel via MapControl. Modified Paths: -------------- trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-08-15 16:30:17 UTC (rev 267) @@ -1279,11 +1279,6 @@ } } - // if the archtext changed, set the map changed flag - if (oldArchText != null && !oldArchText.equals(arch.getArchText()) || oldArchText == null && arch.getArchText() != null || oldMsg != null && !oldMsg.equals(arch.getMsgText()) || oldMsg == null && arch.getMsgText() != null) { - mainControl.getCurrentMap().setLevelChangedFlag(); - } - // recalculate the editType value arch.calculateEditType(mainControl.getCurrentMap().getActiveEditType()); @@ -1648,8 +1643,6 @@ arch.calculateEditType(mainControl.getCurrentMap().getActiveEditType()); // also update the arch panel (bottom) mainControl.getMainView().refreshMapArchPanel(); - // map content has changed - mainControl.getCurrentMap().setLevelChangedFlag(); } else { // change not wanted -> reset the choosebox ignoreEvent = true; // ignore events thrown by the forced reset Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-08-15 16:30:17 UTC (rev 267) @@ -799,11 +799,11 @@ } boolean insertArchToMap(final ArchObject newarch, final String archname, final ArchObject next, final int mapx, final int mapy) { - return currentMap.insertArchToMap(newarch, archname, next, mapx, mapy); + return currentMap.getMapModel().insertArchToMap(newarch, archname, next, new Point(mapx, mapy)); } - public void deleteMapArch(final ArchObject arch, final int mapx, final int mapy, final boolean refreshMap) { - currentMap.deleteMapArch(arch, refreshMap); + public void deleteMapArch(final ArchObject arch, final boolean refreshMap) { + currentMap.getMapModel().deleteMapArch(arch, refreshMap); } /** @@ -1253,7 +1253,6 @@ // finally, show the map and refresh toolbars lastOpenedMap.setMapFile(file); lastOpenedMap.setActiveEditType(tileEdit); // map is loaded with current view settings - lastOpenedMap.getMapModel().resetLevelChangedFlag(); if (view) { refreshMenusAndToolbars(); addRecent(currentMap.getMapArch().getMapNameWithoutMusic(), file.toString()); Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-08-15 16:30:17 UTC (rev 267) @@ -309,7 +309,6 @@ inv.addLast(invnew); invnew.setObjectFace(); mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), inv); - mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified mainControl.getCurrentMap().repaint(); // XXX not nice but no better way yet } @@ -441,12 +440,6 @@ // Recalculate the editType value. It shall stay 100% accurate ;) arch.calculateEditType(mainControl.getCurrentMap().getActiveEditType()); - // if the archtext changed, set the map changed flag - if (oldArchText != null && !oldArchText.equals(arch.getArchText()) || oldArchText == null && arch.getArchText() != null || oldmsg != null && !oldmsg.equals(arch.getMsgText()) || oldmsg == null && arch.getMsgText() != null) - { - mainControl.getCurrentMap().setLevelChangedFlag(); - } - // there we go!!!!! // now here will be the special panels added! refresh(); @@ -1036,7 +1029,6 @@ final int index = eventList.getSelectedIndex(); if (index >= 0) { if (arch.modifyEventScript(index, task, eventList, this)) { - mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified updateMapTileList(); } } @@ -1051,7 +1043,6 @@ arch = arch.getMapMultiHead(); // if it's a multi, always add scripts to head } if (arch.addEventScript(eventList, this)) { - mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified updateMapTileList(); } } Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-08-15 16:30:17 UTC (rev 267) @@ -229,7 +229,6 @@ } // refresh - mainControl.getCurrentMap().setLevelChangedFlag(); // the map has been modified mainControl.refreshCurrentMap(); } else { if (currentSquare == null) { @@ -289,7 +288,7 @@ final ArchObject temp = getMapTileSelection(); final ArchObject entry = (ArchObject) model.getElementAt(index); if (entry != null) { - mainControl.deleteMapArch(entry, entry.getMapX(), entry.getMapY(), true); + mainControl.deleteMapArch(entry, true); mainView.setMapTileList(mainControl.getCurrentMap(), temp); } } Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-08-15 16:30:17 UTC (rev 267) @@ -368,16 +368,9 @@ } renderer.setPreferredSize(forcedSize); renderer.setMinimumSize(forcedSize); - changedFlagNotify(); repaint(); } - /** Notifies that the level changed flag has been changed. */ - void changedFlagNotify() { - changed = mapControl.isLevelChanged(); - frame.updateTitle(); - } - /** {@inheritDoc} */ public void mapSizeChanged(final MapModelEvent e) { mapGrid.resize(e.getMap().getMapSize()); Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-08-15 16:30:17 UTC (rev 267) @@ -220,8 +220,6 @@ pickmaps.add(index, map); } currentPickMap = map; - map.getMapModel().resetLevelChangedFlag(); - return map.getMapViewFrame().getBasicView(); } Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-08-15 16:30:17 UTC (rev 267) @@ -162,7 +162,7 @@ // copy this arch final ArchObject clone = arch.createClone(posx - offset.x, posy - offset.y); assert copyMapCtrl != null; - copyMapCtrl.addArchObjectToMap(clone); + copyMapCtrl.getMapModel().addArchObjectToMap(clone, false); } // delete the arch if we have a "cut" or "clear" command @@ -173,7 +173,7 @@ // above the head (we would miss to copy them otherwise). if (mode == Mode.DO_CLEAR || !arch.isMulti() || arch.getMultiRefCount() > 0 || arch.getMapMultiHead() != null && arch.getMultiRefX() >= 0 && arch.getMultiRefY() >= 0) { - mapControl.deleteMapArch(arch, false); + mapControl.getMapModel().deleteMapArch(arch, false); } } } @@ -207,7 +207,7 @@ if (!arch.isMulti()) { // read arch from buffer and stick in on the map clone = arch.createClone(pos.x, pos.y); - mapControl.addArchObjectToMap(clone); + mapControl.getMapModel().addArchObjectToMap(clone, false); } } } @@ -223,7 +223,7 @@ // first we clone the head clone = arch.createClone(pos.x, pos.y); // second we insert a default multi on the map - if (mapControl.addArchToMap(arch.getArchName(), pos, true)) { + if (mapControl.getMapModel().addArchToMap(arch.getArchName(), pos, true, false)) { // third we chop off the default head and attach our clone final ArchObject oldHead = mapControl.getMapModel().getMapSquare(pos).getLast(); if (oldHead != null && oldHead.hasSameDefaultArch(arch)) { @@ -290,10 +290,10 @@ final ArchObject arch = archList.get(rnd.nextInt(archList.size())); final boolean isDefarch = arch.isDefaultArch(); if (isDefarch) { - mapControl.addArchToMap(mainControl.getPanelArchName(), p, false, fillBelow); + mapControl.getMapModel().addArchToMap(mainControl.getPanelArchName(), p, false, fillBelow); } else { // insert arch-clone from pickmap - mapControl.addArchObjectToMap(arch.createClone(p.x, p.y), fillBelow); + mapControl.getMapModel().addArchObjectToMap(arch.createClone(p.x, p.y), fillBelow); } } mapControl.getMapModel().endTransaction(); @@ -434,9 +434,9 @@ final ArchObject arch = archList.get(rnd.nextInt(archList.size())); final boolean isDefArch = arch.isDefaultArch(); if (isDefArch) { - mapControl.addArchToMap(arch.getArchName(), p, false); + mapControl.getMapModel().addArchToMap(arch.getArchName(), p, false, false); } else { - mapControl.addArchObjectToMap(arch.createClone(p.x, p.y)); + mapControl.getMapModel().addArchObjectToMap(arch.createClone(p.x, p.y), false); } try { if (area[p.x - 1][p.y] == NOT_LOOKED_AT) { Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2006-08-15 16:30:17 UTC (rev 267) @@ -150,10 +150,6 @@ view.printFullImage(filename); } - public void changedFlagNotify() { - view.changedFlagNotify(); - } - /** The Action to select this Window. */ private WindowAction windowAction = new WindowAction(); Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2006-08-15 16:30:17 UTC (rev 267) @@ -126,7 +126,7 @@ if (arch != null) { final Point pos = mapCursor.getLocation(); assert pos != null; - mapControl.deleteMapArch(arch, true); + mapControl.getMapModel().deleteMapArch(arch, true); } } } Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-08-15 16:30:17 UTC (rev 267) @@ -469,9 +469,6 @@ mapTilePane.modifyMapProperties(); - // set flag that map has changed - mapControl.setLevelChangedFlag(); - return true; } Modified: trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2006-08-15 16:30:17 UTC (rev 267) @@ -72,7 +72,7 @@ } } if (delArch != null) { - mapControl.deleteMapArch(delArch, false); + mapControl.getMapModel().deleteMapArch(delArch, false); } } Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-08-15 16:30:17 UTC (rev 267) @@ -104,14 +104,14 @@ /** * Constructs a level model. * @param mainControl main controller - * @param control the controller of this view + * @param mapControl the controller of this view * @param objects the <code>ArchObject</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 control, final List<ArchObject> objects, final MapArchObject mapArch) { + public DefaultMapModel(final CMainControl mainControl, final MapControl mapControl, final List<ArchObject> objects, final MapArchObject mapArch) { this.mapArch = mapArch; this.mainControl = mainControl; - mapControl = control; + this.mapControl = mapControl; mapSize = mapArch.getMapSize(); mapGrid = new MapSquare[mapSize.getWidth()][mapSize.getHeight()]; @@ -211,48 +211,6 @@ } } - /** - * {@inheritDoc} - * @todo it's not a good idea to use the mapViewFrame here - */ - public void resetLevelChangedFlag() { - if (!levelChanged) { - return; - } - - // change status and update title bar - levelChanged = false; - if (mapControl.getMapViewFrame() != null) { - mapControl.getMapViewFrame().changedFlagNotify(); - } - } - - /** - * {@inheritDoc} - * @todo it's not a good idea to use the mapViewFrame here - */ - public void setLevelChangedFlag() { - if (levelChanged) { - return; - } - - // change status and update title bar - levelChanged = true; - if (mapControl != null && mapControl.getMapViewFrame() != null) { - // pickmaps obviously somehow call this at startup, but have mapControl or mapViewFrame null. - mapControl.getMapViewFrame().changedFlagNotify(); - } - - // enable menu file->revert to revert the map - if (mainControl.getCurrentMap() == mapControl) { - mainControl.getMainView().setRevertMenuEnabled(true); - } - } - - public boolean isLevelChanged() { - return levelChanged; - } - public Size2D getMapSize() { return mapSize; } @@ -325,9 +283,6 @@ ArchObjectParser.postParseMapArch(tail, mapControl.getActiveEditType()); tail.setObjectFace(); } - - // Level data has changed - setLevelChangedFlag(); return true; } @@ -337,7 +292,7 @@ */ public boolean insertArchToMap(ArchObject newarch, String archname, final ArchObject next, final Point pos) { // map coords must be valid - if (!mapControl.isPointValid(pos)) { + if (!isPointValid(pos)) { return false; } @@ -350,7 +305,7 @@ archname = newarch.getArchName(); } // insert a new instance of the default arch (number 'archnr') - if (mapControl.addArchToMap(archname, pos, true)) { + if (addArchToMap(archname, pos, true, false)) { return false; } } else { @@ -370,8 +325,6 @@ } node.moveDown(); } - - setLevelChangedFlag(); // the map has been modified return true; } else { // insert the new arch into the inventory of a map arch @@ -395,8 +348,6 @@ invnew.setObjectFace(); ArchObjectParser.postParseMapArch(invnew, mapControl.getActiveEditType()); mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), invnew); - - setLevelChangedFlag(); // the map has been modified return true; } } @@ -432,16 +383,12 @@ } else if (mapControl.getActiveEditType() != 0) { arch.setEditType(arch.calculateEditType(mapControl.getActiveEditType())); // calculate new } - - // Level data has changed - setLevelChangedFlag(); // the map has been modified } /** {@inheritDoc} */ public void deleteMapArch(final ArchObject arch, final boolean refreshMap) { // Okay, it's in an inventory then arch.remove(); - setLevelChangedFlag(); // the map has been modified if (refreshMap) { mainControl.refreshCurrentMap(); // redraw } @@ -570,7 +517,6 @@ // adjust the map and model attributes mapSize = newSize; mapArch.setMapSize(newSize); - setLevelChangedFlag(); // the map changed for sure! } fireMapSizeChanged(); } @@ -626,6 +572,7 @@ assert transactionDepth >= 0; if (transactionDepth == 0 && !changedSquares.isEmpty()) { fireMapSquaresChangedEvent(changedSquares.toArray(new MapSquare[changedSquares.size()])); + changedSquares.clear(); } } @@ -635,6 +582,7 @@ transactionDepth = 0; if (!changedSquares.isEmpty()) { fireMapSquaresChangedEvent(changedSquares.toArray(new MapSquare[changedSquares.size()])); + changedSquares.clear(); } } } Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-15 16:28:48 UTC (rev 266) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-08-15 16:30:17 UTC (rev 267) @@ -59,7 +59,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public final class MapControl { +public final class MapControl implements MapModelListener { /** * The main controller of this subcontroller. @@ -126,6 +126,13 @@ private BufferedImage previewImage; /** + * Keep track of changes. + * This field is <code>true</code> if the map was changed after the last save / load operation. + * Therefore this class implements {@link MapModelListener}. + */ + private boolean changed; + + /** * Constructs a new Map. * @param mainControl the CMainControl * @param maparch the <code>MapArchObject</code> of the map @@ -140,6 +147,7 @@ this.isPickmap = isPickmap; // is this a pickmap? // we create model (= data) mapModel = new DefaultMapModel(mainControl, this, objects, maparch); + mapModel.addMapModelListener(this); if (createView) { createView(); } @@ -210,40 +218,13 @@ return levelClosing; } - public boolean addArchToMap(final String archname, final Point pos, final boolean allowDouble, final boolean insertBelow) { - return mapModel.addArchToMap(archname, pos, allowDouble, insertBelow); - } - /** - * wrapper method for addArchToMap, always inserting new arches on top - */ - public boolean addArchToMap(final String archname, final Point pos, final boolean allowDouble) { - return addArchToMap(archname, pos, allowDouble, false); - } - - public boolean insertArchToMap(final ArchObject newarch, final String archname, final ArchObject next, final int mapx, final int mapy) { - return mapModel.insertArchToMap(newarch, archname, next, new Point(mapx, mapy)); - } - - public void addArchObjectToMap(final ArchObject arch, final boolean insertBelow) { - mapModel.addArchObjectToMap(arch, insertBelow); - } - - public void addArchObjectToMap(final ArchObject arch) { - mapModel.addArchObjectToMap(arch, false); - } - - public void deleteMapArch(final ArchObject arch, final boolean refreshMap) { - mapModel.deleteMapArch(arch, refreshMap); - } - - /** * Return whether the level has changed since it was last saved or not. * @return <code>true</code> if level has changed, <code>false</code> if * not */ public boolean isLevelChanged() { - return mapModel.isLevelChanged(); + return changed; } /** @@ -355,10 +336,6 @@ mapArch.setFileName(fname); } - public void setLevelChangedFlag() { - mapModel.setLevelChangedFlag(); - } - /** * Save the level to a file. */ @@ -398,13 +375,10 @@ } } } - mapModel.resetLevelChangedFlag(); - for (final MapViewIFrame mapViewIFrame : mapViewIFrames) { - mapViewIFrame.changedFlagNotify(); - } if (!isPickmap) { saveImages(); } + changed = false; } /** @@ -431,15 +405,13 @@ /** * Save the file with the given file name. + * TODO: This looks like vi's ":w" behaviour, which isn't a good idea to users. Instead behave like ":sav", which means the new file name at the same time will be the file name for future use. + * (Well, CMainControl does that, but that's really the task of MapControl) * @param file The file to be saved to */ public void saveAs(final File file) { mainControl.setStatusText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); - mapModel.resetLevelChangedFlag(); - if (mapViewFrame != null) { - mapViewFrame.changedFlagNotify(); - } } public void setMapFile(final File file) { @@ -483,7 +455,7 @@ if (!mainControl.getMainView().isPickmapActive() || isPickmap() || newarch != null && newarch.isDefaultArch()) { // insert default arch from archlist: mapModel.beginTransaction(); - if (!addArchToMap(mainControl.getPanelArchName(), p, allowMany)) { + if (!mapModel.addArchToMap(mainControl.getPanelArchName(), p, allowMany, false)) { // todo } mapModel.endTransaction(); @@ -504,14 +476,14 @@ if (!newarch.isMulti()) { // insert single tile from pickmap newarch = newarch.createClone(p.x, p.y); - addArchObjectToMap(newarch); + mapModel.addArchObjectToMap(newarch, false); } else { // insert multi tile from pickmap: if (newarch.getMapMultiHead() != null) { newarch = newarch.getMapMultiHead(); } // first insert default arch from archlist - if (!addArchToMap(newarch.getArchName(), p, allowMany)) { + if (!mapModel.addArchToMap(newarch.getArchName(), p, allowMany, false)) { // do nothing } else { // insertion successful, now get redraw info @@ -546,7 +518,7 @@ if (!newarch.isMulti()) { // insert single tile from pickmap newarch = newarch.createClone(p.x, p.y); - addArchObjectToMap(newarch); + mapModel.addArchObjectToMap(newarch, false); } else { // insert multi tile from pickmap: if (newarch.getMapMultiHead() != null) { @@ -565,7 +537,7 @@ } // first insert default arch from archlist - if (!allSpacesFree || !addArchToMap(newarch.getArchName(), p, true)) { + if (!allSpacesFree || !mapModel.addArchToMap(newarch.getArchName(), p, true, false)) { // do nothing } else { // insertion successful, now get redraw info @@ -742,4 +714,19 @@ return mapModel; } + /** {@inheritDoc} */ + public void mapSizeChanged(final MapModelEvent e) { + changed = true; + } + + /** {@inheritDoc} */ + public void mapSquaresChanged(final MapModelEvent e) { + changed = true; + } + + /** {@inheritDoc} */ + public void mapArchesChanged(final MapModelEvent e) { + changed = true; + } + } // class MapControl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 16:29:00
|
Revision: 266 Author: christianhujer Date: 2006-08-15 09:28:48 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=266&view=rev Log Message: ----------- Removed level change information from common interface for refactoring it away from daimonin's MapModel. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapModel.java trunk/src/app/net/sf/gridarta/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-08-15 15:30:55 UTC (rev 265) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-08-15 16:28:48 UTC (rev 266) @@ -87,4 +87,23 @@ MapArchObject getMapArchObject(); + /** + * Reset the level changed flag to false. + * @todo this probably belongs to CMapControl instead + */ + void resetLevelChangedFlag(); + + /** + * Set the level changed flag to true. + * @todo this probably belongs to CMapControl instead + */ + void setLevelChangedFlag(); + + /** + * Return whether the level has changed since it was last saved or not. + * @return <code>true</code> if level has changed, <code>false</code> if not. + * @todo this probably belongs to CMapControl instead + */ + boolean isLevelChanged(); + } // interface MapModel Modified: trunk/src/app/net/sf/gridarta/map/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModel.java 2006-08-15 15:30:55 UTC (rev 265) +++ trunk/src/app/net/sf/gridarta/map/MapModel.java 2006-08-15 16:28:48 UTC (rev 266) @@ -41,25 +41,6 @@ boolean isPointValid(@Nullable Point pos); /** - * Reset the level changed flag to false. - * @todo this probably belongs to CMapControl instead - */ - void resetLevelChangedFlag(); - - /** - * Set the level changed flag to true. - * @todo this probably belongs to CMapControl instead - */ - void setLevelChangedFlag(); - - /** - * Return whether the level has changed since it was last saved or not. - * @return <code>true</code> if level has changed, <code>false</code> if not. - * @todo this probably belongs to CMapControl instead - */ - boolean isLevelChanged(); - - /** * Returns the Map Arch Object with the meta information about the map. * @return the Map Arch Object with the meta information about the map */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:31:06
|
Revision: 265 Author: christianhujer Date: 2006-08-15 08:30:55 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=265&view=rev Log Message: ----------- Cosmetic improvements (match method parameter names with superclass / interface). Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/map/MapUserListener.java Modified: trunk/daimonin/src/daieditor/gui/map/MapUserListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-08-15 15:25:14 UTC (rev 264) +++ trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-08-15 15:30:55 UTC (rev 265) @@ -58,8 +58,8 @@ } /** {@inheritDoc} */ - public void mouseClicked(final MouseEvent event) { - final MouseOpListener mouseOpListener = getMouseOperation(event); + public void mouseClicked(final MouseEvent e) { + final MouseOpListener mouseOpListener = getMouseOperation(e); if (mouseOpListener != null) { mouseOpListener.clicked(mouseOpEvent); } @@ -77,48 +77,47 @@ } /** {@inheritDoc} */ - public void mouseEntered(final MouseEvent event) { + public void mouseEntered(final MouseEvent e) { /* ignore */ } /** {@inheritDoc} */ - public void mouseExited(final MouseEvent event) { + public void mouseExited(final MouseEvent e) { /* ignore */ } /** {@inheritDoc} */ - public void mouseDragged(final MouseEvent event) { - final MouseOpListener mouseOpListener = getMouseOperation(event); + public void mouseDragged(final MouseEvent e) { + final MouseOpListener mouseOpListener = getMouseOperation(e); if (mouseOpListener != null) { mouseOpListener.dragged(mouseOpEvent); } } /** {@inheritDoc} */ - public void mouseMoved(final MouseEvent event) { - final MouseOpListener mouseOpListener = getMouseOperation(event); + public void mouseMoved(final MouseEvent e) { + final MouseOpListener mouseOpListener = getMouseOperation(e); if (mouseOpListener != null) { mouseOpListener.moved(mouseOpEvent); } } /** {@inheritDoc} */ - public void mousePressed(final MouseEvent event) { + public void mousePressed(final MouseEvent e) { // in "locked pickmaps" mode, pickmaps react only to leftclicks assert mapControl != null; - if (mapControl.isPickmap() && mainControl.isLockAllPickmaps() && !(event.getModifiers() == MouseEvent.BUTTON1_MASK && !event.isShiftDown() && !event.isControlDown())) - { + if (mapControl.isPickmap() && mainControl.isLockAllPickmaps() && !(e.getModifiers() == MouseEvent.BUTTON1_MASK && !e.isShiftDown() && !e.isControlDown())) { return; } - final MouseOpListener mouseOpListener = getMouseOperation(event); + final MouseOpListener mouseOpListener = getMouseOperation(e); if (mouseOpListener != null) { mouseOpListener.pressed(mouseOpEvent); } } /** {@inheritDoc} */ - public void mouseReleased(final MouseEvent event) { - final MouseOpListener mouseOpListener = getMouseOperation(event); + public void mouseReleased(final MouseEvent e) { + final MouseOpListener mouseOpListener = getMouseOperation(e); if (mouseOpListener != null) { mouseOpListener.released(mouseOpEvent); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:25:22
|
Revision: 264 Author: christianhujer Date: 2006-08-15 08:25:14 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=264&view=rev Log Message: ----------- Replaced assertSame with assertEquals to prevent unnecessary boxing. Modified Paths: -------------- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java Modified: trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-08-15 15:22:19 UTC (rev 263) +++ trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-08-15 15:25:14 UTC (rev 264) @@ -401,9 +401,9 @@ /** Test if number of events fired is correct */ private void testEvents(final int nPos, final int nMode) { - assertSame("Position change event", nPos, changedPosCounter); + assertEquals("Position change event", nPos, changedPosCounter); changedPosCounter = 0; - assertSame("Mode change event", nMode, changedModeCounter); + assertEquals("Mode change event", nMode, changedModeCounter); changedModeCounter = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:22:29
|
Revision: 263 Author: christianhujer Date: 2006-08-15 08:22:19 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=263&view=rev Log Message: ----------- Minor unification and improvements of ScriptArchData. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/daimonin/src/daieditor/ScriptArchData.java Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-08-15 15:21:30 UTC (rev 262) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-08-15 15:22:19 UTC (rev 263) @@ -33,7 +33,8 @@ import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; -import java.util.Vector; +import java.util.ArrayList; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -47,6 +48,7 @@ import javax.swing.JPanel; import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; +import net.sf.japi.util.Arrays2; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -54,6 +56,7 @@ * Stores and manages information about scripted events. * This data is only needed for those arches with one or more events defined. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @XXX This class is designed very badly, as it combines model and presentation. */ public final class ScriptArchData { @@ -95,11 +98,14 @@ private static JTextField inputEventOptions; - private final Vector eventList; // contains list of ScriptedEvents + // FIXME: This should NOT BE HERE. Instead, it should be read from types.xml. + private static final String[] allEventTypes = new String[]{" apply", " attack", " close", " death", " drop", " pickup", " say", " stop", " time", " throw", " trigger"}; + private final List<ScriptedEvent> eventList; // contains list of ScriptedEvents + /** Constructor */ public ScriptArchData() { - eventList = new Vector(); + eventList = new ArrayList<ScriptedEvent>(); if (eventTypeBox == null) { initEventTypeBoxes(); } @@ -107,16 +113,11 @@ /** Initialize the JComboBox with the event types. */ private static synchronized void initEventTypeBoxes() { - final String[] allEventTypes = new String[]{" apply", " attack", " close", - " death", " drop", " pickup", " say", " stop", " time", " throw", " trigger"}; - pluginNameBox = new JComboBox(new String[]{" Python"}); pluginNameBox.setSelectedIndex(0); - pluginNameBox.setBackground(Color.white); eventTypeBox = new JComboBox(allEventTypes); - eventTypeBox.setSelectedIndex(6); - eventTypeBox.setBackground(Color.white); + eventTypeBox.setSelectedIndex(Arrays2.linearEqualitySearch(" say", allEventTypes)); } /** @@ -137,7 +138,7 @@ if (index == -1) { event = new ScriptedEvent(eventType); } else { - event = (ScriptedEvent) (eventList.elementAt(index)); + event = eventList.get(index); } // set new event data: @@ -151,9 +152,9 @@ // save changes: if (index == -1) { - eventList.addElement(event); + eventList.add(event); } else { - eventList.setElementAt(event, index); + eventList.set(index, event); } } @@ -166,7 +167,7 @@ private int getScriptedEvent(final String eventType) { if (eventList != null && eventList.size() > 0) { for (int i = 0; i < eventList.size(); i++) { - final ScriptedEvent se = (ScriptedEvent) (eventList.elementAt(i)); + final ScriptedEvent se = eventList.get(i); if (se.getEventType().equalsIgnoreCase(eventType)) { // we found a matching ScriptedEvent! return i; @@ -189,12 +190,12 @@ int numEvents = eventList.size(); for (int i = 0; i < numEvents; i++) { - final ScriptedEvent se = (ScriptedEvent) eventList.elementAt(i); + final ScriptedEvent se = eventList.get(i); // validate this event if (!se.isValid()) { // this event is invalid log.info("-> Deleting invalid event..."); - eventList.removeElementAt(i); + eventList.remove(i); numEvents--; // adjust indices for removed element i--; } @@ -217,7 +218,7 @@ if (eventList != null && eventList.size() > 0) { for (int i = 0; i < eventList.size(); i++) { - final ScriptedEvent se = (ScriptedEvent) eventList.elementAt(i); + final ScriptedEvent se = eventList.get(i); buff.append(se.getMapArchText()); } } @@ -233,7 +234,7 @@ public void addEventsToJList(final JList list) { final String[] content = new String[eventList.size()]; for (int i = 0; i < eventList.size(); i++) { - content[i] = " " + ((ScriptedEvent) (eventList.elementAt(i))).getEventType(); + content[i] = " " + eventList.get(i).getEventType(); } list.setListData(content); @@ -250,7 +251,7 @@ for (int i = 0; i < eventList.size(); i++) { // clone every ScriptedEvent in the event list - clone.eventList.addElement(((ScriptedEvent) (eventList.elementAt(i))).getClone()); + clone.eventList.add(eventList.get(i).getClone()); } return clone; @@ -275,25 +276,21 @@ final int index = getScriptedEvent(eventType); if (index >= 0) { - final ScriptedEvent event = (ScriptedEvent) (eventList.elementAt(index)); + final ScriptedEvent event = eventList.get(index); // now decide what to do: if (task == CMapArchPanel.SCRIPT_OPEN) { event.openScript(); } else if (task == CMapArchPanel.SCRIPT_EDIT_PATH) { // show popup to edit file path and plugin name event.editScriptPath(); - eventList.setElementAt(event, index); // save changes + eventList.set(index, event); // save changes } else if (task == CMapArchPanel.SCRIPT_REMOVE) { // first ask for confirmation final boolean breakpath = (event.getFilePath().length() > 15); - if (JOptionPane.showConfirmDialog(CMainControl.getInstance().getMainView(), - "Are you sure you want to remove this \"" + eventType + "\" event which is\n" + - "linked to the script: '" + event.getFilePath() + "'?\n" + - "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, - JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) { + if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + eventType + "\" event which is\n" + "linked to the script: '" + event.getFilePath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { // remove this event from the ArchObject - eventList.removeElementAt(index); - this.addEventsToJList(panelList); // update panel JList + eventList.remove(index); + addEventsToJList(panelList); // update panel JList } } } else { @@ -551,9 +548,9 @@ // file exists -> link it to the event final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, eventOptions); if (replaceIndex == -1) { - eventList.addElement(event); + eventList.add(event); } else { - eventList.setElementAt(event, replaceIndex); + eventList.set(replaceIndex, event); } frame.setVisible(false); // close dialog } @@ -579,9 +576,9 @@ // file has been created, now link it to the event final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, eventOptions); if (replaceIndex != -1) { - eventList.setElementAt(event, replaceIndex); + eventList.set(replaceIndex, event); } else { - eventList.addElement(event); + eventList.add(event); } frame.setVisible(false); // close dialog @@ -825,7 +822,7 @@ * Small class, listening for button-press events in the popup frame for * script paths or create-new-event frame. */ - private final class PathButtonListener implements ActionListener { + private static final class PathButtonListener implements ActionListener { private final JDialog frame; Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-08-15 15:21:30 UTC (rev 262) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-08-15 15:22:19 UTC (rev 263) @@ -49,6 +49,7 @@ import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.util.Arrays2; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -56,6 +57,7 @@ * Stores and manages information about scripted events. * This data is only needed for those arches with one or more events defined. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @XXX This class is designed very badly, as it combines model and presentation. */ public final class ScriptArchData { @@ -114,7 +116,7 @@ pluginNameBox.setSelectedIndex(0); eventTypeBox = new JComboBox(allEventTypes); - eventTypeBox.setSelectedIndex(5); + eventTypeBox.setSelectedIndex(Arrays2.linearEqualitySearch(" say", allEventTypes)); } /* @@ -192,7 +194,7 @@ ArchObject oldEvent = null; /* Find the event object */ - for (ArchObject tmp : owner) { + for (final ArchObject tmp : owner) { if (tmp.getArchTypNr() == 118) { if (eventIndex == 0) { oldEvent = tmp; @@ -214,11 +216,10 @@ } else if (task == CMapArchPanel.SCRIPT_REMOVE) { // first ask for confirmation //boolean breakpath = (event.getFilePath().length() > 15); - if (JOptionPane.showConfirmDialog(CMainControl.getInstance().getMainView(), "Are you sure you want to remove this \"" + typeName(event.getEventType()) + "\" event which is\n" + "linked to the script: '" + event.getFilePath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) - { + if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + typeName(event.getEventType()) + "\" event which is\n" + "linked to the script: '" + event.getFilePath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { // remove this event from the ArchObject oldEvent.remove(); - this.addEventsToJList(panelList); // update panel JList + addEventsToJList(panelList); // update panel JList changed = true; } } @@ -789,7 +790,7 @@ * Small class, listening for button-press events in the popup frame for * script paths or create-new-event frame. */ - private final class PathButtonListener implements ActionListener { + private static final class PathButtonListener implements ActionListener { private final JDialog frame; @@ -823,13 +824,13 @@ public void actionPerformed(final ActionEvent e) { if (isOkButton && sdata == null && target != null) { target.modifyEventPath(); // ok button for modifying path - changed = true; + sdata.changed = true; } if (isOkButton && sdata != null) { // ok button for creating a new event/script sdata.createNewEvent(frame); - changed = true; + sdata.changed = true; } else { frame.setVisible(false); // hide dialog } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:21:35
|
Revision: 262 Author: christianhujer Date: 2006-08-15 08:21:30 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=262&view=rev Log Message: ----------- Added comment for bad code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/arch/ArchObject.java Modified: trunk/crossfire/src/cfeditor/arch/ArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-08-15 15:21:16 UTC (rev 261) +++ trunk/crossfire/src/cfeditor/arch/ArchObject.java 2006-08-15 15:21:30 UTC (rev 262) @@ -1395,6 +1395,7 @@ * @param eventList JList from the MapArchPanel (script tab) which displays * the events * @param mapanel the MapArchPanel + * @XXX this method knows things it should never know, it is evil! */ public void modifyEventScript(final String eventType, final int task, final JList eventList, final CMapArchPanel mapanel) { if (script != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:21:25
|
Revision: 261 Author: christianhujer Date: 2006-08-15 08:21:16 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=261&view=rev Log Message: ----------- Removed unused face object field. Modified Paths: -------------- trunk/daimonin/src/daieditor/arch/ArchObject.java Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-15 15:20:16 UTC (rev 260) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-08-15 15:21:16 UTC (rev 261) @@ -65,9 +65,6 @@ /** Face name, can be from animation or face. */ private String faceObjName; - /** Face Object (matches faceObjName). */ - private FaceObject faceObject; - /** Object face name <code>face <var>name</var></code>. */ private String faceRealName; @@ -915,10 +912,8 @@ private void setFaceObjName(final String faceObjName) { if (faceObjName != null) { this.faceObjName = faceObjName.intern(); - faceObject = CMainControl.getInstance().getFaceObjects().get(this.faceObjName); } else { this.faceObjName = null; - faceObject = null; } } @@ -929,7 +924,6 @@ // face name public void setFaceRealName(final String faceRealName) { this.faceRealName = faceRealName != null ? faceRealName.intern() : null; - } public String getFaceRealName() { @@ -1102,11 +1096,6 @@ } /** Get the normal face. */ - public ImageIcon getDisplayIcon() { - return normalFace; - } - - /** Get the normal face. */ public ImageIcon getNormalImage() { return normalFace; } @@ -1279,6 +1268,7 @@ * @param eventList JList from the MapArchPanel (script tab) which displays * the events * @param mapanel the MapArchPanel + * @XXX this method knows things it should never know, it is evil! */ public boolean modifyEventScript(final int eventType, final int task, final JList eventList, final CMapArchPanel mapanel) { final boolean changed = script.modifyEventScript(eventType, task, eventList); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-08-15 15:20:21
|
Revision: 260 Author: christianhujer Date: 2006-08-15 08:20:16 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=260&view=rev Log Message: ----------- Fixed class comment. Modified Paths: -------------- trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java Modified: trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java =================================================================== --- trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-08-15 15:19:46 UTC (rev 259) +++ trunk/crossfire/src/cfeditor/TrackedBufferedInputStream.java 2006-08-15 15:20:16 UTC (rev 260) @@ -13,10 +13,8 @@ import org.apache.log4j.Logger; /** + * A BufferedInputStream that keeps track of its current position. * @author tchize - * <p/> - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates */ public final class TrackedBufferedInputStream extends BufferedInputStream { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |