From: <aki...@us...> - 2010-05-23 12:37:53
|
Revision: 7917 http://gridarta.svn.sourceforge.net/gridarta/?rev=7917&view=rev Author: akirschbaum Date: 2010-05-23 12:37:46 +0000 (Sun, 23 May 2010) Log Message: ----------- Implement #1717845 (Multitile paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/utils/MathUtils.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/atrinik/ChangeLog 2010-05-23 12:37:46 UTC (rev 7917) @@ -1,3 +1,9 @@ +2010-05-23 Andreas Kirschbaum + + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + the copy buffer into the selection. If the selection is larger + than the copy buffer, tiling happens. + 2010-05-22 Andreas Kirschbaum * Fix "Generate Preview" to regenerate previews for all selected Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -26,7 +26,7 @@ # Menus main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit -edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta @@ -41,7 +41,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap -mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/crossfire/ChangeLog 2010-05-23 12:37:46 UTC (rev 7917) @@ -1,3 +1,9 @@ +2010-05-23 Andreas Kirschbaum + + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + the copy buffer into the selection. If the selection is larger + than the copy buffer, tiling happens. + 2010-05-22 Andreas Kirschbaum * Fix "Generate Preview" to regenerate previews for all selected Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -26,7 +26,7 @@ # Menus main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit -edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta @@ -41,7 +41,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap -mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection mapwindowMap.menu=gridVisible smoothing enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/daimonin/ChangeLog 2010-05-23 12:37:46 UTC (rev 7917) @@ -1,3 +1,9 @@ +2010-05-23 Andreas Kirschbaum + + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste + the copy buffer into the selection. If the selection is larger + than the copy buffer, tiling happens. + 2010-05-22 Andreas Kirschbaum * Fix "Generate Preview" to regenerate previews for all selected Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -26,7 +26,7 @@ # Menus main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit -edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta @@ -41,7 +41,7 @@ mapwindow.menubar=mapwindowFile mapwindowEdit mapwindowMap mapwindowCursor mapwindowFile.menu=saveMap saveMapAs createImage - revertMap - closeMap -mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection +mapwindowEdit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects mapwindowCursor.menu=moveCursor - exitConnector - selectSquare startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2010-05-23 12:37:46 UTC (rev 7917) @@ -37,6 +37,7 @@ import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.mapviewsettings.MapViewSettings; +import net.sf.gridarta.utils.MathUtils; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; @@ -175,7 +176,6 @@ * Executing the Paste command. * @param mapView the map view to paste on * @param startLocation the location to paste into - * @todo paste only sub-regions when a region is selected */ public void paste(@NotNull final MapView<G, A, R> mapView, @NotNull final Point startLocation) { final MapModel<G, A, R> mapModel2 = mapView.getMapControl().getMapModel(); @@ -210,6 +210,49 @@ } /** + * Executing the Paste Tiled command. + * @param mapView the map view to paste on + * @param selectedSquares the square to paste into + * @param origin the origin where to start pasting + */ + public void pasteTiled(@NotNull final MapView<G, A, R> mapView, @NotNull final Iterable<MapSquare<G, A, R>> selectedSquares, @NotNull final Point origin) { + final Point sourcePoint = new Point(); + final Point destinationPoint = new Point(); + final MapModel<G, A, R> mapModel2 = mapView.getMapControl().getMapModel(); + final Size2D mapModelSize = mapModel.getMapSize(); + mapModel2.beginTransaction("Paste"); // TODO: I18N/L10N + try { + for (final MapSquare<G, A, R> destinationMapSquare : selectedSquares) { + sourcePoint.x = MathUtils.mod(destinationMapSquare.getMapX() - origin.x, mapModelSize.getWidth()); + sourcePoint.y = MathUtils.mod(destinationMapSquare.getMapY() - origin.y, mapModelSize.getHeight()); + final MapSquare<G, A, R> sourceMapSquare = mapModel.getMapSquare(sourcePoint); + for (final BaseObject<G, A, R, ?> gameObject : sourceMapSquare) { + if (!gameObject.isMulti()) { + destinationPoint.x = destinationMapSquare.getMapX(); + destinationPoint.y = destinationMapSquare.getMapY(); + mapModel2.addCopyToMap(gameObject, destinationPoint, true, insertionModeSet.getTopmostInsertionMode()); + } + } + } + + for (final MapSquare<G, A, R> destinationMapSquare : selectedSquares) { + sourcePoint.x = MathUtils.mod(destinationMapSquare.getMapX() - origin.x, mapModelSize.getWidth()); + sourcePoint.y = MathUtils.mod(destinationMapSquare.getMapY() - origin.y, mapModelSize.getHeight()); + final MapSquare<G, A, R> sourceMapSquare = mapModel.getMapSquare(sourcePoint); + for (final BaseObject<G, A, R, ?> gameObject : sourceMapSquare) { + if (gameObject.isMulti()) { + destinationPoint.x = destinationMapSquare.getMapX(); + destinationPoint.y = destinationMapSquare.getMapY(); + mapModel2.addCopyToMap(gameObject, destinationPoint, true, insertionModeSet.getTopmostInsertionMode()); + } + } + } + } finally { + mapModel2.endTransaction(); + } + } + + /** * Return all game objects. Only top-level head parts are returned; tail * parts are ignored as are objects in inventories. * @return all game objects Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-23 12:37:46 UTC (rev 7917) @@ -245,6 +245,12 @@ private final Action aPaste; /** + * Action called for "paste tiled". + */ + @NotNull + private final Action aPasteTiled; + + /** * Action called for "replace". */ @NotNull @@ -429,6 +435,7 @@ aCut = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "cut"); aCopy = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "copy"); aPaste = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "paste"); + aPasteTiled = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "pasteTiled"); aShiftNorth = ActionUtils.newAction(ACTION_BUILDER, "Map/Shift", this, "shiftNorth"); aShiftNorthEast = ActionUtils.newAction(ACTION_BUILDER, "Map/Shift", this, "shiftNorthEast"); aShiftEast = ActionUtils.newAction(ACTION_BUILDER, "Map/Shift", this, "shiftEast"); @@ -664,6 +671,7 @@ aCut.setEnabled(doCut(false)); aCopy.setEnabled(doCopy(false)); aPaste.setEnabled(doPaste(false)); + aPasteTiled.setEnabled(doPasteTiled(false)); aShiftNorth.setEnabled(doShift(false, 0)); aShiftNorthEast.setEnabled(doShift(false, 4)); aShiftEast.setEnabled(doShift(false, 1)); @@ -722,6 +730,14 @@ } /** + * "Paste Tiled" was selected from the Edit menu. + */ + @ActionMethod + public void pasteTiled() { + doPasteTiled(true); + } + + /** * "Shift North" was selected from the Edit menu. */ @ActionMethod @@ -1031,6 +1047,48 @@ } /** + * Executes the "paste tiled" action. + * @param performAction whether the action should be performed + * @return whether the action was or can be performed + */ + private boolean doPasteTiled(final boolean performAction) { + final MapView<G, A, R> mapView = currentMapView; + if (mapView == null) { + return false; + } + + final Point startLocation = mapView.getMapViewBasic().getMapCursor().getLocation(); + if (startLocation == null) { + return false; + } + + if (copyBuffer.isEmpty()) { + return false; + } + + final MapViewBasic<G,A,R> mapViewBasic = mapView.getMapViewBasic(); + final List<MapSquare<G, A, R>> selectedSquares = mapViewBasic.getSelectedSquares(); + if (selectedSquares.isEmpty()) { + return false; + } + + final MapGrid mapGrid = mapViewBasic.getMapGrid(); + final Rectangle selectedRec = mapGrid.getSelectedRec(); + if (selectedRec == null) { + return false; + } + + if (performAction) { + final MapCursor mapCursor = mapViewBasic.getMapCursor(); + final Point cursorLocation = mapCursor.getLocation(); + final Point origin = cursorLocation == null ? selectedRec.getLocation() : cursorLocation; + copyBuffer.pasteTiled(mapView, selectedSquares, origin); + } + + return true; + } + + /** * Executes the "shift" action. * @param performAction whether the action should be performed * @param direction the direction to shift Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -724,6 +724,10 @@ paste.shortdescription=Pastes the clipboard to map cursor. paste.accel=ctrl pressed V +pasteTiled.text=Paste Tiled +pasteTiled.shortdescription=Pastes the clipboard to selected map squares. +pasteTiled.longdescription=Pastes the clipboard to selected map squares. Pastes the clipboard as tiles if the clipboard''s size is smaller than the selected area. + shift.text=Shift shift.shortdescription=Shifts the selected squares. shift.mnemonic=H Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -679,6 +679,10 @@ paste.mnemonic=E paste.shortdescription=Kopiert die Zwischenablage an das Cursor-Feld. +pasteTiled=Gekachelt einf\xFCgen +pasteTiled.shortdescription=Kopiert die Zwischenablage in die ausgew\xE4hlten Felder. +pasteTiled.longdescription=Kopiert die Zwischenablage in die ausgew\xE4hlten Felder. Falls the Zwischenablage kleiner als die ausgew\xE4hlten Felder ist, wird gekachelt. + shift.text=Verschieben shift.mnemonic=V shift.shortdescription=Verschiebt die ausgew\xE4hlten Felder. Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -671,6 +671,10 @@ paste.mnemonic=L #paste.shortdescription= +#pasteTiled.text= +#pasteTiled.shortdescription= +#pasteTiled.longdescription= + #shift.text= shift.mnemonic=S #shift.shortdescription= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-23 12:08:06 UTC (rev 7916) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-05-23 12:37:46 UTC (rev 7917) @@ -677,6 +677,10 @@ paste.mnemonic=L #paste.shortdescription= +#pasteTiled.text= +#pasteTiled.shortdescription= +#pasteTiled.longdescription= + #shift.text= #shift.mnemonic= #shift.shortdescription= Added: trunk/src/app/net/sf/gridarta/utils/MathUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/MathUtils.java (rev 0) +++ trunk/src/app/net/sf/gridarta/utils/MathUtils.java 2010-05-23 12:37:46 UTC (rev 7917) @@ -0,0 +1,47 @@ +/* + * This file is part of JXClient, the Fullscreen Java Crossfire Client. + * + * JXClient 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. + * + * JXClient 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 JXClient; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Copyright (C) 2005-2008 Yann Chachkoff. + * Copyright (C) 2006-2010 Andreas Kirschbaum. + */ + +package net.sf.gridarta.utils; + +/** + * Utility class for mathematical functions. + * @author Andreas Kirschbaum + */ +public class MathUtils { + + /** + * Private constructor to prevent instantiation. + */ + private MathUtils() { + } + + /** + * Calculates the remainder of <code>a/b</code>. + * @param numerator the numerator + * @param denominator the denominator + * @return the quotient + */ + public static int mod(final int numerator, final int denominator) { + final int result = numerator % denominator; + return result < 0 ? result + denominator : result; + } + +} // class MathUtils Property changes on: trunk/src/app/net/sf/gridarta/utils/MathUtils.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 13:06:54
|
Revision: 7923 http://gridarta.svn.sourceforge.net/gridarta/?rev=7923&view=rev Author: akirschbaum Date: 2010-05-23 13:06:48 +0000 (Sun, 23 May 2010) Log Message: ----------- Suppress warning. Modified Paths: -------------- trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-05-23 13:06:16 UTC (rev 7922) +++ trunk/gridarta.ipr 2010-05-23 13:06:48 UTC (rev 7923) @@ -1151,6 +1151,7 @@ <w>resize</w> <w>resized</w> <w>resizes</w> + <w>rethrown</w> <w>shortdescription</w> <w>startup</w> <w>teleporter</w> Modified: trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-05-23 13:06:16 UTC (rev 7922) +++ trunk/src/app/net/sf/gridarta/mapmanager/AbstractMapManager.java 2010-05-23 13:06:48 UTC (rev 7923) @@ -223,6 +223,7 @@ @NotNull private MapReader<G, A> decodeMapFile(@NotNull final File file, final boolean interactive) throws IOException { final MapReader<G, A> decoder; + //noinspection ErrorNotRethrown try { decoder = mapReaderFactory.newMapReader(file); } catch (final OutOfMemoryError ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 14:55:50
|
Revision: 7931 http://gridarta.svn.sourceforge.net/gridarta/?rev=7931&view=rev Author: akirschbaum Date: 2010-05-23 14:55:44 +0000 (Sun, 23 May 2010) Log Message: ----------- Replace null return value with exception. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:01:00 UTC (rev 7930) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:55:44 UTC (rev 7931) @@ -22,7 +22,6 @@ import net.sf.gridarta.gui.scripts.AbstractScriptArchUtils; import net.sf.gridarta.utils.Pair; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DefaultScriptArchUtils extends AbstractScriptArchUtils { @@ -39,7 +38,7 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override public String getArchetypeNameForEventType(final int eventType) { return "event_obj"; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:01:00 UTC (rev 7930) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:55:44 UTC (rev 7931) @@ -20,9 +20,9 @@ package net.sf.gridarta.var.crossfire.gui.scripts; import net.sf.gridarta.gui.scripts.AbstractScriptArchUtils; +import net.sf.gridarta.model.scripts.UndefinedEventArchetypeTypeException; import net.sf.gridarta.utils.Pair; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DefaultScriptArchUtils extends AbstractScriptArchUtils { @@ -39,11 +39,15 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override - public String getArchetypeNameForEventType(final int eventType) { + public String getArchetypeNameForEventType(final int eventType) throws UndefinedEventArchetypeTypeException { final String typeName = getEventType(eventType); - return typeName != null ? "event_" + typeName : null; + if (typeName == null) { + throw new UndefinedEventArchetypeTypeException(eventType); + } + + return "event_" + typeName; } } // class DefaultScriptArchUtils Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:01:00 UTC (rev 7930) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/DefaultScriptArchUtils.java 2010-05-23 14:55:44 UTC (rev 7931) @@ -22,7 +22,6 @@ import net.sf.gridarta.gui.scripts.AbstractScriptArchUtils; import net.sf.gridarta.utils.Pair; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public class DefaultScriptArchUtils extends AbstractScriptArchUtils { @@ -39,7 +38,7 @@ /** * {@inheritDoc} */ - @Nullable + @NotNull @Override public String getArchetypeNameForEventType(final int eventType) { return "event_obj"; Modified: trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java 2010-05-23 14:01:00 UTC (rev 7930) +++ trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEventFactory.java 2010-05-23 14:55:44 UTC (rev 7931) @@ -70,9 +70,6 @@ @Override public G newEventGameObject(final int eventType) throws UndefinedEventArchetypeException { final String eventArchetypeName = scriptArchUtils.getArchetypeNameForEventType(eventType); - if (eventArchetypeName == null) { - throw new UndefinedEventArchetypeTypeException(eventType); - } final R eventArchetype = archetypeSet.getArchetype(eventArchetypeName); if (eventArchetype == null) { throw new UndefinedEventArchetypeNameException(eventArchetypeName); Modified: trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2010-05-23 14:01:00 UTC (rev 7930) +++ trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchUtils.java 2010-05-23 14:55:44 UTC (rev 7931) @@ -22,7 +22,6 @@ import javax.swing.JList; import net.sf.gridarta.model.gameobject.GameObject; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; public interface ScriptArchUtils { @@ -37,11 +36,12 @@ /** * Returns the archetype for an event type. * @param eventType the event type - * @return the archetype name, or <code>null</code> if the event type is - * invalid + * @return the archetype name + * @throws UndefinedEventArchetypeTypeException if the event type is + * undefined */ - @Nullable - String getArchetypeNameForEventType(int eventType); + @NotNull + String getArchetypeNameForEventType(int eventType) throws UndefinedEventArchetypeTypeException; /** * Converts a combo box index to an event type. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 15:41:00
|
Revision: 7933 http://gridarta.svn.sourceforge.net/gridarta/?rev=7933&view=rev Author: akirschbaum Date: 2010-05-23 15:40:53 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{get,set}Multi{X,Y}() to Archetype. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -103,8 +103,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); gameObject.setLowestPart(archetype.isLowestPart()); gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -305,8 +305,8 @@ } else { // this is an oversized image, so it must be shifted // XXX: it must also be clipped to not overwrite filter information - offset.x = IGUIConstants.SQUARE_WIDTH * (node.getMultiX() - node.getMinX()); - offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getMultiY() - node.getMinY()); + offset.x = IGUIConstants.SQUARE_WIDTH * (node.getArchetype().getMultiX() - node.getMinX()); + offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getArchetype().getMultiY() - node.getMinY()); } g.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -123,8 +123,8 @@ yy = 0; } else { // this is an oversized image, so it must be shifted - xx = IGUIConstants.SQUARE_WIDTH * (node.getMultiX() - node.getMinX()); - yy = IGUIConstants.SQUARE_HEIGHT * (node.getMultiY() - node.getMinY()); + xx = IGUIConstants.SQUARE_WIDTH * (node.getArchetype().getMultiX() - node.getMinX()); + yy = IGUIConstants.SQUARE_HEIGHT * (node.getArchetype().getMultiY() - node.getMinY()); } grfx.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, xx, yy, xx + IGUIConstants.SQUARE_WIDTH, yy + IGUIConstants.SQUARE_HEIGHT, this); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -156,8 +156,8 @@ offset.y = 0; } else { // this is an oversized image, so it must be shifted - offset.x = IGUIConstants.SQUARE_WIDTH * (node.getMultiX() - node.getMinX()); - offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getMultiY() - node.getMinY()); + offset.x = IGUIConstants.SQUARE_WIDTH * (node.getArchetype().getMultiX() - node.getMinX()); + offset.y = IGUIConstants.SQUARE_HEIGHT * (node.getArchetype().getMultiY() - node.getMinY()); } grfx.drawImage(img.getImage(), point.x * IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT, point.x * IGUIConstants.SQUARE_WIDTH + IGUIConstants.SQUARE_WIDTH, point.y * IGUIConstants.SQUARE_HEIGHT + IGUIConstants.SQUARE_HEIGHT, offset.x, offset.y, offset.x + IGUIConstants.SQUARE_WIDTH, offset.y + IGUIConstants.SQUARE_HEIGHT, this); if (node.getAttributeInt("smoothlevel", true) > 0) { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -92,8 +92,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects); - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); if (head != null) { head.addTailPart(gameObject); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -103,8 +103,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); gameObject.setLowestPart(archetype.isLowestPart()); gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -78,7 +78,7 @@ final G clone = gameObjectFactory.cloneGameObject(gameObject, posx, posy); mapModel.addGameObjectToMap(clone, insertionModeSet.getTopmostInsertionMode()); } - if (gameObject.getMultiX() >= 0 && gameObject.getMultiY() >= 0) { + if (gameObject.getArchetype().getMultiX() >= 0 && gameObject.getArchetype().getMultiY() >= 0) { gameObjectsToDelete.add(gameObject.getHead()); } } Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -44,6 +44,20 @@ private String archetypeName; /** + * The x-distance of this part to the head part. Set to zero for single-part + * objects. + * @serial + */ + private int multiX = 0; + + /** + * The y-distance of this part to the head part. Set to zero for single-part + * objects. + * @serial + */ + private int multiY = 0; + + /** * Creates a new instance. * @param archetypeName the name of the archetype * @param faceObjectProviders the face object providers for looking up @@ -171,4 +185,36 @@ } } + /** + * {@inheritDoc} + */ + @Override + public void setMultiX(final int multiX) { + this.multiX = multiX; + } + + /** + * {@inheritDoc} + */ + @Override + public void setMultiY(final int multiY) { + this.multiY = multiY; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMultiX() { + return multiX; + } + + /** + * {@inheritDoc} + */ + @Override + public int getMultiY() { + return multiY; + } + } // class AbstractArchetype Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -299,7 +299,7 @@ * @param out the writer collecting into * @throws IOException if an I/O error occurs */ - private static void collectStartArch(@NotNull final BaseObject<?, ?, ?, ?> arch, @NotNull final Writer out) throws IOException { + private static void collectStartArch(@NotNull final Archetype<?, ?, ?> arch, @NotNull final Writer out) throws IOException { out.append("Object ").append(arch.getArchetypeName()).append('\n'); // map object hack: x/y is normally a reference for multi Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -93,4 +93,32 @@ */ boolean isUndefinedArchetype(); + /** + * Set the x-position of this part of a multi-part object. The x-position is + * relative to the head part. + * @param multiX the x-distance of this part to the head part + */ + void setMultiX(int multiX); + + /** + * Set the y-position of this part of a multi-part object. The y-position is + * relative to the head part. + * @param multiY the y-distance of this part to the head part + */ + void setMultiY(int multiY); + + /** + * Get the x-distance of this part to the head part. For single-part objects + * this is always zero. + * @return the x-distance of this part to the head part + */ + int getMultiX(); + + /** + * Get the y-distance of this part to the head part. For single-part objects + * this is always zero. + * @return the y-distance of this part to the head part + */ + int getMultiY(); + } // interface Archetype Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -129,20 +129,6 @@ private int mapy = 0; /** - * The x-distance of this part to the head part. Set to zero for single-part - * objects. - * @serial - */ - private int multiX = 0; - - /** - * The y-distance of this part to the head part. Set to zero for single-part - * objects. - * @serial - */ - private int multiY = 0; - - /** * Data for multi-square-arches. Stays <code>null</code> for * singlesquare-arches. * @serial @@ -889,41 +875,9 @@ * {@inheritDoc} */ @Override - public void setMultiX(final int multiX) { - this.multiX = multiX; - } - - /** - * {@inheritDoc} - */ - @Override - public void setMultiY(final int multiY) { - this.multiY = multiY; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMultiX() { - return multiX; - } - - /** - * {@inheritDoc} - */ - @Override - public int getMultiY() { - return multiY; - } - - /** - * {@inheritDoc} - */ - @Override public boolean isDefaultGameObject() { final BaseObject<G, A, R, ?> archetype = getArchetype(); - return archetype != null && artifact == archetype.isArtifact() && getArchetypeName().equals(archetype.getArchetypeName()) && objName.equals(archetype.getObjName()) && !gameObjectText.hasObjectText() && (msgText == null || msgText.toString().equals(archetype.getMsgText())) && multiX == archetype.getMultiY() && multiY == archetype.getMultiX() && (editorFolder == null || editorFolder.equals(archetype.getEditorFolder())) && (faceName == null || faceName.equals(archetype.getFaceName())) && (animName == null || animName.equals(archetype.getAnimName())) && typeNo == archetype.getTypeNo(); + return archetype != null && artifact == archetype.isArtifact() && getArchetypeName().equals(archetype.getArchetypeName()) && objName.equals(archetype.getObjName()) && !gameObjectText.hasObjectText() && (msgText == null || msgText.toString().equals(archetype.getMsgText())) && (editorFolder == null || editorFolder.equals(archetype.getEditorFolder())) && (faceName == null || faceName.equals(archetype.getFaceName())) && (animName == null || animName.equals(archetype.getAnimName())) && typeNo == archetype.getTypeNo(); } /** @@ -944,7 +898,6 @@ // ignore "mapx" // ignore "mapy" // ignore "attributeCache" - && abstractBaseObject.multiX == multiX && abstractBaseObject.multiY == multiY // ignore "multi" // ignore "editType" && (abstractBaseObject.editorFolder == null ? editorFolder == null : abstractBaseObject.editorFolder.equals(editorFolder)) && (abstractBaseObject.faceName == null ? faceName == null : abstractBaseObject.faceName.equals(faceName)) && (abstractBaseObject.animName == null ? animName == null : abstractBaseObject.animName.equals(animName)) && abstractBaseObject.typeNo == typeNo && abstractBaseObject.direction == direction; Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -434,34 +434,6 @@ void setObjectText(@NotNull String objectText); /** - * Set the x-position of this part of a multi-part object. The x-position is - * relative to the head part. - * @param multiX the x-distance of this part to the head part - */ - void setMultiX(int multiX); - - /** - * Set the y-position of this part of a multi-part object. The y-position is - * relative to the head part. - * @param multiY the y-distance of this part to the head part - */ - void setMultiY(int multiY); - - /** - * Get the x-distance of this part to the head part. For single-part objects - * this is always zero. - * @return the x-distance of this part to the head part - */ - int getMultiX(); - - /** - * Get the y-distance of this part to the head part. For single-part objects - * this is always zero. - * @return the y-distance of this part to the head part - */ - int getMultiY(); - - /** * Return whether this game object is unmodified from its underlying * archetype. * @return Whether this game object is unmodified. Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -61,7 +61,7 @@ public G cloneMultiGameObject(@NotNull final G gameObject, final int posx, final int posy) { final G newHead = cloneGameObject(gameObject, posx, posy); for (G tmp = gameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - newHead.addTailPart(cloneGameObject(tmp, posx + tmp.getMultiX(), posy + tmp.getMultiY())); + newHead.addTailPart(cloneGameObject(tmp, posx + tmp.getArchetype().getMultiX(), posy + tmp.getArchetype().getMultiY())); } if (newHead.isMulti()) { newHead.setMultiShapeID(gameObject.getMultiShapeID()); @@ -75,9 +75,6 @@ */ @Override public void postParseGameObject(@NotNull final G gameObject) { - gameObject.setMultiX(gameObject.getArchetype().getMultiX()); - gameObject.setMultiY(gameObject.getArchetype().getMultiY()); - scriptArchData.validateAllEvents(gameObject); } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -88,7 +88,7 @@ * @param head the head part of the multi-part object */ public MultiArchData(@NotNull final T head) { - assert head.getMultiX() == 0 && head.getMultiY() == 0; + assert head.getArchetype().getMultiX() == 0 && head.getArchetype().getMultiY() == 0; parts.add(head); } @@ -199,14 +199,14 @@ public void addPart(@NotNull final T tail) { parts.add(tail); - final int x = tail.getMultiX(); + final int x = tail.getArchetype().getMultiX(); if (x < minX) { minX = x; } else if (x > maxX) { maxX = x; } - final int y = tail.getMultiY(); + final int y = tail.getArchetype().getMultiY(); if (y < minY) { minY = y; } else if (y > maxY) { Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -305,8 +305,8 @@ objects.add(newarch); // set map position (x, y) - newarch.setMapX(gameObject.getMapX() + newarch.getMultiX()); - newarch.setMapY(gameObject.getMapY() + newarch.getMultiY()); + newarch.setMapX(gameObject.getMapX() + newarch.getArchetype().getMultiX()); + newarch.setMapY(gameObject.getMapY() + newarch.getArchetype().getMultiY()); } } Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -859,8 +859,8 @@ } for (final G part : parts) { - final int mapX = pos.x + part.getMultiX(); - final int mapY = pos.y + part.getMultiY(); + final int mapX = pos.x + part.getArchetype().getMultiX(); + final int mapY = pos.y + part.getArchetype().getMultiY(); part.setMapX(mapX); part.setMapY(mapY); gameObjectMatchers.updateEditType(part, activeEditType); Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 15:26:39 UTC (rev 7932) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) @@ -92,8 +92,6 @@ @Override public TestGameObject createGameObjectPart(@NotNull final TestArchetype archetype, @Nullable final TestGameObject head) { final TestGameObject gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); - gameObject.setMultiX(archetype.getMultiX()); - gameObject.setMultiY(archetype.getMultiY()); if (head != null) { head.addTailPart(gameObject); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 15:41:40
|
Revision: 7934 http://gridarta.svn.sourceforge.net/gridarta/?rev=7934&view=rev Author: akirschbaum Date: 2010-05-23 15:41:34 +0000 (Sun, 23 May 2010) Log Message: ----------- Add @Depreacted annotations. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) @@ -127,6 +127,7 @@ /** * {@inheritDoc} */ + @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { super.postParseGameObject(gameObject); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) @@ -127,6 +127,7 @@ /** * {@inheritDoc} */ + @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { super.postParseGameObject(gameObject); Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:40:53 UTC (rev 7933) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) @@ -73,6 +73,7 @@ /** * {@inheritDoc} */ + @Deprecated @Override public void postParseGameObject(@NotNull final G gameObject) { scriptArchData.validateAllEvents(gameObject); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 15:59:41
|
Revision: 7935 http://gridarta.svn.sourceforge.net/gridarta/?rev=7935&view=rev Author: akirschbaum Date: 2010-05-23 15:59:32 +0000 (Sun, 23 May 2010) Log Message: ----------- Do not remove event objects having incorrect parameters when loading maps. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java trunk/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchData.java trunk/src/app/net/sf/gridarta/model/scripts/ScriptedEvent.java trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java Removed Paths: ------------- trunk/src/test/net/sf/gridarta/model/scripts/TestScriptArchData.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/atrinik/ChangeLog 2010-05-23 15:59:32 UTC (rev 7935) @@ -1,5 +1,8 @@ 2010-05-23 Andreas Kirschbaum + * Do not event objects having incorrect parameters when loading + maps. + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -435,8 +435,8 @@ */ @NotNull @Override - public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData(@NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory) { - return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT, scriptedEventFactory); + public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData() { + return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT); } /** Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -130,7 +130,6 @@ @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { - super.postParseGameObject(gameObject); final BaseObject<GameObject, MapArchObject, Archetype, Archetype> archetype = gameObject.getArchetype(); // if the type is still unset, then we take the default one if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/crossfire/ChangeLog 2010-05-23 15:59:32 UTC (rev 7935) @@ -1,5 +1,8 @@ 2010-05-23 Andreas Kirschbaum + * Do not remove event objects having incorrect parameters when + loading maps. + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -321,8 +321,8 @@ */ @NotNull @Override - public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData(@NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory) { - return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("subtype", Archetype.TYPE_EVENT_CONNECTOR, scriptedEventFactory); + public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData() { + return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("subtype", Archetype.TYPE_EVENT_CONNECTOR); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -129,4 +129,11 @@ return clone; } + /** + * {@inheritDoc} + */ + @Override + public void postParseGameObject(@NotNull final GameObject gameObject) { + } + } // class DefaultGameObjectFactory Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/daimonin/ChangeLog 2010-05-23 15:59:32 UTC (rev 7935) @@ -1,5 +1,8 @@ 2010-05-23 Andreas Kirschbaum + * Do not remove event objects having incorrect parameters when + loading maps. + * Implement #1717845 (Multitile paste) as File|Paste Tiled: paste the copy buffer into the selection. If the selection is larger than the copy buffer, tiling happens. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -436,8 +436,8 @@ */ @NotNull @Override - public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData(@NotNull final ScriptedEventFactory<GameObject, MapArchObject, Archetype> scriptedEventFactory) { - return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT, scriptedEventFactory); + public ScriptArchData<GameObject, MapArchObject, Archetype> newScriptArchData() { + return new DefaultScriptArchData<GameObject, MapArchObject, Archetype>("sub_type", Archetype.TYPE_EVENT_OBJECT); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -130,7 +130,6 @@ @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { - super.postParseGameObject(gameObject); final BaseObject<?, ?, ?, ?> archetype = gameObject.getArchetype(); // if the type is still unset, then we take the default one if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -261,9 +261,8 @@ final ScriptedEventFactory<G, A, R> scriptedEventFactory = editorFactory.newScriptedEventFactory(scriptArchUtils, gameObjectFactory, scriptedEventEditor, archetypeSet); scriptArchEditor = new DefaultScriptArchEditor<G, A, R>(scriptedEventFactory, scriptExtension, scriptName, scriptArchUtils, scriptFileFilter, globalSettings, mapManager, pathManager); scriptedEventEditor.setScriptArchEditor(scriptArchEditor); - scriptArchData = editorFactory.newScriptArchData(scriptedEventFactory); + scriptArchData = editorFactory.newScriptArchData(); scriptArchDataUtils = editorFactory.newScriptArchDataUtils(scriptArchUtils, scriptedEventFactory, scriptedEventEditor); - gameObjectFactory.setScriptArchData(scriptArchData); final long timeStart = System.currentTimeMillis(); if (log.isInfoEnabled()) { log.info("Start to load archetypes..."); Modified: trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/maincontrol/EditorFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -258,11 +258,10 @@ /** * Creates a new {@link ScriptArchData} instance. - * @param scriptedEventFactory the scripted event factory to use * @return the new instance */ @NotNull - ScriptArchData<G, A, R> newScriptArchData(@NotNull ScriptedEventFactory<G, A, R> scriptedEventFactory); + ScriptArchData<G, A, R> newScriptArchData(); /** * Creates a new {@link ScriptArchDataUtils} instance. Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -21,9 +21,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.model.scripts.ScriptArchData; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; /** * Abstract base class for {@link GameObjectFactory} implementations. @@ -32,28 +30,6 @@ public abstract class AbstractGameObjectFactory<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements GameObjectFactory<G, A, R> { /** - * The {@link ScriptArchData} for validating event objects. - */ - @Nullable - private ScriptArchData<G, A, R> scriptArchData; - - /** - * Creates a new instance. - */ - @Deprecated - protected AbstractGameObjectFactory() { - this(null); - } - - /** - * Creates a new instance. - * @param scriptArchData the script arch data for validating event objects - */ - protected AbstractGameObjectFactory(@Nullable final ScriptArchData<G, A, R> scriptArchData) { - this.scriptArchData = scriptArchData; - } - - /** * {@inheritDoc} */ @NotNull @@ -70,19 +46,4 @@ return newHead; } - /** - * {@inheritDoc} - */ - @Deprecated - @Override - public void postParseGameObject(@NotNull final G gameObject) { - scriptArchData.validateAllEvents(gameObject); - } - - @Deprecated - @Override - public void setScriptArchData(@NotNull final ScriptArchData<G, A, R> scriptArchData) { - this.scriptArchData = scriptArchData; - } - } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.model.scripts.ScriptArchData; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -112,7 +111,4 @@ @Deprecated void postParseGameObject(@NotNull G gameObject); - @Deprecated - void setScriptArchData(@NotNull ScriptArchData<G, A, R> scriptArchData); - } // interface GameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/scripts/AbstractScriptedEvent.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -37,34 +37,6 @@ */ private static final Category log = Logger.getLogger(AbstractScriptedEvent.class); - /** - * {@inheritDoc} - */ - @Override - public boolean isValid() { - final String options = getOptions(); - String scriptPath = getScriptPath(); - String pluginName = getPluginName(); - final int eventType = getEventType(); - - if (scriptPath.length() <= 0) { - log.error("Map Error: Found " + typeName(eventType) + " event without file name!"); - return false; - } - - if (pluginName.length() <= 0) { - pluginName = "Python"; - if (log.isInfoEnabled()) { - log.info("Found " + typeName(eventType) + " without plugin name. Setting to \"Python\"."); - } - } - - scriptPath = scriptPath.replace('\\', '/'); // just make sure there are only slashes: '/' - - setEventData(pluginName, scriptPath, options); - return true; - } - @NotNull protected abstract String typeName(final int eventType); Modified: trunk/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/scripts/DefaultScriptArchData.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -19,13 +19,10 @@ package net.sf.gridarta.model.scripts; -import java.util.Iterator; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -39,11 +36,6 @@ public class DefaultScriptArchData<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements ScriptArchData<G, A, R> { /** - * The Logger for printing log messages. - */ - private static final Category log = Logger.getLogger(DefaultScriptArchData.class); - - /** * The attribute name for the subtype field. * @serial */ @@ -57,21 +49,13 @@ private final int eventTypeNo; /** - * The {@link ScriptedEventFactory} instance to use. - */ - @NotNull - private final ScriptedEventFactory<G, A, R> scriptedEventFactory; - - /** * Create a ScriptArchData. * @param subtypeAttribute the attribute name for the subtype field * @param eventTypeNo the object type for event objects - * @param scriptedEventFactory the scripted event factory instance to use */ - public DefaultScriptArchData(@NotNull final String subtypeAttribute, final int eventTypeNo, @NotNull final ScriptedEventFactory<G, A, R> scriptedEventFactory) { + public DefaultScriptArchData(@NotNull final String subtypeAttribute, final int eventTypeNo) { this.subtypeAttribute = subtypeAttribute; this.eventTypeNo = eventTypeNo; - this.scriptedEventFactory = scriptedEventFactory; } /** @@ -92,28 +76,6 @@ * {@inheritDoc} */ @Override - public void validateAllEvents(@NotNull final G gameObject) { - final Iterator<G> it = gameObject.iterator(); - while (it.hasNext()) { - final G tmp = it.next(); - if (tmp.getTypeNo() == eventTypeNo) { - final ScriptedEvent<G, A, R> se = scriptedEventFactory.newScriptedEvent(tmp); - // validate this event - if (!se.isValid()) { - // this event is invalid - if (log.isInfoEnabled()) { - log.info("-> Deleting invalid event..."); - } - it.remove(); - } - } - } - } - - /** - * {@inheritDoc} - */ - @Override public boolean isEmpty(@NotNull final G gameObject) { for (final BaseObject<G, A, R, ?> tmp : gameObject) { if (tmp.getTypeNo() == eventTypeNo) { Modified: trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchData.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/scripts/ScriptArchData.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -46,14 +46,6 @@ G getScriptedEvent(int eventSubtype, @NotNull G gameObject); /** - * This method is called for each arch after loading a map. It checks - * whether all events have enough data to be valid. Invalid or insufficient - * ScriptedEvent objects get removed. - * @param gameObject the game object to operate on - */ - void validateAllEvents(@NotNull G gameObject); - - /** * Returns whether this ScriptArchData is empty (contains no events). (Note * that empty ScriptArchData objects always are removed ASAP.) * @param gameObject the game object to operate on Modified: trunk/src/app/net/sf/gridarta/model/scripts/ScriptedEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/scripts/ScriptedEvent.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/app/net/sf/gridarta/model/scripts/ScriptedEvent.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -53,10 +53,4 @@ int getEventType(); - /** - * Validate this event object: Check if there is sufficient data. - * @return true if this object is valid, otherwise false - */ - boolean isValid(); - } // class ScriptedEvent Modified: trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -65,8 +65,6 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; -import net.sf.gridarta.model.scripts.ScriptArchData; -import net.sf.gridarta.model.scripts.TestScriptArchData; import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.model.settings.TestGlobalSettings; import net.sf.gridarta.preferences.FilePreferencesFactory; @@ -397,8 +395,7 @@ final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists = new AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype>(mapViewSettings); final ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype> archetypeChooserModel = new ArchetypeChooserModel<TestGameObject, TestMapArchObject, TestArchetype>(); pathManager = new PathManager(globalSettings); - final ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> scriptArchData = new TestScriptArchData(); - final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); topmostInsertionMode = new TopmostInsertionMode<TestGameObject, TestMapArchObject, TestArchetype>(); insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode); Modified: trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -38,7 +38,6 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.gameobject.TestGameObjectFactory; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.scripts.TestScriptArchData; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; @@ -167,14 +166,13 @@ * @return the new instance */ public AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, TestArchetypeBuilder> newArchetypeParser() { - final TestScriptArchData scriptArchData = new TestScriptArchData(); final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); final FaceObjects faceObjects = new DefaultFaceObjects("png", "facetree", Pattern.compile(".*"), "facetree.output", archFaceProvider); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); final AnimationObjects animationObjects = new DefaultAnimationObjects("animtree"); - final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final TestArchetypeFactory archetypeFactory = new TestArchetypeFactory(); archetypeSet = new TestArchetypeSet(archetypeFactory, "archetypes"); Modified: trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -47,7 +47,6 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.gameobject.TestGameObjectFactory; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.scripts.TestScriptArchData; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import org.junit.Assert; @@ -81,8 +80,7 @@ final File file = new File("*string*"); final TestErrorView errorView = new TestErrorView(); final ErrorViewCollector errorViewCollector = new ErrorViewCollector(errorView, file); - final TestScriptArchData scriptArchData = new TestScriptArchData(); - final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final TestArchetypeBuilder archetypeBuilder = new TestArchetypeBuilder(gameObjectFactory); final AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, TestArchetypeBuilder> archetypeParser = new TestArchetypeParser(archetypeBuilder, animationObjects, archetypeSet); final List<TestGameObject> invObjects = new ArrayList<TestGameObject>(); Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -23,7 +23,6 @@ import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.scripts.ScriptArchData; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -47,12 +46,10 @@ /** * Creates a new instance. - * @param scriptArchData the script arch data for validating event objects * @param faceObjectProviders the face object providers to use * @param animationObjects the animation objects for looking up animations */ - public TestGameObjectFactory(@NotNull final ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> scriptArchData, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { - super(scriptArchData); + public TestGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { this.faceObjectProviders = faceObjectProviders; this.animationObjects = animationObjects; } @@ -123,4 +120,12 @@ return clone; } + /** + * {@inheritDoc} + */ + @Override + public void postParseGameObject(@NotNull final TestGameObject gameObject) { + // ignore + } + } // class TestGameObjectFactory Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -48,8 +48,6 @@ import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatchers; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; -import net.sf.gridarta.model.scripts.ScriptArchData; -import net.sf.gridarta.model.scripts.TestScriptArchData; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.Size2D; import net.sf.gridarta.utils.SystemIcons; @@ -470,14 +468,12 @@ final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final MapViewSettings mapViewSettings = new MapViewSettings(); final AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype> autojoinLists = new AutojoinLists<TestGameObject, TestMapArchObject, TestArchetype>(mapViewSettings); - final ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> scriptArchData = new TestScriptArchData(); animationObjects = new DefaultAnimationObjects("anim"); - final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(); final InsertionMode<TestGameObject, TestMapArchObject, TestArchetype> topmostInsertionMode = new TopmostInsertionMode<TestGameObject, TestMapArchObject, TestArchetype>(); insertionModeSet = new InsertionModeSet<TestGameObject, TestMapArchObject, TestArchetype>(topmostInsertionMode); insertionModeSet.init(new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher(), new TypeNrsGameObjectMatcher()); - assert archetypeChooserModel != null; mapModel = new DefaultMapModel<TestGameObject, TestMapArchObject, TestArchetype>(autojoinLists, mapArchObject, archetypeChooserModel, 0, gameObjectFactory, gameObjectMatchers, topmostInsertionMode); result.setLength(0); Modified: trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -31,9 +31,6 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.gameobject.TestGameObjectFactory; -import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; -import net.sf.gridarta.model.scripts.ScriptArchData; -import net.sf.gridarta.model.scripts.TestScriptArchData; import net.sf.gridarta.utils.GUIUtils; import net.sf.gridarta.utils.SystemIcons; import org.jetbrains.annotations.NotNull; @@ -62,10 +59,9 @@ public void testTypeNrsGameObjectMatcher1() { final GameObjectMatcher invGameObjectMatcher = new TypeNrsGameObjectMatcher(1); final GameObjectMatcher namedGameObjectMatcher = new NamedGameObjectMatcher(0, "namedGameObjectMatcher", "namedGameObjectMatcher", false, null, invGameObjectMatcher); - final ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> scriptArchData = new TestScriptArchData(); final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final AnimationObjects animationObjects = new DefaultAnimationObjects("anim"); - final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); Assert.assertTrue(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 1))); Assert.assertFalse(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 2))); Assert.assertTrue(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 1, 1))); @@ -88,10 +84,9 @@ final GameObjectMatcher invGameObjectMatcher = new TypeNrsGameObjectMatcher(1); final GameObjectMatcher envGameObjectMatcher = new TypeNrsGameObjectMatcher(2); final GameObjectMatcher namedGameObjectMatcher = new NamedGameObjectMatcher(0, "namedGameObjectMatcher", "namedGameObjectMatcher", false, envGameObjectMatcher, invGameObjectMatcher); - final ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> scriptArchData = new TestScriptArchData(); final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final AnimationObjects animationObjects = new DefaultAnimationObjects("anim"); - final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(scriptArchData, faceObjectProviders, animationObjects); + final TestGameObjectFactory gameObjectFactory = new TestGameObjectFactory(faceObjectProviders, animationObjects); Assert.assertFalse(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 1))); Assert.assertFalse(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 2))); Assert.assertFalse(namedGameObjectMatcher.isMatching(newGameObjects(gameObjectFactory, faceObjectProviders, animationObjects, 1, 1))); Deleted: trunk/src/test/net/sf/gridarta/model/scripts/TestScriptArchData.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/scripts/TestScriptArchData.java 2010-05-23 15:41:34 UTC (rev 7934) +++ trunk/src/test/net/sf/gridarta/model/scripts/TestScriptArchData.java 2010-05-23 15:59:32 UTC (rev 7935) @@ -1,57 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.model.scripts; - -import net.sf.gridarta.model.archetype.TestArchetype; -import net.sf.gridarta.model.gameobject.TestGameObject; -import net.sf.gridarta.model.map.maparchobject.TestMapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * A {@link ScriptArchData} for regression tests. - * @author Andreas Kirschbaum - */ -public class TestScriptArchData implements ScriptArchData<TestGameObject, TestMapArchObject, TestArchetype> { - - /** - * {@inheritDoc} - */ - @Override - public TestGameObject getScriptedEvent(final int eventSubtype, @NotNull final TestGameObject gameObject) { - throw new AssertionError(); - } - - /** - * {@inheritDoc} - */ - @Override - public void validateAllEvents(@NotNull final TestGameObject gameObject) { - // always correct - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isEmpty(@NotNull final TestGameObject gameObject) { - throw new AssertionError(); - } - -} // class TestScriptArchData This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 16:11:36
|
Revision: 7936 http://gridarta.svn.sourceforge.net/gridarta/?rev=7936&view=rev Author: akirschbaum Date: 2010-05-23 16:11:30 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{is,set}LowestPart() to Archetype. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -103,7 +103,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setLowestPart(archetype.isLowestPart()); gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { head.addTailPart(gameObject); @@ -138,7 +137,6 @@ if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { gameObject.setMultiPartNr(archetype.getMultiPartNr()); } - gameObject.setLowestPart(archetype.isLowestPart()); } } // class DefaultGameObjectFactory Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -103,7 +103,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setLowestPart(archetype.isLowestPart()); gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { head.addTailPart(gameObject); @@ -138,7 +137,6 @@ if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { gameObject.setMultiPartNr(archetype.getMultiPartNr()); } - gameObject.setLowestPart(archetype.isLowestPart()); } } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -543,7 +543,7 @@ // multipart images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; - if (tmpNode != null && tmpNode.isLowestPart() || head.isLowestPart()) { + if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -93,7 +93,7 @@ if (node.isMulti() && node.getMultiRefCount() > 0) { // multipart images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. - if (tmpNode != null && tmpNode.isLowestPart() || node.isLowestPart()) { + if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || node.getArchetype().isLowestPart()) { final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); grfx.drawImage(img.getImage(), x, y, img.getImageObserver()); Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -58,6 +58,14 @@ private int multiY = 0; /** + * Set if this part of a multi-part object is the lowest part. The lowest + * part is the part with the minimum y screen coordinate. Set to + * <code>true</code> for single-part objects. + * @serial + */ + private boolean isLowestPart = true; + + /** * Creates a new instance. * @param archetypeName the name of the archetype * @param faceObjectProviders the face object providers for looking up @@ -217,4 +225,20 @@ return multiY; } + /** + * {@inheritDoc} + */ + @Override + public boolean isLowestPart() { + return isLowestPart; + } + + /** + * {@inheritDoc} + */ + @Override + public void setLowestPart(final boolean isLowestPart) { + this.isLowestPart = isLowestPart; + } + } // class AbstractArchetype Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -121,4 +121,18 @@ */ int getMultiY(); + /** + * Returns whether this part has the smallest y coordinate when painting + * the image. + * @return whether this part has the smallest y coordinate + */ + boolean isLowestPart(); + + /** + * Sets whether this part has the smallest y coordinate when painting the + * image. + * @param isLowestPart whether this part has the smallest y coordinate + */ + void setLowestPart(boolean isLowestPart); + } // interface Archetype Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -186,14 +186,6 @@ private int multiPartNr = 0; - /** - * Set if this part of a multi-part object is the lowest part. The lowest - * part is the part with the minimum y screen coordinate. Set to - * <code>true</code> for single-part objects. - * @serial - */ - private boolean isLowestPart = true; - @NotNull private String loreText = ""; // lore text buffer @@ -1139,22 +1131,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return isLowestPart; - } - - /** - * {@inheritDoc} - */ - @Override - public void setLowestPart(final boolean isLowestPart) { - this.isLowestPart = isLowestPart; - } - - /** - * {@inheritDoc} - */ @NotNull @Override public String getLoreText() { Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -523,10 +523,6 @@ @NotNull Object clone(); - boolean isLowestPart(); - - void setLowestPart(boolean isLowestPart); - @NotNull String getLoreText(); Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 15:59:32 UTC (rev 7935) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 16:11:30 UTC (rev 7936) @@ -164,7 +164,7 @@ */ @Override public boolean isEqual(@NotNull final G gameObject) { - return super.isEqual(gameObject) && gameObject.getMultiPartNr() == getMultiPartNr() && gameObject.isLowestPart() == isLowestPart(); + return super.isEqual(gameObject) && gameObject.getMultiPartNr() == getMultiPartNr(); // ignore "scriptArchData" // ignore "transFace" } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 16:36:40
|
Revision: 7937 http://gridarta.svn.sourceforge.net/gridarta/?rev=7937&view=rev Author: akirschbaum Date: 2010-05-23 16:36:33 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{get,set}MultiPartNr() to Archetype. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.AbstractIsoGameObjectFactory; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; @@ -103,7 +102,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { head.addTailPart(gameObject); } @@ -129,14 +127,11 @@ @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { - final BaseObject<GameObject, MapArchObject, Archetype, Archetype> archetype = gameObject.getArchetype(); + final Archetype archetype = gameObject.getArchetype(); // if the type is still unset, then we take the default one if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { gameObject.setMultiShapeID(archetype.getMultiShapeID()); } - if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { - gameObject.setMultiPartNr(archetype.getMultiPartNr()); - } } } // class DefaultGameObjectFactory Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -103,7 +103,6 @@ @Override public GameObject createGameObjectPart(@NotNull final Archetype archetype, @Nullable final GameObject head) { final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects, archetypeTypeSet); - gameObject.setMultiPartNr(archetype.getMultiPartNr()); if (head != null) { head.addTailPart(gameObject); } @@ -134,9 +133,6 @@ if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { gameObject.setMultiShapeID(archetype.getMultiShapeID()); } - if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { - gameObject.setMultiPartNr(archetype.getMultiPartNr()); - } } } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -544,11 +544,11 @@ // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { - icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); if (env != null && isSpawnPoint(env)) { - icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getMultiPartNr() : tmpNode.getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); } } } else { Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -94,15 +94,15 @@ // multipart images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || node.getArchetype().isLowestPart()) { - final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); - final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); + final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); grfx.drawImage(img.getImage(), x, y, img.getImageObserver()); //img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = node.getContainerGameObject(); if (env != null && env.getTypeNo() == spawnPointTypeNo) { - final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); - final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()); + final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); grfx.drawImage(img.getImage(), x, y, img.getImageObserver()); //img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); } Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -65,6 +65,8 @@ */ private boolean isLowestPart = true; + private int multiPartNr = 0; + /** * Creates a new instance. * @param archetypeName the name of the archetype @@ -241,4 +243,20 @@ this.isLowestPart = isLowestPart; } + /** + * {@inheritDoc} + */ + @Override + public int getMultiPartNr() { + return multiPartNr; + } + + /** + * {@inheritDoc} + */ + @Override + public void setMultiPartNr(final int multiPartNr) { + this.multiPartNr = multiPartNr; + } + } // class AbstractArchetype Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -135,4 +135,8 @@ */ void setLowestPart(boolean isLowestPart); + int getMultiPartNr(); + + void setMultiPartNr(int multiPartNr); + } // interface Archetype Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -184,8 +184,6 @@ */ private int direction; - private int multiPartNr = 0; - @NotNull private String loreText = ""; // lore text buffer @@ -1115,22 +1113,6 @@ /** * {@inheritDoc} */ - @Override - public int getMultiPartNr() { - return multiPartNr; - } - - /** - * {@inheritDoc} - */ - @Override - public void setMultiPartNr(final int multiPartNr) { - this.multiPartNr = multiPartNr; - } - - /** - * {@inheritDoc} - */ @NotNull @Override public String getLoreText() { Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -513,10 +513,6 @@ @Deprecated boolean isArchetype(); - int getMultiPartNr(); - - void setMultiPartNr(int multiPartNr); - /** * {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 16:11:30 UTC (rev 7936) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 16:36:33 UTC (rev 7937) @@ -164,7 +164,7 @@ */ @Override public boolean isEqual(@NotNull final G gameObject) { - return super.isEqual(gameObject) && gameObject.getMultiPartNr() == getMultiPartNr(); + return super.isEqual(gameObject); // ignore "scriptArchData" // ignore "transFace" } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 17:08:26
|
Revision: 7938 http://gridarta.svn.sourceforge.net/gridarta/?rev=7938&view=rev Author: akirschbaum Date: 2010-05-23 17:08:19 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{get,set}MultiShapeID() to Archetype; remove BaseObject.initMultiData(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -127,11 +127,6 @@ @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { - final Archetype archetype = gameObject.getArchetype(); - // if the type is still unset, then we take the default one - if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { - gameObject.setMultiShapeID(archetype.getMultiShapeID()); - } } } // class DefaultGameObjectFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -118,14 +118,8 @@ @Override public GameObject cloneGameObject(@NotNull final GameObject gameObject, final int posx, final int posy) { final GameObject clone = gameObject.clone(); - - if (gameObject.isMulti() && gameObject.isHead()) { - clone.initMultiData(); - } - clone.setMapX(posx); clone.setMapY(posy); - return clone; } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -21,7 +21,6 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.AbstractIsoGameObjectFactory; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; @@ -128,11 +127,6 @@ @Deprecated @Override public void postParseGameObject(@NotNull final GameObject gameObject) { - final BaseObject<?, ?, ?, ?> archetype = gameObject.getArchetype(); - // if the type is still unset, then we take the default one - if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { - gameObject.setMultiShapeID(archetype.getMultiShapeID()); - } } } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -544,11 +544,11 @@ // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { - icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); if (env != null && isSpawnPoint(env)) { - icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); + icon.paintIcon(this, g, xStart - multiPositionData.getXOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()), yStart - yOffset + multiPositionData.getYOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr())); } } } else { Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -94,15 +94,15 @@ // multipart images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || node.getArchetype().isLowestPart()) { - final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); - final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int x = xstart - multiPositionData.getXOffset(node.getArchetype().getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int y = ystart - yoff + multiPositionData.getYOffset(node.getArchetype().getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); grfx.drawImage(img.getImage(), x, y, img.getImageObserver()); //img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); } else { final BaseObject<G, A, R, ?> env = node.getContainerGameObject(); if (env != null && env.getTypeNo() == spawnPointTypeNo) { - final int x = xstart - multiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); - final int y = ystart - yoff + multiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int x = xstart - multiPositionData.getXOffset(node.getArchetype().getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); + final int y = ystart - yoff + multiPositionData.getYOffset(node.getArchetype().getMultiShapeID(), tmpNode == null ? node.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); grfx.drawImage(img.getImage(), x, y, img.getImageObserver()); //img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); } Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -25,6 +25,7 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.gameobject.GameObjectFactory; +import net.sf.gridarta.model.gameobject.MultiArchData; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.model.map.mapmodel.MapSquare; import org.jetbrains.annotations.NotNull; @@ -65,6 +66,12 @@ */ private boolean isLowestPart = true; + /** + * The shape ID of this object. + * @serial + */ + private int multiShapeID = 0; + private int multiPartNr = 0; /** @@ -247,6 +254,26 @@ * {@inheritDoc} */ @Override + public int getMultiShapeID() { + return multiShapeID; + } + + /** + * {@inheritDoc} + */ + @Override + public void setMultiShapeID(final int multiShapeID) { + this.multiShapeID = multiShapeID; + final MultiArchData<G, A, R, R> multi = getMulti(); + if (multi != null) { + multi.setMultiShapeID(multiShapeID); + } + } + + /** + * {@inheritDoc} + */ + @Override public int getMultiPartNr() { return multiPartNr; } Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -135,6 +135,10 @@ */ void setLowestPart(boolean isLowestPart); + int getMultiShapeID(); + + void setMultiShapeID(int multiShapeID); + int getMultiPartNr(); void setMultiPartNr(int multiPartNr); Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -444,6 +444,11 @@ setTypeNo(getAttributeInt(Archetype.TYPE)); setObjName(getAttributeString(Archetype.NAME)); setObjectFace(); + if (multi != null) { + final int multiShapeID = getArchetype().getMultiShapeID(); + assert multi != null; + multi.setMultiShapeID(multiShapeID); + } } finally { endGameObjectChange(); } @@ -697,30 +702,12 @@ } /** - * {@inheritDoc} + * Initialize the multipart data object - must only be called for multipart + * arches. */ - @Override - public int getMultiShapeID() { - return multi != null ? multi.getMultiShapeID() : 0; - } - - /** - * {@inheritDoc} - */ - @Override - public void setMultiShapeID(final int multiShapeID) { - initMultiData(); - assert multi != null; - multi.setMultiShapeID(multiShapeID); - } - - /** - * {@inheritDoc} - */ - @Override - public void initMultiData() { + private void initMultiData() { if (multi == null) { - multi = new MultiArchData<G, A, R, T>(getThis()); + multi = new MultiArchData<G, A, R, T>(getThis(), getArchetype().getMultiShapeID()); } } @@ -1006,6 +993,16 @@ } /** + * Returns the {@link MultiArchData} for this base object. + * @return the multi arch data or <code>null</code> if this object is not + * a multi-square object + */ + @Nullable + protected MultiArchData<G, A, R, T> getMulti() { + return multi; + } + + /** * {@inheritDoc} */ @Override Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -381,17 +381,7 @@ */ int getMinY(); - int getMultiShapeID(); - - void setMultiShapeID(int multiShapeID); - /** - * Initialize the multipart data object - must only be called for multipart - * arches. - */ - void initMultiData(); - - /** * Returns the name of the object as shown to the player. * @return The name of the object as shown to the player. */ Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -39,10 +39,6 @@ for (G tmp = gameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { newHead.addTailPart(cloneGameObject(tmp, posx + tmp.getArchetype().getMultiX(), posy + tmp.getArchetype().getMultiY())); } - if (newHead.isMulti()) { - newHead.setMultiShapeID(gameObject.getMultiShapeID()); - } - return newHead; } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -37,14 +37,8 @@ @Override public G cloneGameObject(@NotNull final G gameObject, final int posx, final int posy) { final G clone = (G) gameObject.clone(); - - if (gameObject.isMulti() && gameObject.isHead()) { - clone.setMultiShapeID(gameObject.getMultiShapeID()); - } - clone.setMapX(posx); clone.setMapY(posy); - return clone; } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -86,8 +86,10 @@ /** * Create a new instance. * @param head the head part of the multi-part object + * @param multiShapeID the shape ID of this object */ - public MultiArchData(@NotNull final T head) { + public MultiArchData(@NotNull final T head, final int multiShapeID) { + this.multiShapeID = multiShapeID; assert head.getArchetype().getMultiX() == 0 && head.getArchetype().getMultiY() == 0; parts.add(head); } Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 16:36:33 UTC (rev 7937) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 17:08:19 UTC (rev 7938) @@ -298,7 +298,6 @@ // we have a multi head and need to insert his tail now // do insertion for all non-head parts of the multi - gameObject.initMultiData(); for (R oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { final G newarch = gameObjectFactory.createGameObjectPart(oldPart, gameObject); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 17:55:54
|
Revision: 7941 http://gridarta.svn.sourceforge.net/gridarta/?rev=7941&view=rev Author: akirschbaum Date: 2010-05-23 17:55:47 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove GameObjectFactory.postParseGameObject(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -105,7 +105,6 @@ if (head != null) { head.addTailPart(gameObject); } - postParseGameObject(gameObject); return gameObject; } @@ -121,12 +120,4 @@ return clone; } - /** - * {@inheritDoc} - */ - @Deprecated - @Override - public void postParseGameObject(@NotNull final GameObject gameObject) { - } - } // class DefaultGameObjectFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -95,7 +95,6 @@ if (head != null) { head.addTailPart(gameObject); } - postParseGameObject(gameObject); return gameObject; } @@ -123,11 +122,4 @@ return clone; } - /** - * {@inheritDoc} - */ - @Override - public void postParseGameObject(@NotNull final GameObject gameObject) { - } - } // class DefaultGameObjectFactory Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -105,7 +105,6 @@ if (head != null) { head.addTailPart(gameObject); } - postParseGameObject(gameObject); return gameObject; } @@ -121,12 +120,4 @@ return clone; } - /** - * {@inheritDoc} - */ - @Deprecated - @Override - public void postParseGameObject(@NotNull final GameObject gameObject) { - } - } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -141,9 +141,7 @@ @NotNull @Override public G newInstance(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory) { - final G result = gameObjectFactory.cloneGameObject(getThis(), 0, 0); - gameObjectFactory.postParseGameObject(result); - return result; + return gameObjectFactory.cloneGameObject(getThis(), 0, 0); } /** Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -94,21 +94,4 @@ @NotNull G cloneMultiGameObject(@NotNull G gameObject, int posx, int posy); - /** - * Here we go... thats the hard one we copy the needed values from archetype - * to the gameObject. we setup the panels to show the right values <p/> - * first: the anim list... we want handle this later so we ignore this yet - * and let it in the gameObject text windows for handwork <p/> 2nd: - * msg/endmsg we had in the map a msg/endmsg cmd or not because we init our - * msg buffer only when one cmd come in we have a null-ptr or a text if - * text, this will overrule ALWAYS the default text if null, copy the - * default text in the gameObject, so the user can see and edit it if at - * save time msg-maparch == msg-default, we ignore it in every other case - * (even "" text) we save - * @param gameObject the game object to finish - * @todo improve this stupid comment - */ - @Deprecated - void postParseGameObject(@NotNull G gameObject); - } // interface GameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -198,10 +198,6 @@ final R archetype = archetypeSet.getOrCreateArchetype(gameObject.getArchetypeName()); gameObject.setArchetype(archetype); - // Ok, now is attached to default arch and loaded png - // NOW we post parse the object... - // (We calculate only edit types that are active, to save time) - gameObjectFactory.postParseGameObject(gameObject); gameObjectMatchers.updateEditType(gameObject, mapViewSettings.getEditType()); if (!gameObject.isInContainer()) { Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -959,7 +959,6 @@ addGameObjectToMap(newGameObject, insertionMode); for (G tmp = newGameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - gameObjectFactory.postParseGameObject(tmp); gameObjectMatchers.updateEditType(tmp, activeEditType); addGameObjectToMap(tmp, insertionMode); } Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 17:26:10 UTC (rev 7940) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) @@ -92,7 +92,6 @@ if (head != null) { head.addTailPart(gameObject); } - postParseGameObject(gameObject); return gameObject; } @@ -120,12 +119,4 @@ return clone; } - /** - * {@inheritDoc} - */ - @Override - public void postParseGameObject(@NotNull final TestGameObject gameObject) { - // ignore - } - } // class TestGameObjectFactory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 18:02:02
|
Revision: 7942 http://gridarta.svn.sourceforge.net/gridarta/?rev=7942&view=rev Author: akirschbaum Date: 2010-05-23 18:01:55 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove GameObjectFactory.cloneArchetype(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) @@ -108,16 +108,4 @@ return gameObject; } - /** - * {@inheritDoc} - */ - @NotNull - @Override - public Archetype cloneArchetype(@NotNull final Archetype archetype, final int posx, final int posy) { - final Archetype clone = archetype.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; - } - } // class DefaultGameObjectFactory Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) @@ -103,18 +103,6 @@ */ @NotNull @Override - public Archetype cloneArchetype(@NotNull final Archetype archetype, final int posx, final int posy) { - final Archetype clone = archetype.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override public GameObject cloneGameObject(@NotNull final GameObject gameObject, final int posx, final int posy) { final GameObject clone = gameObject.clone(); clone.setMapX(posx); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) @@ -108,16 +108,4 @@ return gameObject; } - /** - * {@inheritDoc} - */ - @NotNull - @Override - public Archetype cloneArchetype(@NotNull final Archetype archetype, final int posx, final int posy) { - final Archetype clone = archetype.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; - } - } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) @@ -64,16 +64,6 @@ G createGameObjectPart(@NotNull R archetype, @Nullable G head); /** - * Creates a copy of a archetype. - * @param archetype the archetype to copy - * @param posx the x-map coordinate - * @param posy the y-map coordinate - * @return the new game object - */ - @NotNull - R cloneArchetype(@NotNull R archetype, int posx, int posy); - - /** * Creates a copy of a game object. * @param gameObject the game object to copy * @param posx the x-map coordinate Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 17:55:47 UTC (rev 7941) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) @@ -100,18 +100,6 @@ */ @NotNull @Override - public TestArchetype cloneArchetype(@NotNull final TestArchetype archetype, final int posx, final int posy) { - final TestArchetype clone = archetype.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; - } - - /** - * {@inheritDoc} - */ - @NotNull - @Override public TestGameObject cloneGameObject(@NotNull final TestGameObject gameObject, final int posx, final int posy) { final TestGameObject clone = gameObject.clone(); clone.setMapX(posx); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 21:48:01
|
Revision: 7943 http://gridarta.svn.sourceforge.net/gridarta/?rev=7943&view=rev Author: akirschbaum Date: 2010-05-23 21:47:54 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove explicit calls to setMap{X,Y}(); let the container manage these values. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquare.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/DefaultGameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -103,11 +103,8 @@ */ @NotNull @Override - public GameObject cloneGameObject(@NotNull final GameObject gameObject, final int posx, final int posy) { - final GameObject clone = gameObject.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; + public GameObject cloneGameObject(@NotNull final GameObject gameObject) { + return gameObject.clone(); } } // class DefaultGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyMode.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.copybuffer; +import java.awt.Point; import java.util.Collection; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -75,8 +76,8 @@ public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posx, final int posy, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType) { if (gameObject.isHead() && !gameObject.isInContainer()) { - final G clone = gameObjectFactory.cloneGameObject(gameObject, posx, posy); - mapModel.addGameObjectToMap(clone, insertionModeSet.getTopmostInsertionMode()); + final G clone = gameObjectFactory.cloneGameObject(gameObject); + mapModel.addGameObjectToMap(clone, new Point(posx, posy), insertionModeSet.getTopmostInsertionMode()); } if (gameObject.getArchetype().getMultiX() >= 0 && gameObject.getArchetype().getMultiY() >= 0) { gameObjectsToDelete.add(gameObject.getHead()); @@ -102,8 +103,8 @@ @Override public <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void process(@NotNull final MapModel<G, A, R> mapModel, @NotNull final G gameObject, final boolean isEditType, @NotNull final Collection<G> gameObjectsToDelete, final int posx, final int posy, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { if (isEditType && gameObject.isHead() && !gameObject.isInContainer()) { - final G clone = gameObjectFactory.cloneGameObject(gameObject, posx, posy); - mapModel.addGameObjectToMap(clone, insertionModeSet.getTopmostInsertionMode()); + final G clone = gameObjectFactory.cloneGameObject(gameObject); + mapModel.addGameObjectToMap(clone, new Point(posx, posy), insertionModeSet.getTopmostInsertionMode()); } } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/GameObjectAttributesControl.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -617,8 +617,6 @@ final G insertedGameObject = mapModel.insertArchToMap(baseObject, prevGameObject, new Point(mapSquare.getMapX(), mapSquare.getMapY()), true); if (insertedGameObject != null) { mapModel.removeGameObject(prevGameObject, true); - prevGameObject.setMapX(0); - prevGameObject.setMapY(0); insertedGameObject.addLast(prevGameObject); selectedSquareView.setSelectedGameObject(insertedGameObject); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -307,7 +307,7 @@ // [prevPos] = [pos] for (final G gameObject : mapModel.getMapSquare(pos)) { if (gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject)) { - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject, prevPos.x, prevPos.y), insertionModeSet.getTopmostInsertionMode()); + mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); gameObjectsToDelete.add(gameObject); } } @@ -319,7 +319,7 @@ // [prevPos] = [startGameObjects] for (final G gameObject : startGameObjects) { assert gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject); - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject, prevPos.x, prevPos.y), insertionModeSet.getTopmostInsertionMode()); + mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); } startGameObjects.clear(); } @@ -337,7 +337,7 @@ // [prevPos] = [startGameObjects] for (final G gameObject : startGameObjects) { assert gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject); - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject, prevPos.x, prevPos.y), insertionModeSet.getTopmostInsertionMode()); + mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); } startGameObjects.clear(); } Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -689,6 +689,14 @@ /** * {@inheritDoc} */ + @Override + protected void setThisContainer(@NotNull final G gameObject) { + gameObject.setContainer(this, 0, 0); + } + + /** + * {@inheritDoc} + */ @NotNull @Override public String getObjName() { Modified: trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -142,7 +142,7 @@ delegate.remove(); notifyBeginChange(); try { - current.setContainer(null); + current.setContainer(null, 0, 0); } finally { notifyEndChange(); } @@ -253,7 +253,7 @@ if (!contents.remove(gameObject)) { throw new NotInsideContainerException(this, gameObject); } - gameObject.setContainer(null); + gameObject.setContainer(null, 0, 0); } finally { notifyEndChange(); } @@ -271,7 +271,7 @@ notifyBeginChange(); try { for (final GameObject<G, A, R> gameObject : contents) { - gameObject.setContainer(null); + gameObject.setContainer(null, 0, 0); } contents.clear(); } finally { @@ -414,7 +414,7 @@ notifyBeginChange(); try { contents.add(gameObject); - gameObject.setContainer(this); + setThisContainer(gameObject); } finally { notifyEndChange(); } @@ -438,7 +438,7 @@ gameObject.propagateElevation(contents.get(0)); } contents.add(0, gameObject); - gameObject.setContainer(this); + setThisContainer(gameObject); } finally { notifyEndChange(); } @@ -477,7 +477,7 @@ if (!added) { throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because " + nextGameObject + " is not inside"); } - gameObject.setContainer(this); + setThisContainer(gameObject); } finally { notifyEndChange(); } @@ -503,7 +503,7 @@ throw new IllegalArgumentException("Can't insert " + newGameObject + " after " + previousGameObject + " because that isn't inside " + this); } contents.add(insertIndex, newGameObject); - newGameObject.setContainer(this); + setThisContainer(newGameObject); } finally { notifyEndChange(); } @@ -532,7 +532,7 @@ newGameObject.propagateElevation(contents.get(0)); } contents.add(insertIndex + 1, newGameObject); - newGameObject.setContainer(this); + setThisContainer(newGameObject); } finally { notifyEndChange(); } @@ -560,9 +560,9 @@ newGameObject.propagateElevation(oldGameObject); } contents.remove(oldGameObject); - oldGameObject.setContainer(null); + oldGameObject.setContainer(null, 0, 0); contents.add(insertIndex, newGameObject); - newGameObject.setContainer(this); + setThisContainer(newGameObject); } finally { notifyEndChange(); } @@ -602,7 +602,7 @@ for (final BaseObject<G, A, R, ?> gameObject : contents) { final G clonedGameObject = (G) gameObject.clone(); clone.contents.add(clonedGameObject); - clonedGameObject.setContainer(clone); + setThisContainer(clonedGameObject); } return clone; } catch (final CloneNotSupportedException e) { @@ -638,6 +638,12 @@ } /** + * Sets a {@link GameObject}'s container to this container. + * @param gameObject the game object + */ + protected abstract void setThisContainer(@NotNull final G gameObject); + + /** * An iterator for iterating over a list in reverse order. * @todo move this class to JAPI */ Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -141,7 +141,7 @@ @NotNull @Override public G newInstance(@NotNull final GameObjectFactory<G, A, R> gameObjectFactory) { - return gameObjectFactory.cloneGameObject(getThis(), 0, 0); + return gameObjectFactory.cloneGameObject(getThis()); } /** @@ -291,8 +291,10 @@ * {@inheritDoc} */ @Override - public void setContainer(@Nullable final GameObjectContainer<G, A, R> container) { + public void setContainer(@Nullable final GameObjectContainer<G, A, R> container, final int mapX, final int mapY) { this.container = container; + setMapX(mapX); + setMapY(mapY); } /** Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -34,10 +34,10 @@ */ @NotNull @Override - public G cloneMultiGameObject(@NotNull final G gameObject, final int posx, final int posy) { - final G newHead = cloneGameObject(gameObject, posx, posy); + public G cloneMultiGameObject(@NotNull final G gameObject) { + final G newHead = cloneGameObject(gameObject); for (G tmp = gameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - newHead.addTailPart(cloneGameObject(tmp, posx + tmp.getArchetype().getMultiX(), posy + tmp.getArchetype().getMultiY())); + newHead.addTailPart(cloneGameObject(tmp)); } return newHead; } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -35,11 +35,8 @@ */ @NotNull @Override - public G cloneGameObject(@NotNull final G gameObject, final int posx, final int posy) { - final G clone = (G) gameObject.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; + public G cloneGameObject(@NotNull final G gameObject) { + return (G) gameObject.clone(); } } // class AbstractIsoGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -226,10 +226,12 @@ * inventory of that GameObject.</li> <li>A MapSquare, which means that this * GameObject is top level on that MapSquare.</li> </ul> * @param container container of this GameObject. + * @param mapX the x coordinate on the map or <code>0</code> + * @param mapY the y coordinate on the map or <code>0</code> * @throws IllegalStateException in case this GameObject is an Archetype * (Archetypes must not be added to a map). */ - void setContainer(@Nullable GameObjectContainer<G, A, R> container); + void setContainer(@Nullable GameObjectContainer<G, A, R> container, int mapX, int mapY); /** * Check whether this GameObject is in a Container (in Gridarta sense, which Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -66,22 +66,18 @@ /** * Creates a copy of a game object. * @param gameObject the game object to copy - * @param posx the x-map coordinate - * @param posy the y-map coordinate * @return the new game object */ @NotNull - G cloneGameObject(@NotNull G gameObject, int posx, int posy); + G cloneGameObject(@NotNull G gameObject); /** * Creates a copy of a game object, including tail parts. This object must * be the head part. * @param gameObject the game object to copy - * @param posx the x-map coordinate - * @param posy the y-map coordinate * @return the new game object */ @NotNull - G cloneMultiGameObject(@NotNull G gameObject, int posx, int posy); + G cloneMultiGameObject(@NotNull G gameObject); } // interface GameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -278,7 +278,7 @@ * @todo think whether expanding multiparts here is a good idea, maybe * MapModel is a better place. */ - private void expandMulti(final G gameObject, final Collection<G> objects) { + private void expandMulti(@NotNull final G gameObject, @NotNull final Collection<G> objects) { final Archetype<G, A, R> archetype = gameObject.getArchetype(); // is it a multi head (without any tail parts)? @@ -294,14 +294,13 @@ // we have a multi head and need to insert his tail now // do insertion for all non-head parts of the multi + final int posX = gameObject.getMapX(); + final int posY = gameObject.getMapY(); for (R oldPart = archetype.getMultiNext(); oldPart != null; oldPart = oldPart.getMultiNext()) { - final G newarch = gameObjectFactory.createGameObjectPart(oldPart, gameObject); - - objects.add(newarch); - - // set map position (x, y) - newarch.setMapX(gameObject.getMapX() + newarch.getArchetype().getMultiX()); - newarch.setMapY(gameObject.getMapY() + newarch.getArchetype().getMultiY()); + final G tailGameObject = gameObjectFactory.createGameObjectPart(oldPart, gameObject); + tailGameObject.setMapX(posX + oldPart.getMultiX()); + tailGameObject.setMapY(posY + oldPart.getMultiY()); + objects.add(tailGameObject); } } Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -286,7 +286,7 @@ public void addObjectListToMap(@NotNull final Iterable<G> objects) { for (final G gameObject : objects) { if (!gameObject.isInContainer()) { // only map arches.... - addGameObjectToMap(gameObject, topmostInsertionMode); + addGameObjectToMap(gameObject, new Point(gameObject.getMapX(), gameObject.getMapY()), topmostInsertionMode); } } } @@ -385,8 +385,8 @@ final Iterator<G> it2 = gameObjects.iterator(); while (it2.hasNext()) { final GameObject<G, A, R> gameObject = it2.next(); - final BaseObject<G, A, R, ?> topGameObject = gameObject.getTopContainer(); - if (topGameObject.getMapX() >= mapSize.getWidth() || topGameObject.getMapY() >= mapSize.getHeight()) { + final G topGameObject = gameObject.getTopContainer(); + if (topGameObject.getContainer() == null || topGameObject.getMapX() >= mapSize.getWidth() || topGameObject.getMapY() >= mapSize.getHeight()) { it2.remove(); } } @@ -861,15 +861,13 @@ for (final G part : parts) { final int mapX = pos.x + part.getArchetype().getMultiX(); final int mapY = pos.y + part.getArchetype().getMultiY(); - part.setMapX(mapX); - part.setMapY(mapY); gameObjectMatchers.updateEditType(part, activeEditType); insertionMode.insert(part, mapGrid.getMapSquare(mapX, mapY)); } final G head = parts.get(0); for (final G invObject : effectiveArchetype) { - head.addLast(gameObjectFactory.cloneGameObject(invObject, 0, 0)); + head.addLast(gameObjectFactory.cloneGameObject(invObject)); } return head; @@ -879,16 +877,14 @@ * {@inheritDoc} */ @Override - public void addGameObjectToMap(@NotNull final G gameObject, @NotNull final InsertionMode<G, A, R> insertionMode) { - final int mapX = gameObject.getMapX(); - final int mapY = gameObject.getMapY(); - if (!isPointValid(new Point(mapX, mapY))) { - log.error("addGameObjectToMap: trying to insert game object out of map bounds at " + mapX + "/" + mapY + ", map bounds is " + mapSize); + public void addGameObjectToMap(@NotNull final G gameObject, @NotNull final Point pos, @NotNull final InsertionMode<G, A, R> insertionMode) { + if (!isPointValid(pos)) { + log.error("addGameObjectToMap: trying to insert game object out of map bounds at " + pos.x + "/" + pos.y + ", map bounds is " + mapSize); return; } gameObjectMatchers.updateEditType(gameObject, activeEditType); - insertionMode.insert(gameObject, mapGrid.getMapSquare(mapX, mapY)); + insertionMode.insert(gameObject, mapGrid.getMapSquare(pos.x, pos.y)); } /** @@ -948,19 +944,17 @@ insertBaseObject(gameObject.getArchetype(), pos, allowDouble, false, insertionMode); } else { final G newGameObject = gameObject.newInstance(gameObjectFactory); - newGameObject.setMapX(pos.x); - newGameObject.setMapY(pos.y); for (GameObject<G, A, R> tmp = newGameObject; tmp != null; tmp = tmp.getMultiNext()) { - if (!isPointValid(new Point(tmp.getMapX(), tmp.getMapY()))) { + if (!isPointValid(new Point(pos.x + tmp.getArchetype().getMultiX(), pos.y + tmp.getArchetype().getMultiY()))) { // outside map return; } } - addGameObjectToMap(newGameObject, insertionMode); + addGameObjectToMap(newGameObject, pos, insertionMode); for (G tmp = newGameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { gameObjectMatchers.updateEditType(tmp, activeEditType); - addGameObjectToMap(tmp, insertionMode); + addGameObjectToMap(tmp, new Point(pos.x + tmp.getArchetype().getMultiX(), pos.y + tmp.getArchetype().getMultiY()), insertionMode); } } } Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -308,9 +308,10 @@ * <var>gameObject</var> is a new and unlinked object. * @param gameObject The new GameObject with set destination coordinates to * be linked onto the map. + * @param pos the insert location * @param insertionMode the insertion mode to use */ - void addGameObjectToMap(@NotNull G gameObject, @NotNull InsertionMode<G, A, R> insertionMode); + void addGameObjectToMap(@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode<G, A, R> insertionMode); /** * Inserts a {@link BaseObject} to a map. Archetypes are instantiated, game Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquare.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquare.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquare.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -133,6 +133,14 @@ } /** + * {@inheritDoc} + */ + @Override + protected void setThisContainer(@NotNull final G gameObject) { + gameObject.setContainer(this, mapX, mapY); + } + + /** * Returns the last occurrence of a matching game object. * @param gameObjectMatcher the matcher to use * @return the last match, or <code>null</code> if no such game object Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -89,7 +89,7 @@ for (final G content : mapSquare) { if (content.isHead()) { - list.add(gameObjectFactory.cloneMultiGameObject(content, x, y)); + list.add(gameObjectFactory.cloneMultiGameObject(content)); } } list.trimToSize(); Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -100,11 +100,8 @@ */ @NotNull @Override - public TestGameObject cloneGameObject(@NotNull final TestGameObject gameObject, final int posx, final int posy) { - final TestGameObject clone = gameObject.clone(); - clone.setMapX(posx); - clone.setMapY(posy); - return clone; + public TestGameObject cloneGameObject(@NotNull final TestGameObject gameObject) { + return gameObject.clone(); } } // class TestGameObjectFactory Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-23 18:01:55 UTC (rev 7942) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-23 21:47:54 UTC (rev 7943) @@ -251,7 +251,7 @@ /** * Test case for {@link DefaultMapModel#addGameObjectToMap(GameObject, - * InsertionMode)}. + * Point, InsertionMode)}. */ @Test public void testAddGameObjectToMap1() { @@ -272,7 +272,7 @@ /** * Test case for {@link DefaultMapModel#addGameObjectToMap(GameObject, - * InsertionMode)}. + * Point, InsertionMode)}. */ @Test public void testAddGameObjectToMap2() { @@ -374,9 +374,7 @@ */ private void addGameObjectToMap(final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel, final String name, final int x, final int y, final InsertionMode<TestGameObject, TestMapArchObject, TestArchetype> insertionMode) { final TestGameObject gameObject = newGameObject(name); - gameObject.setMapX(x); - gameObject.setMapY(y); - mapModel.addGameObjectToMap(gameObject, insertionMode); + mapModel.addGameObjectToMap(gameObject, new Point(x, y), insertionMode); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 22:22:39
|
Revision: 7944 http://gridarta.svn.sourceforge.net/gridarta/?rev=7944&view=rev Author: akirschbaum Date: 2010-05-23 22:22:32 +0000 (Sun, 23 May 2010) Log Message: ----------- Change return type of BaseObject.clone(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -116,7 +116,7 @@ @NotNull @Override public GameObject clone() { - return (GameObject) super.clone(); + return super.clone(); } /** Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -101,7 +101,7 @@ @NotNull @Override public GameObject clone() { - return (GameObject) super.clone(); + return super.clone(); } /** Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -116,7 +116,7 @@ @NotNull @Override public GameObject clone() { - return (GameObject) super.clone(); + return super.clone(); } /** Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -158,9 +158,10 @@ */ @NotNull @Override - public Object clone() { - final AbstractArchetype<?, ?, ?> clone = (AbstractArchetype<?, ?, ?>) super.clone(); - return clone; + @SuppressWarnings({ "unchecked" }) + public R clone() { + final AbstractArchetype<G, A, R> clone = (AbstractArchetype<G, A, R>) super.clone(); + return clone.getThis(); } /** Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -72,13 +72,13 @@ this.gameObjectFactory = gameObjectFactory; } - public void init(@Nullable final BaseObject<G, A, R, ?> prototype, @NotNull final ErrorViewCollector errorViewCollector) { + public void init(@Nullable final BaseObject<G, A, R, R> prototype, @NotNull final ErrorViewCollector errorViewCollector) { this.errorViewCollector = errorViewCollector; // start with new clean GameObject instance if (prototype == null) { archetype = gameObjectFactory.newArchetype(""); // XXX: undefined archetype name } else { - archetype = (R) prototype.clone(); + archetype = prototype.clone(); } attributes.clear(); } Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -675,15 +675,16 @@ */ @Override @NotNull - public Object clone() { - final AbstractBaseObject<?, ?, ?, ?> clone = (AbstractBaseObject<?, ?, ?, ?>) super.clone(); + @SuppressWarnings({ "unchecked" }) + public T clone() { + final AbstractBaseObject<G, A, R, T> clone = (AbstractBaseObject<G, A, R, T>) super.clone(); // clone.archetype = archetype; // will NOT be cloned: archetypes are unique clone.gameObjectText = gameObjectText.clone(); if (msgText != null) { clone.msgText = new StringBuilder(msgText); } clone.multi = null; - return clone; + return clone.getThis(); } /** Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -478,7 +478,7 @@ * {@inheritDoc} */ @NotNull - Object clone(); + T clone(); @NotNull String getLoreText(); Modified: trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -599,8 +599,8 @@ try { final GameObjectContainer<G, A, R> clone = (GameObjectContainer<G, A, R>) super.clone(); clone.initData(); - for (final BaseObject<G, A, R, ?> gameObject : contents) { - final G clonedGameObject = (G) gameObject.clone(); + for (final BaseObject<G, A, R, G> gameObject : contents) { + final G clonedGameObject = gameObject.clone(); clone.contents.add(clonedGameObject); setThisContainer(clonedGameObject); } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -129,10 +129,11 @@ */ @NotNull @Override - public Object clone() { - final AbstractGameObject<?, ?, ?> clone = (AbstractGameObject<?, ?, ?>) super.clone(); + @SuppressWarnings({ "unchecked" }) + public G clone() { + final AbstractGameObject<G, A, R> clone = (AbstractGameObject<G, A, R>) super.clone(); clone.container = null; - return clone; + return clone.getThis(); } /** Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractIsoGameObjectFactory.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -36,7 +36,7 @@ @NotNull @Override public G cloneGameObject(@NotNull final G gameObject) { - return (G) gameObject.clone(); + return gameObject.clone(); } } // class AbstractIsoGameObjectFactory Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -155,8 +155,9 @@ @NotNull @Override @SuppressWarnings({ "unchecked" }) - public DefaultIsoGameObject<G, A, R> clone() { - return (DefaultIsoGameObject<G, A, R>) super.clone(); + public G clone() { + final DefaultIsoGameObject<G, A, R> clone = (DefaultIsoGameObject<G, A, R>) super.clone(); + return clone.getThis(); } /** Modified: trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -53,7 +53,7 @@ @NotNull @Override public TestArchetype clone() { - return (TestArchetype) super.clone(); + return super.clone(); } /** Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java 2010-05-23 21:47:54 UTC (rev 7943) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java 2010-05-23 22:22:32 UTC (rev 7944) @@ -109,7 +109,7 @@ @NotNull @Override public TestGameObject clone() { - return (TestGameObject) super.clone(); + return super.clone(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 22:30:35
|
Revision: 7947 http://gridarta.svn.sourceforge.net/gridarta/?rev=7947&view=rev Author: akirschbaum Date: 2010-05-23 22:30:29 +0000 (Sun, 23 May 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:28:25 UTC (rev 7946) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:30:29 UTC (rev 7947) @@ -53,7 +53,7 @@ private final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel; /** - * The {@link AutojoinLists} instacne to use. + * The {@link AutojoinLists} instance to use. */ @NotNull private final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists; Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:28:25 UTC (rev 7946) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:30:29 UTC (rev 7947) @@ -53,7 +53,7 @@ private final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel; /** - * The {@link AutojoinLists} instacne to use. + * The {@link AutojoinLists} instance to use. */ @NotNull private final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists; Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:28:25 UTC (rev 7946) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/mapcontrol/DefaultMapControlFactory.java 2010-05-23 22:30:29 UTC (rev 7947) @@ -53,7 +53,7 @@ private final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel; /** - * The {@link AutojoinLists} instacne to use. + * The {@link AutojoinLists} instance to use. */ @NotNull private final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists; Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 22:28:25 UTC (rev 7946) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 22:30:29 UTC (rev 7947) @@ -264,14 +264,14 @@ /** * Set the X coordinate of this GameObject on its map. - * @param mapx x coordinate + * @param mapX x coordinate * @warning Only use this method during the load process. */ void setMapX(int mapX); /** * Set the Y coordinate of this GameObject on its map. - * @param mapy y coordinate + * @param mapY y coordinate * @warning Only use this method during the load process. */ void setMapY(int mapY); @@ -469,7 +469,7 @@ * Returns whether this base object is an {@link Archetype}. * @return <code>true</code> if this base object is an archetype, * <code>false</code> if it is a game object - * @see #isArtifact() + * @see Archetype#isArtifact() */ @Deprecated boolean isArchetype(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 22:44:05
|
Revision: 7950 http://gridarta.svn.sourceforge.net/gridarta/?rev=7950&view=rev Author: akirschbaum Date: 2010-05-23 22:43:59 +0000 (Sun, 23 May 2010) Log Message: ----------- Change return type of MapArchObject.clone(). Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -404,8 +404,16 @@ */ @NotNull @Override - public Object clone() { + public MapArchObject clone() { return super.clone(); } + /** + * {@inheritDoc} + */ + @Override + protected MapArchObject getThis() { + return this; + } + } // class MapArchObject Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -453,10 +453,18 @@ */ @NotNull @Override - public Object clone() { - final MapArchObject clone = (MapArchObject) super.clone(); + public MapArchObject clone() { + final MapArchObject clone = super.clone(); clone.loreText = new StringBuilder(loreText.toString()); return clone; } + /** + * {@inheritDoc} + */ + @Override + protected MapArchObject getThis() { + return this; + } + } // class MapArchObject Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -363,8 +363,16 @@ */ @NotNull @Override - public Object clone() { + public MapArchObject clone() { return super.clone(); } + /** + * {@inheritDoc} + */ + @Override + protected MapArchObject getThis() { + return this; + } + } // class MapArchObject Modified: trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/src/app/net/sf/gridarta/gui/undo/UndoControl.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -116,7 +116,7 @@ @Override public void beginTransaction(@NotNull final MapModel<G, A, R> mapModel, @NotNull final String name) { undoModel = undoModels.get(mapModel); - undoState = new UndoState<G, A, R>(name, (A) mapModel.getMapArchObject().clone()); + undoState = new UndoState<G, A, R>(name, mapModel.getMapArchObject().clone()); } /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -607,16 +607,23 @@ */ @NotNull @Override - public Object clone() { - final AbstractMapArchObject<?> clone; + @SuppressWarnings({ "unchecked" }) + public A clone() { + final AbstractMapArchObject<A> clone; try { - clone = (AbstractMapArchObject<?>) super.clone(); + clone = (AbstractMapArchObject<A>) super.clone(); } catch (final CloneNotSupportedException ex) { throw new AssertionError(ex); } clone.msgText = new StringBuilder(msgText.toString()); clone.tilePaths = tilePaths.clone(); - return clone; + return clone.getThis(); } + /** + * Returns this map arch object cast to its real type. + * @return this map arch object + */ + protected abstract A getThis(); + } // class AbstractMapArchObject Modified: trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/src/app/net/sf/gridarta/model/map/maparchobject/MapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -198,7 +198,7 @@ * @return Newly created clone of this object. */ @NotNull - Object clone(); + A clone(); /** * Register an event listener. Modified: trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java 2010-05-23 22:37:07 UTC (rev 7949) +++ trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java 2010-05-23 22:43:59 UTC (rev 7950) @@ -253,9 +253,9 @@ */ @NotNull @Override - public Object clone() { + public TestMapArchObject clone() { try { - return super.clone(); + return (TestMapArchObject) super.clone(); } catch (final CloneNotSupportedException ex) { throw new AssertionError(ex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-23 23:47:09
|
Revision: 7953 http://gridarta.svn.sourceforge.net/gridarta/?rev=7953&view=rev Author: akirschbaum Date: 2010-05-23 23:46:58 +0000 (Sun, 23 May 2010) Log Message: ----------- Fix or suppress compiler warnings about implicit numeric conversions. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/src/app/net/sf/gridarta/commands/SyntaxErrorException.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/FolderListCellRenderer.java trunk/src/app/net/sf/gridarta/gui/connectionview/LockedItemsView.java trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterView.java trunk/src/app/net/sf/gridarta/gui/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorEvent.java trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/NoExitPathException.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/src/app/net/sf/gridarta/gui/misc/MainView.java trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java trunk/src/app/net/sf/gridarta/gui/misc/Recent.java trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/mapfiles/InvalidNameException.java trunk/src/app/net/sf/gridarta/mapfiles/MapFileNameComparator.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolderNotEmptyException.java trunk/src/app/net/sf/gridarta/model/anim/DefaultAnimationObjects.java trunk/src/app/net/sf/gridarta/model/archetypetype/MissingAttributeException.java trunk/src/app/net/sf/gridarta/model/autojoin/IllegalAutojoinListException.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectText.java trunk/src/app/net/sf/gridarta/model/data/AbstractNamedObjects.java trunk/src/app/net/sf/gridarta/model/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/model/face/CollectedFaceProvider.java trunk/src/app/net/sf/gridarta/model/face/ColourFilter.java trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiArchData.java trunk/src/app/net/sf/gridarta/model/gameobject/NotInsideContainerException.java trunk/src/app/net/sf/gridarta/model/io/DirectoryCacheFiles.java trunk/src/app/net/sf/gridarta/model/io/InvalidMapFormatException.java trunk/src/app/net/sf/gridarta/model/map/grid/MapGridEvent.java trunk/src/app/net/sf/gridarta/model/map/maparchobject/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java trunk/src/app/net/sf/gridarta/model/map/normalizer/IOErrorException.java trunk/src/app/net/sf/gridarta/model/map/normalizer/InvalidPathException.java trunk/src/app/net/sf/gridarta/model/map/normalizer/RelativePathOnUnsavedMapException.java trunk/src/app/net/sf/gridarta/model/map/normalizer/SameMapException.java trunk/src/app/net/sf/gridarta/model/map/validation/DefaultErrorCollector.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/AttributeRangeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedMobOrSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/BlockedSquareError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectedInsideContainerError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectedPickableError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectionError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectionWithoutSinksError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ConnectionWithoutSourcesError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/CustomTypeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/DoubleLayerError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/DoubleTypeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/EmptySpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/EnvironmentSensorSlayingError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ExitError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectValidationError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/GameObjectsValidationError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/MapDifficultyError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/MapValidationError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/MobOutsideSpawnPointError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ShopSquareError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SlayingError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SquareValidationError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SquareWithoutFloorError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/SysObjectNotOnLayerZeroError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/TilePathsError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UndefinedAnimError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UndefinedArchetypeError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UndefinedFaceError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/UnsetSlayingError.java trunk/src/app/net/sf/gridarta/model/map/validation/errors/ValidationError.java trunk/src/app/net/sf/gridarta/model/match/MutableNameGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/MutableOrGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/NamedGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/NotGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/OrGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/ParsingException.java trunk/src/app/net/sf/gridarta/model/match/SetEnabledAction.java trunk/src/app/net/sf/gridarta/model/match/TypeNrsGameObjectMatcher.java trunk/src/app/net/sf/gridarta/model/match/ViewGameObjectMatcherManager.java trunk/src/app/net/sf/gridarta/model/treasurelist/ArchTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/FolderTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/NoTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureListTreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java trunk/src/app/net/sf/gridarta/model/treasurelist/YesTreasureObj.java trunk/src/app/net/sf/gridarta/script/ScriptExecException.java trunk/src/app/net/sf/gridarta/script/parameter/NoSuchParameterException.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxStyles.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxUtilities.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/Token.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/LuaTokenMarker.java trunk/src/app/net/sf/gridarta/textedit/textarea/tokenmarker/Node.java trunk/src/app/net/sf/gridarta/updater/UpdaterManager.java trunk/src/app/net/sf/gridarta/utils/EventListenerList2.java trunk/src/app/net/sf/gridarta/validation/checks/ConnectionUnknownError.java trunk/src/app/net/sf/gridarta/validation/checks/InvalidCheckException.java trunk/src/test/net/sf/gridarta/gui/map/renderer/TestMapRenderer.java trunk/src/test/net/sf/gridarta/model/archetype/TestArchetype.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java trunk/src/test/net/sf/gridarta/model/map/maparchobject/TestMapArchObject.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -41,7 +41,7 @@ /** * Serial Version. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * No save map. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/SimpleFlatMapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -48,7 +48,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The map model to render. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -249,7 +249,7 @@ gbcTextField.insets = new Insets(2, 2, 2, 2); gbcTextField.fill = GridBagConstraints.HORIZONTAL; - gbcTextField.weightx = 1; + gbcTextField.weightx = 1.0; gbcTextField.gridwidth = GridBagConstraints.REMAINDER; gbcCheckBox.insets = new Insets(2, 2, 2, 2); @@ -649,7 +649,7 @@ */ private static double parsePropertyToDouble(@NotNull final String s, @NotNull final String label) { if (s.length() == 0) { - return 0; // empty string is interpreted as zero + return 0.0; // empty string is interpreted as zero } final double r; // return value @@ -661,7 +661,7 @@ } // negative values are not allowed - if (r < 0) { + if (r < 0.0) { throw new IllegalArgumentException(label + ": '" + s + "' is negative."); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/DefaultArchetype.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -35,7 +35,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Creates a new instance. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/MapArchObjectParser.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -76,7 +76,7 @@ format.format("shopitems %s\n", mapArchObject.getShopItems()); } // The following floating point equality comparison is assumed to be okay - if (mapArchObject.getShopGreed() != 0) { + if (mapArchObject.getShopGreed() != 0.0) { format.format("shopgreed %g\n", mapArchObject.getShopGreed()); } if (mapArchObject.getShopMin() != 0) { Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -105,7 +105,7 @@ /** * The greed of the shop. */ - private double shopGreed = 0; + private double shopGreed = 0.0; /** * The minimum price the shop will trade for. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -35,7 +35,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Creates a new instance. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -36,7 +36,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Create a new undefined archetype with the given archetype name. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -41,7 +41,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * No save map. Modified: trunk/src/app/net/sf/gridarta/commands/SyntaxErrorException.java =================================================================== --- trunk/src/app/net/sf/gridarta/commands/SyntaxErrorException.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/commands/SyntaxErrorException.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -30,7 +30,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Creates a new instance. Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/FolderListCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/FolderListCellRenderer.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/FolderListCellRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -34,7 +34,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * {@inheritDoc} Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/LockedItemsView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/LockedItemsView.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/LockedItemsView.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -39,7 +39,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The type numbers to consider. Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterView.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterView.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -38,7 +38,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link GameObjectMatcher} for matching monster objects. Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/View.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/View.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/View.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -58,7 +58,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The connections. Modified: trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/data/NamedNodeTreeCellRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -37,7 +37,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link FaceObjectProviders} for looking up faces. Modified: trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/filter/FilterMenuEntry.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -45,7 +45,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; @NotNull private final NamedFilterConfig config; Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -47,7 +47,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -47,7 +47,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {link DialogAttribuBitmask} where this change button belongs to. Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -38,7 +38,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; private final CFTreasureListTree<G, A, R> treasureListTree; Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -107,7 +107,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** {@inheritDoc} */ @Override Modified: trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorEvent.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorEvent.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -31,7 +31,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Constructs a MapCursorEvent. Modified: trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/event/MouseOpEvent.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -39,7 +39,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The map view on which this event occurred. Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/NoExitPathException.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/NoExitPathException.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/NoExitPathException.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -28,6 +28,6 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; } // class NoExitPathException Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapView.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -62,7 +62,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The controller of this view. Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewBasic.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -61,7 +61,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link MapModel} to display. Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/SimpleIsoMapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -39,7 +39,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The game object type number of spawn points. Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -254,7 +254,7 @@ final GridBagConstraints gbcComboBox = new GridBagConstraints(); gbcComboBox.fill = GridBagConstraints.HORIZONTAL; - gbcComboBox.weightx = 1; + gbcComboBox.weightx = 1.0; gbcComboBox.gridwidth = GridBagConstraints.REMAINDER; final GridBagConstraints gbcCheckBox = new GridBagConstraints(); Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/SelectionTool.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -221,7 +221,7 @@ final GridBagConstraints gbcComboBox = new GridBagConstraints(); gbcComboBox.fill = GridBagConstraints.HORIZONTAL; - gbcComboBox.weightx = 1; + gbcComboBox.weightx = 1.0; gbcComboBox.gridwidth = GridBagConstraints.REMAINDER; final GridBagConstraints gbcCheckBox = new GridBagConstraints(); Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolPalette.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -53,7 +53,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder. Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/ToolSelector.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -60,7 +60,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The Action Builder. @@ -235,7 +235,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The tool to select with this action. Modified: trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/map/viewaction/ViewAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -40,7 +40,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder to create Actions. Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -73,7 +73,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * All open map views. Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/WindowAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -48,7 +48,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The map desktop. Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -39,7 +39,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The model the {@link #mapFolder} is part of. Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -178,13 +178,13 @@ } final long imageLastModified = imageFile.lastModified(); - if (imageLastModified == 0) { + if (imageLastModified == 0L) { // image file does not exist or is unreadable return null; } final long mapLastModified = mapFile.lastModified(); - if (mapLastModified == 0 || mapLastModified >= imageLastModified) { + if (mapLastModified == 0L || mapLastModified >= imageLastModified) { // image file is older than map file ==> outdated deleteCacheFile(imageFile); return null; Modified: trunk/src/app/net/sf/gridarta/gui/misc/MainView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/misc/MainView.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -158,7 +158,7 @@ frame.add(tabbedPanel, BorderLayout.CENTER); // set bounds (location and size) of the main frame - frame.setBounds(prefs.getInt(WINDOW_X, (int) (screen.getX() + (screen.getWidth() - defwidth) / 2.0)), prefs.getInt(WINDOW_Y, (int) (screen.getY() + (screen.getHeight() - defheight) / 2.0)), prefs.getInt(WINDOW_WIDTH, defwidth), prefs.getInt(WINDOW_HEIGHT, defheight)); + frame.setBounds(prefs.getInt(WINDOW_X, (int) (screen.getX() + (screen.getWidth() - (double) defwidth) / 2.0)), prefs.getInt(WINDOW_Y, (int) (screen.getY() + (screen.getHeight() - (double) defheight) / 2.0)), prefs.getInt(WINDOW_WIDTH, defwidth), prefs.getInt(WINDOW_HEIGHT, defheight)); frame.setExtendedState(prefs.getInt(WINDOW_STATE, frame.getExtendedState())); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/misc/MapPreview.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -316,8 +316,8 @@ * really might happen, so callers are expected to handle this. */ private void setScale(final double scale) throws OutOfMemoryError { - width = (int) (original.getWidth(this) * scale); - height = (int) (original.getHeight(this) * scale); + width = (int) ((double) original.getWidth(this) * scale); + height = (int) ((double) original.getHeight(this) * scale); rescale(); } Modified: trunk/src/app/net/sf/gridarta/gui/misc/Recent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/Recent.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/misc/Recent.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -47,7 +47,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link ActionBuilder}. Modified: trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/misc/StatusBar.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -338,9 +338,9 @@ @Nullable private static String getMemoryString(final long mem) { for (int i = UNITS.length - 1; i >= 0; i--) { - final int m = 1 << i * 10; + final long m = 1L << (long) (i * 10); if (mem > m) { - return FORMAT.format((double) mem / m) + UNITS[i]; + return FORMAT.format((double) mem / (double) m) + UNITS[i]; } } assert false; Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -48,7 +48,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder to create Actions. Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -53,7 +53,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder. Modified: trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -54,7 +54,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The preferences key for the type. Modified: trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -60,7 +60,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder. Modified: trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -49,7 +49,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Action Builder. Modified: trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -103,7 +103,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The script control listener to be notified about changes in {@link Modified: trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/script/ScriptViewPane.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -27,7 +27,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; public Window dialog = null; Modified: trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/shrinkmapsizedialog/ShrinkMapSizeDialog.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -138,10 +138,10 @@ @NotNull private JPanel createPanel() { final JComponent label = new JLabel(ACTION_BUILDER.getString("shrinkMapSizeDialogLabel")); - label.setAlignmentX(0); - eastCheckBox.setAlignmentX(0); - southCheckBox.setAlignmentX(0); - warnings.setAlignmentX(0); + label.setAlignmentX(0.0F); + eastCheckBox.setAlignmentX(0.0F); + southCheckBox.setAlignmentX(0.0F); + warnings.setAlignmentX(0.0F); final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.setBorder(GUIConstants.DIALOG_BORDER); Modified: trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -279,7 +279,7 @@ int c; // character value, read from the stream int t = 0; // index - long count = 0; // counter (to realize when shooting past EOF) + long count = 0L; // counter (to realize when shooting past EOF) final long maxCount = READ_MAX; // bail out when counter exceeds this value do { Modified: trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -173,7 +173,7 @@ splitPane.setDividerLocation(frame.getHeight() - buttonPanel.getMinimumSize().height - 4); splitPane.setDividerSize(4); - splitPane.setResizeWeight(1); + splitPane.setResizeWeight(1.0); // show the splitted pane (tree and buttons) frame.getContentPane().add(splitPane); Modified: trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/AbstractDialogManager.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -49,7 +49,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** {@inheritDoc} */ @Override Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -43,7 +43,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link JTextField} that displays the animation name. @@ -94,15 +94,15 @@ gbc.ipadx = 2; gbc.fill = GridBagConstraints.NONE; - gbc.weightx = 0; + gbc.weightx = 0.0; add(label, gbc); gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.weightx = 1; + gbc.weightx = 1.0; add(textField, gbc); gbc.fill = GridBagConstraints.NONE; - gbc.weightx = 0; + gbc.weightx = 0.0; add(button, gbc); } Modified: trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/AnimTreeChooseAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -38,7 +38,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The button showing the icon. Modified: trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/FaceComponent.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -43,7 +43,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link JTextField} that displays the face name. @@ -94,15 +94,15 @@ gbc.ipadx = 2; gbc.fill = GridBagConstraints.NONE; - gbc.weightx = 0; + gbc.weightx = 0.0; add(label, gbc); gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.weightx = 1; + gbc.weightx = 1.0; add(textField, gbc); gbc.fill = GridBagConstraints.NONE; - gbc.weightx = 0; + gbc.weightx = 0.0; add(button, gbc); } Modified: trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/FaceTreeChooseAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -38,7 +38,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The button showing the icon. Modified: trunk/src/app/net/sf/gridarta/gui/utils/GList.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GList.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/GList.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -36,7 +36,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link ToolTipProvider} for per-item tooltips. Set to Modified: trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/GSplitPane.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -100,7 +100,7 @@ private final HierarchyListener hierarchyListener = new HierarchyListener() { @Override public void hierarchyChanged(final HierarchyEvent e) { - if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0 && isShowing()) { + if ((e.getChangeFlags() & (long) HierarchyEvent.SHOWING_CHANGED) != 0L && isShowing()) { removeHierarchyListener(hierarchyListener); if (defaultDividerLocation == null) { // should not happen // ignore Modified: trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/ToggleTristateCheckBox.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -33,7 +33,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Creates a new instance. Modified: trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/TreeChooseAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -37,7 +37,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link JTextComponent} that holds the current face/animation name. Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderPanel.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -36,7 +36,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link BorderSplitPane BorderSplitPanes} showing the optional Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -40,7 +40,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The permanently shown {@link Component}. @@ -122,7 +122,7 @@ */ @Override public void hierarchyChanged(final HierarchyEvent e) { - if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0 && isShowing()) { + if ((e.getChangeFlags() & (long) HierarchyEvent.SHOWING_CHANGED) != 0L && isShowing()) { removeHierarchyListener(this); assert !showing; showing = true; Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/Location.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -76,7 +76,7 @@ */ @Override public double getSplitPaneResizeWeight() { - return 0; + return 0.0; } /** @@ -150,7 +150,7 @@ */ @Override public double getSplitPaneResizeWeight() { - return 1; + return 1.0; } /** @@ -224,7 +224,7 @@ */ @Override public double getSplitPaneResizeWeight() { - return 0; + return 0.0; } /** @@ -298,7 +298,7 @@ */ @Override public double getSplitPaneResizeWeight() { - return 1; + return 1.0; } /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/VerticalToggleButton.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -38,7 +38,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The transparent {@link Color} for filling the button's background. @@ -68,10 +68,10 @@ g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); if (right) { - g.rotate(Math.PI / 2); + g.rotate(Math.PI / 2.0); g.translate(0, 1 - textWidth); } else { - g.rotate(-Math.PI / 2); + g.rotate(-Math.PI / 2.0); g.translate(1 - textHeight, 0); } g.drawString(title, 0, fontMetrics.getAscent()); Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -227,7 +227,7 @@ final AbstractButton result = location.createButton((String) action.getValue(Action.NAME)); result.setMargin(location.isTopOrBottom() ? new Insets(0, SPACE, 0, SPACE) : new Insets(SPACE, 0, SPACE, 0)); if (acceleratorIndex != -1) { - result.setMnemonic('0' + index); + result.setMnemonic((int) '0' + index); } result.addMouseListener(mouseListener); return result; Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabButtonAction.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -35,7 +35,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link ActionBuilder}. Modified: trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/TabbedPanel.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -47,7 +47,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The {@link ActionBuilder}. Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateButtonModel.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -33,7 +33,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * The current state. Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -46,7 +46,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * Whether {@link #addMouseListener(MouseListener)} should ignore added @@ -118,7 +118,7 @@ /** * The serial version UID. */ - private static final long serialVersionUID = 1; + private static final long serialVersionUID = 1L; /** * {@inheritDoc} Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -281,7 +281,7 @@ } } if (log.isInfoEnabled()) { - log.info("Archetype loading took " + (System.currentTimeMillis() - timeStart) / 1000.0 + " seconds."); + log.info("Archetype loading took " + (double) (System.currentTimeMillis() - timeStart) / 1000.0 + " seconds."); } if (spellType != 0) { new ArchetypeSetSpellLoader<G, A, R>(gameObjectFactory).load(archetypeSet, spellType, gameObjectSpells); Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-23 23:01:41 UTC (rev 7952) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-23 23:46:58 UTC (rev 7953) @@ -150,7 +150,7 @@ public void run(@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory<G, A, R> editorFactory, @NotNull final String... args) { boolean err = false; // whether a fatal error (exit required) occurred. String script = null; - final LongOpt[] longopts = { new LongOpt("batchpng", LongOpt.NO_ARGUMENT, null, 'b'), new LongOpt("normal", LongOpt.NO_ARGUMENT, null, 'n'), new LongOpt("singlepng", LongOpt.NO_ARGUMENT, null, 's'), new LongOp... [truncated message content] |
From: <aki...@us...> - 2010-05-23 23:48:51
|
Revision: 7954 http://gridarta.svn.sourceforge.net/gridarta/?rev=7954&view=rev Author: akirschbaum Date: 2010-05-23 23:48:45 +0000 (Sun, 23 May 2010) Log Message: ----------- Rename parameter names. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/AbstractFlatMapRenderer.java 2010-05-23 23:48:45 UTC (rev 7954) @@ -534,12 +534,12 @@ /** * Paints one square. - * @param grfx the graphics context to draw to + * @param g the graphics context to draw to * @param x the square coordinate to paint to * @param y the square coordinate to paint to * @param square the square to paint */ - protected abstract void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square); + protected abstract void paintSquare(@NotNull final Graphics g, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square); /** * Updats cached information to new map grid size. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-05-23 23:48:45 UTC (rev 7954) @@ -137,7 +137,7 @@ * {@inheritDoc} */ @Override - public void configChanged(@NotNull final FilterConfigChangeType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatPickmapRenderer.java 2010-05-23 23:48:45 UTC (rev 7954) @@ -107,9 +107,9 @@ * {@inheritDoc} */ @Override - protected void paintSquare(@NotNull final Graphics grfx, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { - grfx.setColor(getBackground()); - grfx.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); + protected void paintSquare(@NotNull final Graphics g, final int x, final int y, @NotNull final MapSquare<GameObject, MapArchObject, Archetype> square) { + g.setColor(getBackground()); + g.fillRect(x, y, IGUIConstants.SQUARE_WIDTH, IGUIConstants.SQUARE_HEIGHT); if (square.isEmpty()) { return; } @@ -126,7 +126,7 @@ xx = IGUIConstants.SQUARE_WIDTH * (node.getArchetype().getMultiX() - node.getMinX()); yy = IGUIConstants.SQUARE_HEIGHT * (node.getArchetype().getMultiY() - node.getMinY()); } - grfx.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, xx, yy, xx + IGUIConstants.SQUARE_WIDTH, yy + IGUIConstants.SQUARE_HEIGHT, this); + g.drawImage(img.getImage(), x, y, x + IGUIConstants.SQUARE_WIDTH, y + IGUIConstants.SQUARE_HEIGHT, xx, yy, xx + IGUIConstants.SQUARE_WIDTH, yy + IGUIConstants.SQUARE_HEIGHT, this); } } Modified: trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-23 23:46:58 UTC (rev 7953) +++ trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-23 23:48:45 UTC (rev 7954) @@ -58,14 +58,14 @@ /** {@inheritDoc} */ @Override - public void visit(@NotNull final NamedFilterConfig config) { - menuItem = new FilterMenuEntry(config); + public void visit(@NotNull final NamedFilterConfig filterConfig) { + menuItem = new FilterMenuEntry(filterConfig); } /** {@inheritDoc} */ @Override - public void visit(@NotNull final NamedGameObjectMatcherFilterConfig config) { - menuItem = new JCheckBoxMenuItem(ACTION_BUILDER.createToggle(true, "enabled", config)); + public void visit(@NotNull final NamedGameObjectMatcherFilterConfig filterConfig) { + menuItem = new JCheckBoxMenuItem(ACTION_BUILDER.createToggle(true, "enabled", filterConfig)); } }; Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-23 23:46:58 UTC (rev 7953) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2010-05-23 23:48:45 UTC (rev 7954) @@ -118,7 +118,7 @@ * {@inheritDoc} */ @Override - public void configChanged(@NotNull final FilterConfigChangeType configEventType, @NotNull final FilterConfig<?, ?> filterConfig) { + public void configChanged(@NotNull final FilterConfigChangeType filterConfigChangeType, @NotNull final FilterConfig<?, ?> filterConfig) { forceRepaint(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 00:03:20
|
Revision: 7956 http://gridarta.svn.sourceforge.net/gridarta/?rev=7956&view=rev Author: akirschbaum Date: 2010-05-24 00:03:13 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/prefs/PrefsHelper.java Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/gridarta.ipr 2010-05-24 00:03:13 UTC (rev 7956) @@ -1126,6 +1126,7 @@ <dictionary name="ank"> <words> <w>accel</w> + <w>args</w> <w>atrinik</w> <w>attribute's</w> <w>autojoin</w> @@ -1133,12 +1134,14 @@ <w>backbuffer</w> <w>beanshell</w> <w>bitmask</w> + <w>checkboxes</w> <w>daimonin</w> <w>exiter</w> <w>filter<?, ?></w> <w>goto</w> <w>gridarta</w> <w>indices</w> + <w>javac</w> <w>longdescription</w> <w>matchers</w> <w>mmorpg</w> Modified: trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/AppPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -134,17 +134,17 @@ } /** - * Creates the subpanel with the external applications. - * @return subpanel + * Creates the sub-panel with the external applications. + * @return sub-panel */ private Component createAppPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsApps")); - serverField = prefsHelper.createFileField("optionsAppServer", appPrefsModel.getServer(), JFileChooser.FILES_ONLY); - clientField = prefsHelper.createFileField("optionsAppClient", appPrefsModel.getClient(), JFileChooser.FILES_ONLY); - editorField = prefsHelper.createFileField("optionsAppEditor", appPrefsModel.getEditor(), JFileChooser.FILES_ONLY); + serverField = preferencesHelper.createFileField("optionsAppServer", appPrefsModel.getServer(), JFileChooser.FILES_ONLY); + clientField = preferencesHelper.createFileField("optionsAppClient", appPrefsModel.getClient(), JFileChooser.FILES_ONLY); + editorField = preferencesHelper.createFileField("optionsAppEditor", appPrefsModel.getEditor(), JFileChooser.FILES_ONLY); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/DevPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -46,12 +46,12 @@ /** * Preferences key for using System.exit(). */ - public static final String PREFS_SYSTEM_EXIT = "systemExit"; + public static final String PREFERENCES_SYSTEM_EXIT = "systemExit"; /** * Preferences default value for using System.exit(). */ - public static final boolean PREFS_SYSTEM_EXIT_DEFAULT = true; + public static final boolean PREFERENCES_SYSTEM_EXIT_DEFAULT = true; /** * The serial version UID. @@ -66,15 +66,15 @@ /** * Preferences. */ - private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); + private static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class); /** - * Use Systme.exit() for exiting the program. + * Use System.exit() for exiting the program. */ private AbstractButton systemExit; /** - * Create a DevPrefs pane. + * Creates a new instance. */ public DevPrefs() { setListLabelText(ACTION_BUILDER.getString("prefsDev.title")); @@ -98,7 +98,7 @@ */ @Override public void apply() { - PREFS.putBoolean(PREFS_SYSTEM_EXIT, systemExit.isSelected()); + PREFERENCES.putBoolean(PREFERENCES_SYSTEM_EXIT, systemExit.isSelected()); } /** @@ -106,7 +106,7 @@ */ @Override public void revert() { - systemExit.setSelected(PREFS.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)); + systemExit.setSelected(PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT)); } /** @@ -122,21 +122,21 @@ */ @Override public boolean isChanged() { - return !(systemExit.isSelected() == PREFS.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)); + return !(systemExit.isSelected() == PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT)); } /** - * Creates the subpanel with the misc settings. - * @return subpanel + * Creates the sub-panel with the misc settings. + * @return sub-panel */ private Component createMiscPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsMisc")); systemExit = new JCheckBox(ACTION_BUILDER.createAction(false, "optionsSystemExit")); - systemExit.setSelected(PREFS.getBoolean(PREFS_SYSTEM_EXIT, PREFS_SYSTEM_EXIT_DEFAULT)); - prefsHelper.addComponent(systemExit); + systemExit.setSelected(PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT)); + preferencesHelper.addComponent(systemExit); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -57,7 +57,7 @@ /** * Preferences key for language. */ - public static final String PREFS_LANGUAGE = "language"; + public static final String PREFERENCES_LANGUAGE = "language"; /** * The serial version UID. @@ -72,7 +72,7 @@ /** * Preferences. */ - private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); + private static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class); /** * An empty <code>String</code> array. @@ -137,9 +137,9 @@ public void apply() { final Locale loc = (Locale) localeBox.getSelectedItem(); if (loc != null) { - prefs.put(PREFS_LANGUAGE, loc.getLanguage()); + PREFERENCES.put(PREFERENCES_LANGUAGE, loc.getLanguage()); } else { - prefs.remove(PREFS_LANGUAGE); + PREFERENCES.remove(PREFERENCES_LANGUAGE); } globalSettings.setShowMainToolbar(showMainToolbar.isSelected()); } @@ -149,7 +149,7 @@ */ @Override public void revert() { - final String current = prefs.get(PREFS_LANGUAGE, null); + final String current = PREFERENCES.get(PREFERENCES_LANGUAGE, null); localeBox.setSelectedIndex(Arrays.binarySearch(locales, current != null ? new Locale(current) : null, comp)); showMainToolbar.setSelected(globalSettings.isShowMainToolbar()); } @@ -169,7 +169,7 @@ @Override public boolean isChanged() { final Locale loc = (Locale) localeBox.getSelectedItem(); - final String currentName = prefs.get(PREFS_LANGUAGE, null); + final String currentName = PREFERENCES.get(PREFERENCES_LANGUAGE, null); final Locale current = currentName != null ? new Locale(currentName) : null; return !((loc == null ? current == null : loc.equals(current)) && showMainToolbar.isSelected() == globalSettings.isShowMainToolbar()); } @@ -195,7 +195,7 @@ localeBox = new JComboBox(locales); // set "content" localeBox.setRenderer(new LocaleListCellRenderer()); //localeBox.setPreferredSize(new Dimension(150, 25)); - final String current = prefs.get(PREFS_LANGUAGE, null); + final String current = PREFERENCES.get(PREFERENCES_LANGUAGE, null); localeBox.setSelectedIndex(Arrays.binarySearch(locales, current != null ? new Locale(current) : null, comp)); lineLayout.add(localeBox); @@ -203,31 +203,31 @@ } /** - * Creates the subpanel with the global settings. - * @return subpanel + * Creates the sub-panel with the global settings. + * @return sub-panel */ private Component createGlobalPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsGlobal")); - prefsHelper.addComponent(buildLocaleBox()); + preferencesHelper.addComponent(buildLocaleBox()); return panel; } /** - * Creates the subpanel with the layout settings. - * @return subpanel + * Creates the sub-panel with the layout settings. + * @return sub-panel */ private Component createLayoutPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsLayout")); showMainToolbar = new JCheckBox(ACTION_BUILDER.createAction(false, "optionsShowMainToolbar")); showMainToolbar.setSelected(globalSettings.isShowMainToolbar()); - prefsHelper.addComponent(showMainToolbar); + preferencesHelper.addComponent(showMainToolbar); return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MapValidatorPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -76,7 +76,7 @@ private AbstractButton autoValidate; /** - * Create an MapValidatorPrefs pane. + * Creates a new instance. * @param validators the delegating map validator that contains all the * validators * @param autoDefault Whether the auto-validator is enabled by default. @@ -149,29 +149,29 @@ /** * Create the Panel with the generic validation settings. - * @return subpanel + * @return sub-panel */ private Component createValidationPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsValidation")); autoValidate = new JCheckBox(ACTION_BUILDER.getString("autoValidate.text"), AutoValidator.isEnabled()); - prefsHelper.addComponent(autoValidate); + preferencesHelper.addComponent(autoValidate); return panel; } /** * Create the Panel with the validators information. - * @return subpanel + * @return sub-panel */ private Component createValidatorsPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsValidators")); for (final Validator validator : validators) { final JCheckBox checkBox = new JCheckBox(ACTION_BUILDER.getString(validator.getKey() + ".title"), validator.isEnabled()); checkBoxes.put(validator, checkBox); - prefsHelper.addComponent(checkBox); + preferencesHelper.addComponent(checkBox); } return panel; } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/MiscPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -170,54 +170,54 @@ } /** - * Creates the subpanel with the user settings. - * @return subpanel + * Creates the sub-panel with the user settings. + * @return sub-panel */ private Component createUserPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder(ACTION_BUILDER.getString("optionsUser"))); userField = new JTextField(globalSettings.getUsername()); - prefsHelper.addComponent(userField); + preferencesHelper.addComponent(userField); return panel; } /** - * Creates the subpanel with the check maps settings. - * @return subpanel + * Creates the sub-panel with the check maps settings. + * @return sub-panel */ private Component createCheckMapsPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder(ACTION_BUILDER.getString("optionsMisc"))); checkMaps = new JCheckBox(ACTION_BUILDER.createAction(false, "optionsCheckMaps")); checkMaps.setSelected(MapFileFilter.isPerformingRealChecks()); - prefsHelper.addComponent(checkMaps); + preferencesHelper.addComponent(checkMaps); return panel; } /** - * Creates the subpanel with the exit connector settings. - * @return subpanel + * Creates the sub-panel with the exit connector settings. + * @return sub-panel */ private Component createExitConnectorPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder(ACTION_BUILDER.getString("optionsExitConnector"))); pasteExitName = new JCheckBox(ACTION_BUILDER.createAction(false, "optionsExitConnectorPasteExitName")); pasteExitName.setSelected(exitConnectorModel.isPasteExitName()); - prefsHelper.addComponent(pasteExitName); + preferencesHelper.addComponent(pasteExitName); autoCreateExit = new JCheckBox(ACTION_BUILDER.createAction(false, "optionsExitConnectorAutoCreateExit")); autoCreateExit.setSelected(exitConnectorModel.isAutoCreateExit()); - prefsHelper.addComponent(autoCreateExit); + preferencesHelper.addComponent(autoCreateExit); final JComponent label = new JLabel(ACTION_BUILDER.getString("optionsExitConnectorExitArchetypeName.text")); label.setToolTipText(ACTION_BUILDER.getString("optionsExitConnectorExitArchetypeName.shortdescription")); - prefsHelper.addComponent(label); + preferencesHelper.addComponent(label); exitArchetypeName = new JTextField(exitConnectorModel.getExitArchetypeName()); - prefsHelper.addComponent(exitArchetypeName); + preferencesHelper.addComponent(exitArchetypeName); autoCreateExit.addChangeListener(new ChangeListener() { /** {@inheritDoc} */ Modified: trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -59,17 +59,17 @@ /** * The preferences key for the type. */ - private static final String NET_PREFS_KEY_TYPE = "proxy.type"; + private static final String NET_PREFERENCES_KEY_TYPE = "proxy.type"; /** * The preferences key for the type. */ - private static final String NET_PREFS_KEY_HOST = "proxy.host"; + private static final String NET_PREFERENCES_KEY_HOST = "proxy.host"; /** * The preferences key for the type. */ - private static final String NET_PREFS_KEY_PORT = "proxy.port"; + private static final String NET_PREFERENCES_KEY_PORT = "proxy.port"; /** * Action Builder. @@ -79,7 +79,7 @@ /** * Preferences. */ - private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); + private static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class); /** * JComboBox for selecting the proxy type. @@ -89,15 +89,15 @@ /** * TextField for server executable. */ - private final JTextComponent proxyHost = new JTextField(PREFS.get(NET_PREFS_KEY_HOST, "")); + private final JTextComponent proxyHost = new JTextField(PREFERENCES.get(NET_PREFERENCES_KEY_HOST, "")); /** * TextField for client executable. */ - private final JSpinner proxyPort = new JSpinner(new SpinnerNumberModel(PREFS.getInt(NET_PREFS_KEY_PORT, 3128), 1, 65535, 1)); + private final JSpinner proxyPort = new JSpinner(new SpinnerNumberModel(PREFERENCES.getInt(NET_PREFERENCES_KEY_PORT, 3128), 1, 65535, 1)); /** - * Create a NetPrefs pane. + * Creates a new instance. */ public NetPrefs() { setListLabelText(ACTION_BUILDER.getString("prefsNet.title")); @@ -123,7 +123,7 @@ */ @Override public boolean isChanged() { - return !(proxyType.getSelectedItem() == Proxy.Type.valueOf(PREFS.get(NET_PREFS_KEY_TYPE, "DIRECT")) && PREFS.get(NET_PREFS_KEY_HOST, "").equals(proxyHost.getText()) && PREFS.getInt(NET_PREFS_KEY_PORT, 3128) == (Integer) proxyPort.getValue()); + return !(proxyType.getSelectedItem() == Proxy.Type.valueOf(PREFERENCES.get(NET_PREFERENCES_KEY_TYPE, "DIRECT")) && PREFERENCES.get(NET_PREFERENCES_KEY_HOST, "").equals(proxyHost.getText()) && PREFERENCES.getInt(NET_PREFERENCES_KEY_PORT, 3128) == (Integer) proxyPort.getValue()); } @@ -132,9 +132,9 @@ */ @Override public void defaults() { - PREFS.remove(NET_PREFS_KEY_TYPE); - PREFS.remove(NET_PREFS_KEY_HOST); - PREFS.remove(NET_PREFS_KEY_PORT); + PREFERENCES.remove(NET_PREFERENCES_KEY_TYPE); + PREFERENCES.remove(NET_PREFERENCES_KEY_HOST); + PREFERENCES.remove(NET_PREFERENCES_KEY_PORT); revert(); } @@ -146,13 +146,13 @@ public void revert() { //XXX: suppression needed because some javac versions (1.6.0_01, 1.6.0_16, 1.7.0-ea) report incomparable types //noinspection TypeMayBeWeakened - final Proxy.Type keyType = Proxy.Type.valueOf(PREFS.get(NET_PREFS_KEY_TYPE, "DIRECT")); + final Proxy.Type keyType = Proxy.Type.valueOf(PREFERENCES.get(NET_PREFERENCES_KEY_TYPE, "DIRECT")); proxyType.setSelectedIndex(keyType.ordinal()); final boolean enableProxy = keyType != Proxy.Type.DIRECT; proxyHost.setEnabled(enableProxy); proxyPort.setEnabled(enableProxy); - proxyHost.setText(PREFS.get(NET_PREFS_KEY_HOST, "")); - proxyPort.setValue(PREFS.getInt(NET_PREFS_KEY_PORT, 3128)); + proxyHost.setText(PREFERENCES.get(NET_PREFERENCES_KEY_HOST, "")); + proxyPort.setValue(PREFERENCES.getInt(NET_PREFERENCES_KEY_PORT, 3128)); } /** @@ -163,22 +163,22 @@ //JComboBox does not use type parameters @SuppressWarnings({ "unchecked" }) final Enum<Proxy.Type> typeEnum = (Enum<Proxy.Type>) proxyType.getSelectedItem(); - PREFS.put(NET_PREFS_KEY_TYPE, typeEnum.name()); - PREFS.put(NET_PREFS_KEY_HOST, proxyHost.getText()); - PREFS.putInt(NET_PREFS_KEY_PORT, (Integer) proxyPort.getValue()); + PREFERENCES.put(NET_PREFERENCES_KEY_TYPE, typeEnum.name()); + PREFERENCES.put(NET_PREFERENCES_KEY_HOST, proxyHost.getText()); + PREFERENCES.putInt(NET_PREFERENCES_KEY_PORT, (Integer) proxyPort.getValue()); } /** - * Creates the subpanel with the external applications. - * @return subpanel + * Creates the sub-panel with the external applications. + * @return sub-panel */ private Component createNetPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsNetProxy")); - prefsHelper.addComponent(proxyType); - prefsHelper.addComponent(proxyHost); - prefsHelper.addComponent(proxyPort); + preferencesHelper.addComponent(proxyType); + preferencesHelper.addComponent(proxyHost); + preferencesHelper.addComponent(proxyPort); return panel; } @@ -196,11 +196,11 @@ * @return currently preferred proxy */ public static Proxy getProxy() { - final Proxy.Type proxyType = Proxy.Type.valueOf(PREFS.get(NET_PREFS_KEY_TYPE, "DIRECT")); + final Proxy.Type proxyType = Proxy.Type.valueOf(PREFERENCES.get(NET_PREFERENCES_KEY_TYPE, "DIRECT")); if (proxyType == Proxy.Type.DIRECT) { return Proxy.NO_PROXY; } - return new Proxy(proxyType, new InetSocketAddress(PREFS.get(NET_PREFS_KEY_HOST, "proxy"), PREFS.getInt(NET_PREFS_KEY_PORT, 3128))); + return new Proxy(proxyType, new InetSocketAddress(PREFERENCES.get(NET_PREFERENCES_KEY_HOST, "proxy"), PREFERENCES.getInt(NET_PREFERENCES_KEY_PORT, 3128))); } /** Copied: trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java (from rev 7946, trunk/src/app/net/sf/gridarta/gui/prefs/PrefsHelper.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -0,0 +1,97 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gui.prefs; + +import java.awt.Component; +import java.awt.Container; +import java.awt.GridBagConstraints; +import javax.swing.JLabel; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.misc.JFileField; +import org.jetbrains.annotations.NotNull; + +/** + * Helper class for preference panes. + * @author Andreas Kirschbaum + */ +public class PreferencesHelper { + + /** + * The {@link ActionBuilder}. + */ + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link Container} to add to. + */ + @NotNull + private final Container container; + + /** + * The {@link GridBagConstraints} for adding elements. + */ + @NotNull + private final GridBagConstraints gbc = new GridBagConstraints(); + + /** + * Creates a new instance. + * @param container the container to add to + */ + public PreferencesHelper(@NotNull final Container container) { + this.container = container; + gbc.gridx = 0; + gbc.gridy = 0; + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.weightx = 1.0; + } + + /** + * Creates a {@link JFileField} for choosing a file and adds it to the + * container. + * @param key the preferences key + * @param initial the initial file to show + * @param fileSelectionMode the file selection mode + * @return the created file field + */ + @NotNull + public JFileField createFileField(@NotNull final String key, @NotNull final String initial, final int fileSelectionMode) { + addComponent(new JLabel(ACTION_BUILDER.getString(key) + ":")); + + final JFileField fileField = new JFileField(initial, fileSelectionMode); + final String tooltip = ACTION_BUILDER.getString(key + ".shortdescription"); + if (tooltip != null) { + fileField.setToolTipText(tooltip); + } + addComponent(fileField); + + return fileField; + } + + /** + * Adds a component to the container. + * @param component the component to add + */ + public void addComponent(@NotNull final Component component) { + container.add(component, gbc); + gbc.gridy++; + } + +} // class PreferencesHelper Property changes on: trunk/src/app/net/sf/gridarta/gui/prefs/PreferencesHelper.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Deleted: trunk/src/app/net/sf/gridarta/gui/prefs/PrefsHelper.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/PrefsHelper.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/PrefsHelper.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -1,97 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.prefs; - -import java.awt.Component; -import java.awt.Container; -import java.awt.GridBagConstraints; -import javax.swing.JLabel; -import net.sf.japi.swing.action.ActionBuilder; -import net.sf.japi.swing.action.ActionBuilderFactory; -import net.sf.japi.swing.misc.JFileField; -import org.jetbrains.annotations.NotNull; - -/** - * Helper class for preference panes. - * @author Andreas Kirschbaum - */ -public class PrefsHelper { - - /** - * The {@link ActionBuilder}. - */ - private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); - - /** - * The {@link Container} to add to. - */ - @NotNull - private final Container container; - - /** - * The {@link GridBagConstraints} for adding elements. - */ - @NotNull - private final GridBagConstraints gbc = new GridBagConstraints(); - - /** - * Creates a new instance. - * @param container the container to add to - */ - public PrefsHelper(@NotNull final Container container) { - this.container = container; - gbc.gridx = 0; - gbc.gridy = 0; - gbc.fill = GridBagConstraints.HORIZONTAL; - gbc.weightx = 1.0; - } - - /** - * Creates a {@link JFileField} for choosing a file and adds it to the - * container. - * @param key the preferences key - * @param initial the initial file to show - * @param fileSelectionMode the file selection mode - * @return the created file field - */ - @NotNull - public JFileField createFileField(@NotNull final String key, @NotNull final String initial, final int fileSelectionMode) { - addComponent(new JLabel(ACTION_BUILDER.getString(key) + ":")); - - final JFileField fileField = new JFileField(initial, fileSelectionMode); - final String tooltip = ACTION_BUILDER.getString(key + ".shortdescription"); - if (tooltip != null) { - fileField.setToolTipText(tooltip); - } - addComponent(fileField); - - return fileField; - } - - /** - * Adds a component to the container. - * @param component the component to add - */ - public void addComponent(@NotNull final Component component) { - container.add(component, gbc); - gbc.gridy++; - } - -} // class PrefsHelper Modified: trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/ResPrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -214,42 +214,42 @@ } /** - * Creates the subpanel with the resource paths. - * @return subpanel + * Creates the sub-panel with the resource paths. + * @return sub-panel */ private Component createResourcePanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsResPaths")); - archField = prefsHelper.createFileField("optionsResArch", globalSettings.getArchDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); - mapField = prefsHelper.createFileField("optionsResMaps", globalSettings.getMapsDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); + archField = preferencesHelper.createFileField("optionsResArch", globalSettings.getArchDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); + mapField = preferencesHelper.createFileField("optionsResMaps", globalSettings.getMapsDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); if (globalSettings.hasMediaDirectory()) { - mediaField = prefsHelper.createFileField("optionsResMedia", globalSettings.getMediaDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); + mediaField = preferencesHelper.createFileField("optionsResMedia", globalSettings.getMediaDirectory().getPath(), JFileChooser.DIRECTORIES_ONLY); } return panel; } /** - * Creates the subpanel with the global settings. - * @return subpanel + * Creates the sub-panel with the global settings. + * @return sub-panel */ @NotNull private Component createGlobalPanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsGlobal")); configSourceComboBox = new JComboBox(configSourceFactory.getConfigSources()); final ConfigSource configSource = globalSettings.getConfigSource(); configSourceComboBox.setSelectedItem(configSource); configSourceComboBox.addItemListener(itemListener); - prefsHelper.addComponent(new JLabel(ACTION_BUILDER.getString("optionsConfigSource.text"))); - prefsHelper.addComponent(configSourceComboBox); + preferencesHelper.addComponent(new JLabel(ACTION_BUILDER.getString("optionsConfigSource.text"))); + preferencesHelper.addComponent(configSourceComboBox); archField.setEnabled(configSource.isArchDirectoryInputFieldEnabled()); if (globalSettings.hasImageSet()) { - prefsHelper.addComponent(new JLabel(ACTION_BUILDER.getString("optionsImageSet"))); - prefsHelper.addComponent(buildImageSetBox()); + preferencesHelper.addComponent(new JLabel(ACTION_BUILDER.getString("optionsImageSet"))); + preferencesHelper.addComponent(buildImageSetBox()); } return panel; Modified: trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/gui/prefs/UpdatePrefs.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -59,7 +59,7 @@ /** * Preferences. */ - private static final Preferences PREFS = Preferences.userNodeForPackage(MainControl.class); + private static final Preferences PREFERENCES = Preferences.userNodeForPackage(MainControl.class); /** * Checkbox whether to automatically check for updates on startup. @@ -72,7 +72,7 @@ private JComboBox interval; /** - * Create an UpdatePrefs pane. + * Creates a new instance. */ public UpdatePrefs() { setListLabelText(ACTION_BUILDER.getString("prefsUpdate.title")); @@ -96,8 +96,8 @@ */ @Override public void apply() { - PREFS.putBoolean(UpdaterManager.AUTO_CHECK_KEY, autoUpdate.isSelected()); - PREFS.putInt(UpdaterManager.INTERVAL_KEY, interval.getSelectedIndex()); + PREFERENCES.putBoolean(UpdaterManager.AUTO_CHECK_KEY, autoUpdate.isSelected()); + PREFERENCES.putInt(UpdaterManager.INTERVAL_KEY, interval.getSelectedIndex()); } /** @@ -105,8 +105,8 @@ */ @Override public void revert() { - autoUpdate.setSelected(PREFS.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); - interval.setSelectedIndex(PREFS.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); + autoUpdate.setSelected(PREFERENCES.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); + interval.setSelectedIndex(PREFERENCES.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); } /** @@ -123,27 +123,27 @@ */ @Override public boolean isChanged() { - return !(autoUpdate.isSelected() == PREFS.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT) && interval.getSelectedIndex() == PREFS.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); + return !(autoUpdate.isSelected() == PREFERENCES.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT) && interval.getSelectedIndex() == PREFERENCES.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); } /** - * Creates the subpanel with the update settings. - * @return subpanel + * Creates the sub-panel with the update settings. + * @return sub-panel */ private Component createUpdatePanel() { final JComponent panel = new JPanel(new GridBagLayout()); - final PrefsHelper prefsHelper = new PrefsHelper(panel); + final PreferencesHelper preferencesHelper = new PreferencesHelper(panel); panel.setBorder(createTitledBorder("optionsUpdate")); autoUpdate = new JCheckBox(ACTION_BUILDER.createToggle(false, "autoUpdate", this)); - autoUpdate.setSelected(PREFS.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); - prefsHelper.addComponent(autoUpdate); - prefsHelper.addComponent(createComboBox()); + autoUpdate.setSelected(PREFERENCES.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); + preferencesHelper.addComponent(autoUpdate); + preferencesHelper.addComponent(createComboBox()); return panel; } /** * Set AutoUpdate state. - * @param autoUpdate autoupdate state + * @param autoUpdate auto-update state */ @ActionMethod public void setAutoUpdate(final boolean autoUpdate) { @@ -152,7 +152,7 @@ /** * Get AutoUpdate state. - * @return autoupdate state + * @return auto-update state */ @ActionMethod public boolean isAutoUpdate() { @@ -167,8 +167,8 @@ final String[] items = { ACTION_BUILDER.getString("prefsUpdateAuto0.text"), ACTION_BUILDER.getString("prefsUpdateAuto1.text"), ACTION_BUILDER.getString("prefsUpdateAuto2.text"), ACTION_BUILDER.getString("prefsUpdateAuto3.text"), }; interval = new JComboBox(items); interval.setEditable(false); - interval.setSelectedIndex(PREFS.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); - interval.setEnabled(PREFS.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); + interval.setSelectedIndex(PREFERENCES.getInt(UpdaterManager.INTERVAL_KEY, UpdaterManager.INTERVAL_DEFAULT)); + interval.setEnabled(PREFERENCES.getBoolean(UpdaterManager.AUTO_CHECK_KEY, UpdaterManager.AUTO_CHECK_DEFAULT)); return interval; } Modified: trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/mainactions/DefaultExiter.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -138,7 +138,7 @@ * @param returnCode the return code to pass */ public static void callExit(final int returnCode) { - if (prefs.getBoolean(DevPrefs.PREFS_SYSTEM_EXIT, DevPrefs.PREFS_SYSTEM_EXIT_DEFAULT)) { + if (prefs.getBoolean(DevPrefs.PREFERENCES_SYSTEM_EXIT, DevPrefs.PREFERENCES_SYSTEM_EXIT_DEFAULT)) { if (log.isDebugEnabled()) { log.debug(ACTION_BUILDER.getString("logExitWithExit")); } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-23 23:50:59 UTC (rev 7955) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-24 00:03:13 UTC (rev 7956) @@ -132,8 +132,8 @@ log.warn("No build number found:", e); } // Make sure the locale is set before any ActionBuilder is used. - final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - final String locName = prefs.get(GUIPrefs.PREFS_LANGUAGE, null); + final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + final String locName = preferences.get(GUIPrefs.PREFERENCES_LANGUAGE, null); if (locName != null) { Locale.setDefault(new Locale(locName)); } @@ -203,7 +203,7 @@ // print jre version, for easier recognition of jre-specific problems System.err.println("Running java version " + System.getProperty("java.version")); - // Now add prefs to the ActionBuilder. + // Now add preferences to the ActionBuilder. final ActionBuilder actionBuilder = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); actionBuilder.addPref(DefaultMainControl.class); actionBuilder.addParent(ActionBuilderFactory.getInstance().getActionBuilder(actionBuilderPackage)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 07:18:23
|
Revision: 7958 http://gridarta.svn.sourceforge.net/gridarta/?rev=7958&view=rev Author: akirschbaum Date: 2010-05-24 07:18:16 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix edit operations involving multi-square game objects. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/model/floodfill/FillUtils.java trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/atrinik/ChangeLog 2010-05-24 07:18:16 UTC (rev 7958) @@ -1,3 +1,7 @@ +2010-05-24 Andreas Kirschbaum + + * Fix edit operations involving multi-square game objects. + 2010-05-23 Andreas Kirschbaum * Do not event objects having incorrect parameters when loading Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/crossfire/ChangeLog 2010-05-24 07:18:16 UTC (rev 7958) @@ -1,3 +1,7 @@ +2010-05-24 Andreas Kirschbaum + + * Fix edit operations involving multi-square game objects. + 2010-05-23 Andreas Kirschbaum * Do not remove event objects having incorrect parameters when Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/daimonin/ChangeLog 2010-05-24 07:18:16 UTC (rev 7958) @@ -1,3 +1,7 @@ +2010-05-24 Andreas Kirschbaum + + * Fix edit operations involving multi-square game objects. + 2010-05-23 Andreas Kirschbaum * Do not remove event objects having incorrect parameters when Modified: trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/gui/copybuffer/CopyBuffer.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -187,7 +187,7 @@ if (mapModel2.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { if (!gameObject.isMulti()) { - mapModel2.addCopyToMap(gameObject, pos, true, insertionModeSet.getTopmostInsertionMode()); + mapModel2.insertBaseObject(gameObject, pos, true, false, insertionModeSet.getTopmostInsertionMode()); } } } @@ -199,7 +199,7 @@ if (mapModel2.isPointValid(pos)) { for (final BaseObject<G, A, R, ?> gameObject : square) { if (gameObject.isMulti()) { - mapModel2.addCopyToMap(gameObject, pos, true, insertionModeSet.getTopmostInsertionMode()); + mapModel2.insertBaseObject(gameObject, pos, true, false, insertionModeSet.getTopmostInsertionMode()); } } } @@ -230,7 +230,7 @@ if (!gameObject.isMulti()) { destinationPoint.x = destinationMapSquare.getMapX(); destinationPoint.y = destinationMapSquare.getMapY(); - mapModel2.addCopyToMap(gameObject, destinationPoint, true, insertionModeSet.getTopmostInsertionMode()); + mapModel2.insertBaseObject(gameObject, destinationPoint, true, false, insertionModeSet.getTopmostInsertionMode()); } } } @@ -243,7 +243,7 @@ if (gameObject.isMulti()) { destinationPoint.x = destinationMapSquare.getMapX(); destinationPoint.y = destinationMapSquare.getMapY(); - mapModel2.addCopyToMap(gameObject, destinationPoint, true, insertionModeSet.getTopmostInsertionMode()); + mapModel2.insertBaseObject(gameObject, destinationPoint, true, false, insertionModeSet.getTopmostInsertionMode()); } } } Modified: trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/gui/map/tools/InsertionTool.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -201,7 +201,7 @@ } } - mapModel.addCopyToMap(head, p, true, insertionModeSet.getTopmostInsertionMode()); + mapModel.insertBaseObject(head, p, true, false, insertionModeSet.getTopmostInsertionMode()); } insertedObject = null; } else { Modified: trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/gui/misc/ShiftProcessor.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -28,7 +28,6 @@ import net.sf.gridarta.gui.map.mapview.MapView; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.map.grid.MapGrid; import net.sf.gridarta.model.map.grid.SelectionMode; import net.sf.gridarta.model.map.maparchobject.MapArchObject; @@ -65,12 +64,6 @@ private final MapModel<G, A, R> mapModel; /** - * The {@link GameObjectFactory} to use. - */ - @NotNull - private final GameObjectFactory<G, A, R> gameObjectFactory; - - /** * The {@link InsertionModeSet} to use. */ @NotNull @@ -103,14 +96,12 @@ * @param mapViewSettings the map view settings instance * @param mapView The map view to operate on. * @param mapModel The map model to operate on. - * @param gameObjectFactory the game object factory to use * @param insertionModeSet the insertion mode set to use */ - public ShiftProcessor(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapView<G, A, R> mapView, @NotNull final MapModel<G, A, R> mapModel, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { + public ShiftProcessor(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapView<G, A, R> mapView, @NotNull final MapModel<G, A, R> mapModel, @NotNull final InsertionModeSet<G, A, R> insertionModeSet) { this.mapViewSettings = mapViewSettings; this.mapView = mapView; this.mapModel = mapModel; - this.gameObjectFactory = gameObjectFactory; this.insertionModeSet = insertionModeSet; } @@ -280,6 +271,7 @@ private void shift(final Point pos, final int len) { final Collection<G> startGameObjects = new LinkedList<G>(); final List<GameObject<G, A, R>> gameObjectsToDelete = new LinkedList<GameObject<G, A, R>>(); + final Collection<G> gameObjectsToInsert = new LinkedList<G>(); final Point prevPos = new Point(pos.x + dx, pos.y + dy); final Point startPos = new Point(); assert mapGrid != null; @@ -291,6 +283,7 @@ final boolean thisSelection = (mapGrid.getFlags(pos) & MapGrid.GRID_FLAG_SELECTION) > 0; assert mapGrid != null; mapGrid.select(prevPos, prevPos, thisSelection ? SelectionMode.ADD : SelectionMode.SUB); + gameObjectsToInsert.clear(); if (thisSelection) { if (isStart) { isStart = false; @@ -307,7 +300,7 @@ // [prevPos] = [pos] for (final G gameObject : mapModel.getMapSquare(pos)) { if (gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject)) { - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); + gameObjectsToInsert.add(gameObject); gameObjectsToDelete.add(gameObject); } } @@ -317,14 +310,13 @@ } else { isStart = true; // [prevPos] = [startGameObjects] - for (final G gameObject : startGameObjects) { - assert gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject); - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); - } + gameObjectsToInsert.addAll(startGameObjects); startGameObjects.clear(); } } + insertAllAndClear(gameObjectsToInsert, prevPos); + while (!gameObjectsToDelete.isEmpty()) { gameObjectsToDelete.remove(0).remove(); } @@ -335,15 +327,25 @@ } if (!isStart) { // [prevPos] = [startGameObjects] - for (final G gameObject : startGameObjects) { - assert gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject); - mapModel.addGameObjectToMap(gameObjectFactory.cloneGameObject(gameObject), prevPos, insertionModeSet.getTopmostInsertionMode()); - } - startGameObjects.clear(); + insertAllAndClear(startGameObjects, prevPos); } assert startGameObjects.isEmpty(); assert mapGrid != null; mapGrid.select(prevPos, prevPos, startSelection ? SelectionMode.ADD : SelectionMode.SUB); } + /** + * Inserts a collection of {@link GameObject GameObjects} into the map and + * clears the list. + * @param gameObjects the game objects + * @param point the insertion point + */ + private void insertAllAndClear(@NotNull final Collection<G> gameObjects, @NotNull final Point point) { + for (final G gameObject : gameObjects) { + assert gameObject.isHead() && !gameObject.isInContainer() && mapViewSettings.isEditType(gameObject); + mapModel.insertBaseObject(gameObject, point, true, false, insertionModeSet.getTopmostInsertionMode()); + } + gameObjects.clear(); + } + } // class ShiftProcessor Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -51,7 +51,6 @@ import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.floodfill.FillUtils; import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.gameobject.GameObjectFactory; import net.sf.gridarta.model.map.grid.MapGrid; import net.sf.gridarta.model.map.grid.MapGridEvent; import net.sf.gridarta.model.map.grid.MapGridListener; @@ -161,12 +160,6 @@ private final FaceObjectProviders faceObjectProviders; /** - * The {@link GameObjectFactory} to use. - */ - @NotNull - private final GameObjectFactory<G, A, R> gameObjectFactory; - - /** * The {@link InsertionModeSet} to use. */ @NotNull @@ -414,11 +407,10 @@ * @param resources the resources to collect * @param faceObjectProviders the face object providers for looking up * faces - * @param gameObjectFactory the game object factory to use * @param insertionModeSet the insertion mode set to use * @param exiter the exiter instance */ - public MainActions(@NotNull final ReplaceDialogManager<G, A, R> replaceDialogManager, @NotNull final JFrame parent, @NotNull final GlobalSettings globalSettings, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final MapViewSettings mapViewSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final CopyBuffer<G, A, R> copyBuffer, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final AbstractResources<G, A, R> resources, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final GameObjectFactory<G, A, R> gameObjectFactory, @NotNull final InsertionModeSet<G, A, R> insertionModeSet, @NotNull final Exiter exiter) { + public MainActions(@NotNull final ReplaceDialogManager<G, A, R> replaceDialogManager, @NotNull final JFrame parent, @NotNull final GlobalSettings globalSettings, @NotNull final DelegatingMapValidator<G, A, R> validators, @NotNull final MapViewSettings mapViewSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull final CopyBuffer<G, A, R> copyBuffer, @NotNull final ObjectChooser<G, A, R> objectChooser, @NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final AbstractResources<G, A, R> resources, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final InsertionModeSet<G, A, R> insertionModeSet, @NotNull final Exiter exiter) { this.replaceDialogManager = replaceDialogManager; this.parent = parent; this.globalSettings = globalSettings; @@ -429,7 +421,6 @@ this.objectChooser = objectChooser; this.resources = resources; this.faceObjectProviders = faceObjectProviders; - this.gameObjectFactory = gameObjectFactory; this.insertionModeSet = insertionModeSet; aClear = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "clear"); aCut = ActionUtils.newAction(ACTION_BUILDER, "Copy Buffer", this, "cut"); @@ -1105,7 +1096,7 @@ return false; } - final ShiftProcessor<G, A, R> shiftProcessor = new ShiftProcessor<G, A, R>(mapViewSettings, mapView, mapControl.getMapModel(), gameObjectFactory, insertionModeSet); + final ShiftProcessor<G, A, R> shiftProcessor = new ShiftProcessor<G, A, R>(mapViewSettings, mapView, mapControl.getMapModel(), insertionModeSet); if (!shiftProcessor.canShift(direction)) { return false; } Modified: trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -470,7 +470,7 @@ new MapActions<G, A, R>(mainViewFrame, mainViewFrame, mapManager, mapViewManager, exitMatcher, FileFilters.mapFileFilter, selectedSquareModel, directionMap, allowRandomMapParameters, mapPropertiesDialogFactory, mapViewSettings, mapPathNormalizer, mapViewsManager, fileControl); final ViewActions<G, A, R> viewActions = new ViewActions<G, A, R>(mapViewSettings, mapManager); new MapFileActions<G, A, R>(imageCreator2, mapManager, mapViewsManager, mapViewManager, fileControl, mainViewFrame); - new MainActions<G, A, R>(replaceDialogManager, mainViewFrame, globalSettings, validators, mapViewSettings, archetypeSet, copyBuffer, objectChooser, mapManager, mapViewManager, resources, faceObjectProviders, gameObjectFactory, insertionModeSet, exiter); + new MainActions<G, A, R>(replaceDialogManager, mainViewFrame, globalSettings, validators, mapViewSettings, archetypeSet, copyBuffer, objectChooser, mapManager, mapViewManager, resources, faceObjectProviders, insertionModeSet, exiter); final HelpActions helpActions = new HelpActions(mainViewFrame); ActionUtils.newActions(ACTION_BUILDER, "Map", newMapDialogFactory, "newMap"); ActionUtils.newActions(ACTION_BUILDER, "Tool", this, "cleanCompletelyBlockedSquares", "collectSpells", "controlClient", "controlServer", "gc", "options", "shortcuts", "zoom"); Modified: trunk/src/app/net/sf/gridarta/model/floodfill/FillUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/model/floodfill/FillUtils.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -67,7 +67,7 @@ continue; } final BaseObject<G, A, R, ?> gameObject = gameObjects.get(RandomUtils.rnd.nextInt(gameObjects.size())); - mapModel.addCopyToMap(gameObject, p, false, insertionMode); + mapModel.insertBaseObject(gameObject, p, false, false, insertionMode); } } finally { mapModel.endTransaction(); Modified: trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/model/floodfill/Floodfill.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -86,7 +86,7 @@ if (mapModel.isPointValid(p) && mapModel.getMapSquare(p).isEmpty()) { area[p.x][p.y] = WAS_EMPTY; final BaseObject<G, A, R, ?> gameObject = archList.get(RandomUtils.rnd.nextInt(archList.size())); - mapModel.addCopyToMap(gameObject, p, false, insertionModeSet.getTopmostInsertionMode()); + mapModel.insertBaseObject(gameObject, p, false, false, insertionModeSet.getTopmostInsertionMode()); try { if (area[p.x - 1][p.y] == NOT_LOOKED_AT) { area[p.x - 1][p.y] = BORDER; Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -840,15 +840,17 @@ return null; } + final Object direction = archetypeChooserModel.getDirection(); + final List<G> parts = new ArrayList<G>(); - BaseObject<G, A, R, ?> baseObjectPart = baseObject; - for (R archetypePart = effectiveArchetype; archetypePart != null; archetypePart = archetypePart.getMultiNext(), baseObjectPart = baseObjectPart.getMultiNext()) { - if (baseObjectPart == null) { - throw new AssertionError("multi-parts of base object " + baseObject.getBestName() + " and archetype " + effectiveArchetype.getBestName() + " do not match"); + for (R archetypePart = effectiveArchetype; archetypePart != null; archetypePart = archetypePart.getMultiNext()) { + final G part; + if (archetypePart == effectiveArchetype) { + part = baseObject.newInstance(gameObjectFactory); + part.setArchetype(archetypePart); + } else { + part = archetypePart.newInstance(gameObjectFactory); } - final G part = baseObjectPart.newInstance(gameObjectFactory); - part.setArchetype(archetypePart); - final Object direction = archetypeChooserModel.getDirection(); if (direction != null) { part.setAttributeString("direction", direction.toString()); } @@ -939,30 +941,6 @@ * {@inheritDoc} */ @Override - public void addCopyToMap(@NotNull final BaseObject<G, A, R, ?> gameObject, @NotNull final Point pos, final boolean allowDouble, @NotNull final InsertionMode<G, A, R> insertionMode) { - if (gameObject.isArchetype()) { - insertBaseObject(gameObject.getArchetype(), pos, allowDouble, false, insertionMode); - } else { - final G newGameObject = gameObject.newInstance(gameObjectFactory); - for (GameObject<G, A, R> tmp = newGameObject; tmp != null; tmp = tmp.getMultiNext()) { - if (!isPointValid(new Point(pos.x + tmp.getArchetype().getMultiX(), pos.y + tmp.getArchetype().getMultiY()))) { - // outside map - return; - } - } - - addGameObjectToMap(newGameObject, pos, insertionMode); - for (G tmp = newGameObject.getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { - gameObjectMatchers.updateEditType(tmp, activeEditType); - addGameObjectToMap(tmp, new Point(pos.x + tmp.getArchetype().getMultiX(), pos.y + tmp.getArchetype().getMultiY()), insertionMode); - } - } - } - - /** - * {@inheritDoc} - */ - @Override public void setMapFile(@Nullable final File mapFile) { if (this.mapFile == null ? mapFile == null : this.mapFile.equals(mapFile)) { return; Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapModel.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -316,7 +316,8 @@ /** * Inserts a {@link BaseObject} to a map. Archetypes are instantiated, game * objects are cloned. The direction of the inserted game object is set to - * the direction of the archetype chooser. + * the direction of the archetype chooser. This function allows multi-square + * game objects. * @param baseObject the base object * @param pos the insert-location on this map * @param allowMany whether duplicates are allowed @@ -369,20 +370,6 @@ ErrorCollector<G, A, R> getErrors(); /** - * Adds an archetype to this map. Inserts a new object instance for - * archetypes, and a clone for game objects. If <var>allowDouble</var> is - * <code>false</code> and <var>gameObject</var> is an {@link Archetype}, the - * object will only be inserted if there wasn't already an object with the - * same Archetype. - * @param gameObject GameObject to add. - * @param pos position to add GameObject at - * @param allowDouble <code>true</code> for allowing similar GameObjects on - * the same square, <code>false</code> to disallow - * @param insertionMode the insertion mode to use - */ - void addCopyToMap(@NotNull BaseObject<G, A, R, ?> gameObject, @NotNull Point pos, boolean allowDouble, @NotNull InsertionMode<G, A, R> insertionMode); - - /** * Checks whether an area of a map is completely empty. * @param left the left border of the area * @param top the top border of the area Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java 2010-05-24 00:04:13 UTC (rev 7957) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/SavedSquares.java 2010-05-24 07:18:16 UTC (rev 7958) @@ -215,9 +215,11 @@ if (square != null) { for (final GameObject<G, A, R> gameObject : square) { final int editType = gameObject.getEditType(); + final int mapX = gameObject.getMapX(); + final int mapY = gameObject.getMapY(); for (G tailGameObject = gameObject.getMultiNext(); tailGameObject != null; tailGameObject = tailGameObject.getMultiNext()) { - point2.x = tailGameObject.getMapX(); - point2.y = tailGameObject.getMapY(); + point2.x = mapX + tailGameObject.getArchetype().getMultiX(); + point2.y = mapY + tailGameObject.getArchetype().getMultiY(); final GameObjectContainer<G, A, R> mapSquare = mapModel.getMapSquare(point2); mapSquare.addLast(tailGameObject); tailGameObject.setEditType(editType); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 12:01:10
|
Revision: 7959 http://gridarta.svn.sourceforge.net/gridarta/?rev=7959&view=rev Author: akirschbaum Date: 2010-05-24 12:00:54 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GuiInfo.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/MaskChangeAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/ViewTreasurelistAL.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttribute.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeFactory.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeVisitor.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/DefaultArchetypeAttributeFactory.java trunk/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParserTest.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribute.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeAnimationName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBitmask.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBool.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBoolSpec.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeFaceName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeFloat.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeInt.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeInvSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeList.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeLong.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeMapPath.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeScriptFile.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeString.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeText.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeTreasure.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeZSpell.java trunk/src/app/net/sf/gridarta/gui/utils/AnimationComponent.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeAnimationName.java trunk/src/app/net/sf/gridarta/model/archetypetype/AttributeBitmask.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttrib.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribAnimName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBool.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBoolSpec.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFaceName.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInvSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribList.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribMapPath.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribScriptFile.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribSpell.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribString.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribText.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribTreasure.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribZSpell.java trunk/src/app/net/sf/gridarta/gui/utils/AnimComponent.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeAnimName.java trunk/src/app/net/sf/gridarta/model/archetypetype/CAttribBitmask.java Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/gridarta.ipr 2010-05-24 12:00:54 UTC (rev 7959) @@ -1126,6 +1126,7 @@ <dictionary name="ank"> <words> <w>accel</w> + <w>animname</w> <w>args</w> <w>atrinik</w> <w>attribute's</w> @@ -1134,12 +1135,20 @@ <w>backbuffer</w> <w>beanshell</w> <w>bitmask</w> + <w>bitmasks</w> + <w>bool</w> <w>checkboxes</w> <w>daimonin</w> + <w>doctype</w> + <w>encodings</w> + <w>endmsg</w> <w>exiter</w> + <w>facename</w> <w>filter<?, ?></w> + <w>formatter</w> <w>goto</w> <w>gridarta</w> + <w>ignorelists</w> <w>indices</w> <w>javac</w> <w>longdescription</w> @@ -1151,6 +1160,7 @@ <w>pickmap</w> <w>pickmaps</w> <w>plugins</w> + <w>popup</w> <w>resize</w> <w>resized</w> <w>resizes</w> @@ -1159,10 +1169,13 @@ <w>startup</w> <w>teleporter</w> <w>teleporters</w> + <w>textfield</w> + <w>textfields</w> <w>timestamp</w> <w>tooltip</w> <w>treasurelist</w> <w>treasurelists</w> + <w>typedefs</w> <w>unregister</w> <w>validator's</w> <w>validator...</w> Modified: trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -21,7 +21,7 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeAttribute; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeAnimName; +import net.sf.gridarta.model.archetypetype.ArchetypeAttributeAnimationName; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBitmask; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBool; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBoolSpec; @@ -42,7 +42,7 @@ import net.sf.gridarta.model.archetypetype.ArchetypeAttributeZSpell; import net.sf.gridarta.model.archetypetype.ArchetypeType; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.archetypetype.CAttribBitmask; +import net.sf.gridarta.model.archetypetype.AttributeBitmask; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; import net.sf.gridarta.validation.checks.AttributeRangeChecker; @@ -95,14 +95,14 @@ /** {@inheritDoc} */ @Override - public void visit(@NotNull final ArchetypeAttributeAnimName<G, A, R> archetypeAttribute) { + public void visit(@NotNull final ArchetypeAttributeAnimationName<G, A, R> archetypeAttribute) { // XXX: missing } /** {@inheritDoc} */ @Override public void visit(@NotNull final ArchetypeAttributeBitmask<G, A, R> archetypeAttribute) { - final CAttribBitmask<G, A, R> bitmask = archetypeTypeSet.getBitmask(archetypeAttribute.getBitmaskName()); + final AttributeBitmask<G, A, R> bitmask = archetypeTypeSet.getBitmask(archetypeAttribute.getBitmaskName()); if (bitmask != null) { try { attributeRangeChecker.add(archetypeType.getTypeNo(), archetypeAttribute.getArchetypeAttributeName(), archetypeAttribute.getAttributeName(), 0, bitmask.getMaxValue()); Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttrib.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttrib.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttrib.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,84 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttribute; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * A single Attribute, combining the CFArchAttrib with its input component(s). - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public abstract class DialogAttrib<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, T extends ArchetypeAttribute<G, A, R>> { - - /** - * The Logger for printing log messages. - */ - private static final Category log = Logger.getLogger(DialogAttrib.class); - - /** - * Reference to the attribute data. - */ - @NotNull - private final T ref; - - /** - * Create a DialogAttrib. - * @param ref reference to the attribute data - */ - protected DialogAttrib(@NotNull final T ref) { - this.ref = ref; - } - - /** - * Returns the attribute data. - * @return the attribute data - */ - @NotNull - public T getRef() { - return ref; - } - - @Nullable - public abstract String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent); - - public abstract void appendSummary(@NotNull final Document doc, @NotNull final Style style); - - protected static void addLine(@NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String line) { - try { - doc.insertString(doc.getLength(), line + "\n", style); - } catch (final BadLocationException e) { - log.error("toggleSummary: Bad Location in Document!", e); - } - } - -} // class DialogAttrib Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribAnimName.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribAnimName.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribAnimName.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,78 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.gui.utils.AnimComponent; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeAnimName; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribAnimName<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeAnimName<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final AnimComponent input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribAnimName(@NotNull final ArchetypeAttributeAnimName<G, A, R> ref, @NotNull final AnimComponent input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String inline = input.getAnimName(); - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { - return archetypeAttributeName + " " + inline; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getAnimName(); - if (value.length() > 0) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // DialogAttribAnimName Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBitmask.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,161 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.text.Document; -import javax.swing.text.JTextComponent; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBitmask; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.archetypetype.CAttribBitmask; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.apache.log4j.Category; -import org.apache.log4j.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * DialogAttrib for types with bitmasks to choose from. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class DialogAttribBitmask<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeBitmask<G, A, R>> { - - /** - * The Logger for printing log messages. - */ - private static final Category log = Logger.getLogger(DialogAttribBitmask.class); - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JTextComponent input; - - /** - * Active bitmask value. - */ - private int value; - - /** - * Reference to the bitmask data. - */ - private CAttribBitmask<G, A, R> bitmask; - - /** - * Create a BitmaskAttrib. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribBitmask(@NotNull final ArchetypeAttributeBitmask<G, A, R> ref, @NotNull final JTextComponent input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String encodedValue = getEncodedValue(); // get bitmask value - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - CharSequence oldValue = archetype.getAttributeString(archetypeAttributeName); - if (oldValue.length() == 0) { - oldValue = "0"; - } - - if (!oldValue.equals(encodedValue)) { - return archetypeAttributeName + " " + encodedValue; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String tmp = input.getText().trim(); - if (tmp.length() > 0 && !tmp.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + tmp); - } - } - - /** - * Get the active bitmask value. - * @return active bitmask value - */ - public int getValue() { - return value; - } - - /** - * Get the active bitmask value in external file representation. - * @return active bitmask value in external file representation - */ - private String getEncodedValue() { - return bitmask.encodeValue(value); - } - - /** - * Set the active bitmask value. - * @param value new active bitmask value - */ - public void setValue(final int value) { - this.value = value; - if (bitmask != null) { - input.setText(bitmask.getText(value)); - } else { - log.warn("null bitmask"); - } - } - - /** - * Set the active bitmask value in external file representation. - * @param encodedValue new active bitmask value in external file - * representation - */ - public void setEncodedValue(final String encodedValue) { - assert bitmask != null; - setValue(bitmask.decodeValue(encodedValue)); - } - - public CAttribBitmask<G, A, R> getBitmask() { - return bitmask; - } - - public void setBitmask(final CAttribBitmask<G, A, R> bitmask) { - this.bitmask = bitmask; - } - - /** - * Returns the input ui component for editing the value. - * @return the component - */ - @NotNull - public Component getInput() { - return input; - } - -} // class DialogAttribBitmask Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBool.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBool.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBool.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,78 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.AbstractButton; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBool; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -// a boolean attribute (flag) -public class DialogAttribBool<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeBool<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final AbstractButton input; - - /** - * Create a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribBool(@NotNull final ArchetypeAttributeBool<G, A, R> ref, @NotNull final AbstractButton input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (input.isSelected() != (archetype.getAttributeInt(archetypeAttributeName) == 1)) { - return archetypeAttributeName + " " + (input.isSelected() ? 1 : 0); - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final boolean value = input.isSelected(); // true/false - if (value) { - addLine(doc, style, "<" + getRef().getAttributeName() + ">"); - } - } - -} // class DialogAttribBool Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBoolSpec.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBoolSpec.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribBoolSpec.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,85 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.AbstractButton; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeBoolSpec; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -// a boolean attribute with customized true/false values -public class DialogAttribBoolSpec<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeBoolSpec<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final AbstractButton input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value. - */ - public DialogAttribBoolSpec(@NotNull final ArchetypeAttributeBoolSpec<G, A, R> ref, @NotNull final AbstractButton input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String valString; // value-string to apply - if (input.isSelected()) { - valString = getRef().getTrueValue(); - } else { - valString = getRef().getFalseValue(); - } - // now see if we need to write it into the archtext or not - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if ((valString.equals("0") && archetype.hasAttribute(archetypeAttributeName)) || (!valString.equals("0") && !archetype.getAttributeString(archetypeAttributeName).equals(valString))) { - return archetypeAttributeName + " " + valString; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final boolean value = input.isSelected(); // true/false - if (value) { - addLine(doc, style, "<" + getRef().getAttributeName() + ">"); - } - } - -} // class DialogAttribBoolSpec Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFaceName.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFaceName.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFaceName.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,78 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.gui.utils.FaceComponent; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeFaceName; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribFaceName<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeFaceName<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final FaceComponent input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribFaceName(@NotNull final ArchetypeAttributeFaceName<G, A, R> ref, @NotNull final FaceComponent input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String inline = input.getFaceName(); - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (!inline.equals(archetype.getAttributeString(archetypeAttributeName))) { - return archetypeAttributeName + " " + inline; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getFaceName(); - if (value.length() > 0) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // DialogAttribFaceName Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribFloat.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,93 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeFloat; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribFloat<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeFloat<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JFormattedTextField input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribFloat(@NotNull final ArchetypeAttributeFloat<G, A, R> ref, @NotNull final JFormattedTextField input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (input.getText().trim().length() == 0) { - if (archetype.hasAttribute(archetypeAttributeName)) { - return archetypeAttributeName + " 0.0"; - } - } else { - try { - final double value = (Double) input.getValue(); - // The following floating point equality comparison is okay and known not to cause problems. - //noinspection FloatingPointEquality - if (archetype.getAttributeDouble(archetypeAttributeName) != value) { - return archetypeAttributeName + " " + value; - } - } catch (final NumberFormatException ignored) { - // parsing failed: wrong entry!! - JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; - } - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getText(); // the attrib value - if (value != null && value.length() > 0 && !value.equals("0")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // class DialogAttribFloat Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInt.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,104 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInt; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -// an int attribute -public class DialogAttribInt<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeInt<G, A, R>> { - - /** - * Reference to the attribute data. - */ - @NotNull - private final ArchetypeAttributeInt<G, A, R> ref; - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JFormattedTextField input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribInt(@NotNull final ArchetypeAttributeInt<G, A, R> ref, @NotNull final JFormattedTextField input) { - super(ref); - this.ref = ref; - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String archetypeAttributeName = ref.getArchetypeAttributeName(); - final int value; - if (input.getText().trim().length() == 0) { - value = 0; - } else { - try { - value = ((Number) input.getValue()).intValue(); - } catch (final NumberFormatException ignored) { - // parsing failed: wrong entry!! - JOptionPane.showMessageDialog(parent, "Attribute '" + ref.getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; - } - } - - if (value < ref.getMinValue() || value > ref.getMaxValue()) { - JOptionPane.showMessageDialog(parent, "Attribute '" + ref.getAttributeName() + "' must be " + ref.getMinValue() + ".." + ref.getMaxValue() + "!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; - } - - if (archetype.getAttributeInt(archetypeAttributeName) != value) { - return archetypeAttributeName + " " + value; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getText(); // the attrib value - if (value != null && value.length() > 0 && !value.equals("0")) { - addLine(doc, style, ref.getAttributeName() + " = " + value); - } - } - -} // class DialogAttribInt Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInvSpell.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInvSpell.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribInvSpell.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,139 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.JComboBox; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeInvSpell; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.model.spells.GameObjectSpell; -import net.sf.gridarta.model.spells.Spells; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribInvSpell<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeInvSpell<G, A, R>> { - - /** - * Whether the spell game object is optional. - */ - private final boolean isOptionalSpell; - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JComboBox input; - - /** - * The game object spells to display. - */ - @NotNull - private final Spells<GameObjectSpell<G, A, R>> gameObjectSpells; - - /** - * Creates a new instance. - * @param isOptionalSpell whether the spell game object is optional - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - * @param gameObjectSpells the game object spells to display - */ - public DialogAttribInvSpell(final boolean isOptionalSpell, @NotNull final ArchetypeAttributeInvSpell<G, A, R> ref, @NotNull final JComboBox input, @NotNull final Spells<GameObjectSpell<G, A, R>> gameObjectSpells) { - super(ref); - this.isOptionalSpell = isOptionalSpell; - this.input = input; - this.gameObjectSpells = gameObjectSpells; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final int index = input.getSelectedIndex(); - if (index < gameObjectSpells.size() + (isOptionalSpell ? 1 : 0)) { - final boolean isModified; - switch (gameObject.countInvObjects()) { - case 0: - // game object has no inventory ==> isModified if - // anything other than <none> is selected - isModified = index != gameObjectSpells.size(); - break; - - default: - // game object has multiple inventories ==> always isModified - isModified = true; - break; - - case 1: - if (index >= gameObjectSpells.size()) { - // game object has one inventory, <none> is - // selected ==> isModified - isModified = true; - } else { - // game object has one inventory, a spell is - // selected ==> isModified if a different spell is - // selected - final GameObject<G, A, R> invObject = gameObject.iterator().next(); - if (invObject.isDefaultGameObject()) { - final String invObjectArchetypeName = invObject.getArchetype().getArchetypeName(); - final GameObjectSpell<G, A, R> spellObject = gameObjectSpells.getSpell(index); - isModified = !invObjectArchetypeName.equals(spellObject.getArchetypeName()); - } else { - isModified = true; - } - } - break; - } - if (isModified) { - gameObject.removeAll(); - if (index < gameObjectSpells.size()) { - final G spellObject = gameObjectSpells.getSpell(index).createGameObject(); - gameObject.addLast(spellObject); - } - - // remove the entry for a customized spell - final int modelSize = input.getModel().getSize(); - if (modelSize > gameObjectSpells.size() + (isOptionalSpell ? 1 : 0)) { - input.removeItemAt(modelSize - 1); - } - } - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); // the attrib value - if (value.length() > 0 && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // class DialogAttribInvSpell Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribList.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribList.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribList.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,91 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.JComboBox; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeList; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribList<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeList<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JComboBox input; - - /** - * The archetype type set. - */ - @NotNull - private final ArchetypeTypeSet<G, A, R> archetypeTypeSet; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - * @param archetypeTypeSet the archetype type set - */ - public DialogAttribList(@NotNull final ArchetypeAttributeList<G, A, R> ref, @NotNull final JComboBox input, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet) { - super(ref); - this.input = input; - this.archetypeTypeSet = archetypeTypeSet; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - // get selected index of ComboBox - final int attrValTmp = input.getSelectedIndex(); - // fetch value according to this list entry: - final int attrVal = archetypeTypeSet.getList(getRef().getListName()).get(attrValTmp).getFirst(); // attribute value - - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (archetype.getAttributeInt(archetypeAttributeName) != attrVal) { - return archetypeAttributeName + " " + attrVal; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getSelectedItem().toString().trim(); // the attrib value - if (value.length() > 0 && !value.startsWith("<")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // class DialogAttribList Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribLong.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,91 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.JFormattedTextField; -import javax.swing.JOptionPane; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeLong; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribLong<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeLong<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final JFormattedTextField input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribLong(@NotNull final ArchetypeAttributeLong<G, A, R> ref, @NotNull final JFormattedTextField input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (input.getText().trim().length() == 0) { - if (archetype.getAttributeLong(archetypeAttributeName) != 0L) { - return archetypeAttributeName + " 0"; - } - } else { - try { - final long value = ((Number) input.getValue()).longValue(); - if (archetype.getAttributeLong(archetypeAttributeName) != value) { - return archetypeAttributeName + " " + value; - } - } catch (final NumberFormatException ignored) { - // parsing failed: wrong entry!! - JOptionPane.showMessageDialog(parent, "Attribute '" + getRef().getAttributeName() + "' must be a number!", "Input Error", JOptionPane.ERROR_MESSAGE); - return null; - } - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getText(); // the attrib value - if (value != null && value.length() > 0 && !value.equals("0")) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // class DialogAttribLong Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribMapPath.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribMapPath.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribMapPath.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,78 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gui.gameobjectattributesdialog; - -import java.awt.Component; -import javax.swing.text.Document; -import javax.swing.text.Style; -import net.sf.gridarta.gui.map.maptilepane.TilePanel; -import net.sf.gridarta.model.archetype.Archetype; -import net.sf.gridarta.model.archetypetype.ArchetypeAttributeMapPath; -import net.sf.gridarta.model.archetypetype.ArchetypeType; -import net.sf.gridarta.model.gameobject.GameObject; -import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class DialogAttribMapPath<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends DialogAttrib<G, A, R, ArchetypeAttributeMapPath<G, A, R>> { - - /** - * The input ui component for editing the value. - */ - @NotNull - private final TilePanel input; - - /** - * Creates a new instance. - * @param ref reference to the attribute data - * @param input the input ui component for editing the value - */ - public DialogAttribMapPath(@NotNull final ArchetypeAttributeMapPath<G, A, R> ref, @NotNull final TilePanel input) { - super(ref); - this.input = input; - } - - /** - * {@inheritDoc} - */ - @Nullable - @Override - public String getText2(@NotNull final G gameObject, @NotNull final Archetype<G, A, R> archetype, final String[] newMsg, final ArchetypeType<G, A, R> typeStruct, final Component parent) { - final String newString = input.getText().trim(); - final String archetypeAttributeName = getRef().getArchetypeAttributeName(); - if (!archetype.getAttributeString(archetypeAttributeName).equals(newString)) { - return archetypeAttributeName + " " + newString; - } - - return ""; - } - - /** - * {@inheritDoc} - */ - @Override - public void appendSummary(@NotNull final Document doc, @NotNull final Style style) { - final String value = input.getText(); // the attrib value - if (value != null && value.length() > 0) { - addLine(doc, style, getRef().getAttributeName() + " = " + value); - } - } - -} // class DialogAttribMapPath Deleted: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribScriptFile.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribScriptFile.java 2010-05-24 07:18:16 UTC (rev 7958) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttribScriptFile.java 2010-05-24 12:00:54 UTC (rev 7959) @@ -1,78 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the... [truncated message content] |
From: <aki...@us...> - 2010-05-24 14:33:23
|
Revision: 7976 http://gridarta.svn.sourceforge.net/gridarta/?rev=7976&view=rev Author: akirschbaum Date: 2010-05-24 14:33:17 +0000 (Mon, 24 May 2010) Log Message: ----------- Cleanup parser for/document <bitmask> elements within types.xml. Modified Paths: -------------- trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2010-05-24 14:22:56 UTC (rev 7975) +++ trunk/resource/system/dtd/types.dtd 2010-05-24 14:33:17 UTC (rev 7976) @@ -55,6 +55,13 @@ name CDATA #REQUIRED > +<!-- bit/value: exactly one must be specified --> +<!-- value: only valid within "is_named" <bitmask> elements --> +<!-- value: integer value of bitmask --> +<!-- bit: bit value 0..31 --> +<!-- name: the name for the value --> +<!-- encoding: the external representation of the bit value --> +<!-- encoding: only valid within "is_named" <bitmask> elements --> <!ELEMENT bmentry EMPTY> <!ATTLIST bmentry bit CDATA #IMPLIED Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-05-24 14:22:56 UTC (rev 7975) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-05-24 14:33:17 UTC (rev 7976) @@ -199,29 +199,32 @@ * Parses a "bmentry" section of a types.xml file. * @param errorViewCollector the error view collector for reporting errors * @param element the "bmentry" section to parse - * @param name the name of the parent's "bitmask" section for error messages + * @param bitmaskName the name of the parent's "bitmask" section for error + * messages * @param isNamed whether the bitmask attribute is named * @param attributeBitmask the bitmask attribute to update */ - private void parseBmentry(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Element element, @NotNull final String name, final boolean isNamed, @NotNull final AttributeBitmask<G, A, R> attributeBitmask) { + private void parseBmentry(@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Element element, @NotNull final String bitmaskName, final boolean isNamed, @NotNull final AttributeBitmask<G, A, R> attributeBitmask) { final String bitAttribute = element.getAttribute("bit"); final String valueAttribute = element.getAttribute("value"); if (bitAttribute.length() != 0 && valueAttribute.length() != 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": element contains both 'bit' and 'value' attributes"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": element contains both 'bit' and 'value' attributes"); return; } + final String name = element.getAttribute("name"); + final int value; if (bitAttribute.length() == 0) { if (!isNamed) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": 'value' attribute allowed only in named bitmasks"); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": 'value' attribute allowed only in named bitmasks"); return; } try { value = Integer.parseInt(valueAttribute); } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": invalid 'value' value: " + valueAttribute); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid 'value' value: " + valueAttribute); return; } } else { @@ -229,32 +232,32 @@ try { bitValue = Integer.parseInt(bitAttribute); } catch (final NumberFormatException ignored) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": invalid 'bit' value: " + bitAttribute); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid 'bit' value: " + bitAttribute); return; } if (bitValue < 0 || bitValue >= 32) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": invalid 'bit' value: " + bitValue); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": invalid 'bit' value: " + bitValue); return; } - if (!attributeBitmask.addBitName(bitValue, element.getAttribute("name"))) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": duplicate 'bit' value: " + bitValue); + if (!attributeBitmask.addBitName(bitValue, name)) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": duplicate 'bit' value: " + bitValue); return; } value = 1 << bitValue; } - attributeBitmask.addName(element.getAttribute("name"), value); + attributeBitmask.addName(name, value); - final String encodingAttribute = element.getAttribute("encoding"); + final String encoding = element.getAttribute("encoding"); if (isNamed) { - if (encodingAttribute.length() == 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": missing 'encoding' attribute"); + if (encoding.length() == 0) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": missing 'encoding' attribute"); return; } - attributeBitmask.addNamedValue(encodingAttribute, value); + attributeBitmask.addNamedValue(encoding, value); } else { - if (encodingAttribute.length() != 0) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": unused 'encoding' attribute"); + if (encoding.length() != 0) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, bitmaskName + ": unused 'encoding' attribute"); return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 15:40:52
|
Revision: 7977 http://gridarta.svn.sourceforge.net/gridarta/?rev=7977&view=rev Author: akirschbaum Date: 2010-05-24 15:40:45 +0000 (Mon, 24 May 2010) Log Message: ----------- Cleanup parser for/document <lists> elements within types.xml. Modified Paths: -------------- trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2010-05-24 14:33:17 UTC (rev 7976) +++ trunk/resource/system/dtd/types.dtd 2010-05-24 15:40:45 UTC (rev 7977) @@ -49,6 +49,8 @@ name CDATA #REQUIRED > +<!-- value: must be unique within the surrounding <list> --> +<!-- name: must be non-empty --> <!ELEMENT listentry EMPTY> <!ATTLIST listentry value CDATA #REQUIRED Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java 2010-05-24 14:33:17 UTC (rev 7976) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java 2010-05-24 15:40:45 UTC (rev 7977) @@ -57,10 +57,20 @@ /** * Adds an entry. - * @param pair the entry to add + * @param value the entry's value + * @param name the entry's name + * @throws IllegalArgumentException if the values are not acceptable */ - public void add(@NotNull final Pair<Integer, String> pair) { - list.add(pair); + public void add(final int value, @NotNull final String name) { + if (name.isEmpty()) { + throw new IllegalArgumentException("empty name"); + } + for (final Pair<Integer, String> pair : list) { + if (pair.getFirst() == value) { + throw new IllegalArgumentException("duplicate value '" + value + "' for '" + pair.getSecond() + "' and '" + name +"'"); + } + } + list.add(new Pair<Integer, String>(value, name)); } /** Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-05-24 14:33:17 UTC (rev 7976) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2010-05-24 15:40:45 UTC (rev 7977) @@ -33,7 +33,6 @@ import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.map.maparchobject.MapArchObject; -import net.sf.gridarta.utils.Pair; import net.sf.japi.xml.NodeListIterator; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -273,19 +272,16 @@ final Iterator<Element> it = new NodeListIterator<Element>(xpath, element, "lists/list"); while (it.hasNext()) { final Element elem = it.next(); - if (elem.getAttribute("name") == null) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "cannot load list element without 'name'."); - } else { - final ArchetypeTypeList list = parseList(errorViewCollector, elem); - if (list.size() > 0) { - archetypeTypeSet.addList(elem.getAttribute("name"), list); - } + final ArchetypeTypeList list = parseList(errorViewCollector, elem); + if (list.size() > 0) { + final String name = elem.getAttribute("name"); + archetypeTypeSet.addList(name, list); } } } /** - * Parses a "lists/list" section of a types.xml file. + * Parses a "list" section of a types.xml file. * @param errorViewCollector the error view collector for reporting errors * @param element the element to parse * @return the parsed archetype type list @@ -298,14 +294,19 @@ while (it.hasNext()) { final Element elem = it.next(); final String name = elem.getAttribute("name"); + final String valueString = elem.getAttribute("value"); final int value; try { - value = Integer.valueOf(elem.getAttribute("value")); + value = Integer.valueOf(valueString); } catch (final NumberFormatException ignore) { - errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": value '" + elem.getAttribute("value") + "' is not an integer."); + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, name + ": value '" + valueString + "' is not an integer."); continue; } - list.add(new Pair<Integer, String>(value, name)); + try { + list.add(value, name); + } catch (final IllegalArgumentException ex) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, ex.getMessage() + "."); + } } return list; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 17:01:40
|
Revision: 7978 http://gridarta.svn.sourceforge.net/gridarta/?rev=7978&view=rev Author: akirschbaum Date: 2010-05-24 17:01:28 +0000 (Mon, 24 May 2010) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/atrinik/build.xml trunk/atrinik/devlib/JAPI.xml trunk/atrinik/devlib/checkstyle_braces.xml trunk/atrinik/devlib/checkstyle_checks.xml trunk/atrinik/devlib/checkstyle_misc.xml trunk/atrinik/devlib/checkstyle_names.xml trunk/atrinik/devlib/checkstyle_ops.xml trunk/atrinik/devlib/jalopy_format.xml trunk/atrinik/metrics/project/2005-01-01.xml trunk/atrinik/metrics/project/2006-04-01.xml trunk/atrinik/metrics/project/joinInputExample.xml trunk/atrinik/metrics/project/joinmetrics.xslt trunk/atrinik/metrics/project/joinmetrics2xhtml.xslt trunk/atrinik/metrics/project/metric2xhtml.xslt trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/IGUIConstants.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/build.xml trunk/crossfire/build.xml trunk/crossfire/resource/conf/GameObjectMatchers.xml trunk/crossfire/resource/conf/TreasureLists.xml trunk/crossfire/resource/conf/types.xml trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/IGUIConstants.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/daimonin/build.xml trunk/daimonin/devlib/JAPI.xml trunk/daimonin/devlib/checkstyle_braces.xml trunk/daimonin/devlib/checkstyle_checks.xml trunk/daimonin/devlib/checkstyle_misc.xml trunk/daimonin/devlib/checkstyle_names.xml trunk/daimonin/devlib/checkstyle_ops.xml trunk/daimonin/devlib/jalopy_format.xml trunk/daimonin/metrics/project/2005-01-01.xml trunk/daimonin/metrics/project/2006-04-01.xml trunk/daimonin/metrics/project/joinInputExample.xml trunk/daimonin/metrics/project/joinmetrics.xslt trunk/daimonin/metrics/project/joinmetrics2xhtml.xslt trunk/daimonin/metrics/project/metric2xhtml.xslt trunk/daimonin/resource/HelpFiles/treasure_special.html trunk/daimonin/resource/HelpFiles/tut_loading.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/IGUIConstants.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/src/app/net/sf/gridarta/actions/AttachTiledMaps.java trunk/src/app/net/sf/gridarta/commands/Collector.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBool.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeBoolSpec.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeString.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/DialogAttributeTreasure.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GuiInfo.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/EventsTab.java trunk/src/app/net/sf/gridarta/gui/map/cursor/MapCursorActions.java trunk/src/app/net/sf/gridarta/gui/misc/HelpActions.java trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxCellRenderer.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchComboBoxEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gui/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeParser.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeList.java trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/src/app/net/sf/gridarta/model/artifact/ArtifactParser.java trunk/src/app/net/sf/gridarta/model/autojoin/AutojoinList.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/io/FlatFileIterator.java trunk/src/app/net/sf/gridarta/model/io/RecursiveFileIterator.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareIterator.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditControl.java trunk/src/app/net/sf/gridarta/textedit/textarea/DefaultInputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/FunctionMenu.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/InputActions.java trunk/src/app/net/sf/gridarta/utils/ActionUtils.java trunk/src/app/net/sf/gridarta/utils/CommonConstants.java trunk/src/app/net/sf/gridarta/utils/SystemIcons.java trunk/src/app/net/sf/gridarta/validation/checks/PaidItemShopSquareChecker.java trunk/src/app/net/sf/gridarta/validation/checks/ShopSquareChecker.java trunk/src/checkstyle.xml trunk/src/doc/cleanupXhtml11.xslt trunk/src/doc/copyright.xhtml trunk/src/doc/dev/SafeCopy.java trunk/src/doc/dev/changelog.xslt trunk/src/doc/dev/codeStyle.xhtml trunk/src/doc/dev/howToHelp.xhtml trunk/src/doc/dev/start.xhtml trunk/src/doc/dev/todo.xhtml trunk/src/doc/dev/transactions.xhtml trunk/src/doc/dev/typeParameters.xhtml trunk/src/doc/dtd/catalogForAnt.xml trunk/src/doc/faq.xhtml trunk/src/doc/faq2txt.xslt trunk/src/doc/hist/MergingEditors.xhtml trunk/src/doc/history.xhtml trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/news/start.xhtml trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/src/doc/start.xhtml trunk/src/doc/status404.xhtml trunk/src/doc/subversion.xhtml trunk/src/doc/transform.xslt trunk/src/doc/xhtml2html.xslt Modified: trunk/atrinik/build.xml =================================================================== --- trunk/atrinik/build.xml 2010-05-24 15:40:45 UTC (rev 7977) +++ trunk/atrinik/build.xml 2010-05-24 17:01:28 UTC (rev 7978) @@ -1,5 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- +<?xml version="1.0" encoding="UTF-8"?><!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. ~ Copyright (C) 2000-2010 The Gridarta Developers. ~ @@ -40,33 +39,36 @@ <!-- set properties and clean build directory --> <target name="init"> - <property name="package" value="net.sf.gridarta.var.atrinik.maincontrol" /> - <property name="targetName" value="Atrinik" /> - <property file="developer.properties" /> - <property name="src.dir" value="src/app" /> - <property name="lib.dir" value="lib" /> - <property name="devlib.dir" value="devlib/" /><!-- Don't forget trailing / ! --> - <property name="test.dir" value="test" /> - <property name="resource.dir" value="resource" /> - <property name="arch.dir" value="../arch" /> - <property name="build.dir.production" value="class/production" /> - <property name="jarname" value="${targetName}Editor.jar" /> - <property name="build.source.version" value="1.5" /> - <property name="build.target.version" value="${build.source.version}" /> - <property name="build.source.encoding" value="utf-8" /> - <property name="checkstyle.path" value="${devlib.dir}checkstyle-all-3.5.jar" /> - <property name="checkstyle.conv" value="${devlib.dir}checkstyle_checks.xml" /> - <property name="todo.file" value="todo.txt" /> - <property name="debug" value="false" /> - <property name="user.ftp.depends" value="yes" /> - <property name="user.ftp.passive" value="yes" /> - <property name="user.ftp.ignoreNoncriticalErrors" value="yes" /> - <property name="build.developer" value="unknown" /> - <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation" /> - <property name="javac.fork" value="no" /> - <tstamp><format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/></tstamp> - <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false" /> - <property name="build.number" value="unknown" /> + <property name="package" value="net.sf.gridarta.var.atrinik.maincontrol"/> + <property name="targetName" value="Atrinik"/> + <property file="developer.properties"/> + <property name="src.dir" value="src/app"/> + <property name="lib.dir" value="lib"/> + <property name="devlib.dir" value="devlib/"/> + <!-- Don't forget trailing / ! --> + <property name="test.dir" value="test"/> + <property name="resource.dir" value="resource"/> + <property name="arch.dir" value="../arch"/> + <property name="build.dir.production" value="class/production"/> + <property name="jarname" value="${targetName}Editor.jar"/> + <property name="build.source.version" value="1.5"/> + <property name="build.target.version" value="${build.source.version}"/> + <property name="build.source.encoding" value="utf-8"/> + <property name="checkstyle.path" value="${devlib.dir}checkstyle-all-3.5.jar"/> + <property name="checkstyle.conv" value="${devlib.dir}checkstyle_checks.xml"/> + <property name="todo.file" value="todo.txt"/> + <property name="debug" value="false"/> + <property name="user.ftp.depends" value="yes"/> + <property name="user.ftp.passive" value="yes"/> + <property name="user.ftp.ignoreNoncriticalErrors" value="yes"/> + <property name="build.developer" value="unknown"/> + <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial,-deprecation"/> + <property name="javac.fork" value="no"/> + <tstamp> + <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/> + </tstamp> + <exec executable="svnversion" outputproperty="build.number" failifexecutionfails="false"/> + <property name="build.number" value="unknown"/> <echoproperties destfile="build.properties"> <propertyset negate="true"> <propertyref prefix="user.ftp"/> @@ -78,34 +80,24 @@ <!-- create ctags. --> <target name="ctags" if="user.ctags" depends="init" description="creates tags file with symbol definitions for vim and other editors."> <exec executable="ctags"> - <arg line="-R ${src.dir}" /> + <arg line="-R ${src.dir}"/> </exec> </target> <!-- delete and recreate the build directory --> <target name="clean" description="deletes compiled classes." depends="init"> - <delete dir="${build.dir.production}" /> - <mkdir dir="${build.dir.production}" /> + <delete dir="${build.dir.production}"/> + <mkdir dir="${build.dir.production}"/> </target> <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> - <javac - srcdir = "${src.dir}:../src/app" - destdir = "${build.dir.production}" - encoding = "${build.source.encoding}" - source = "${build.source.version}" - target = "${build.target.version}" - debug = "${debug}" - excludes = "test/**/*.java" - fork = "${javac.fork}" - includeantruntime = "false" - > + <javac srcdir="${src.dir}:../src/app" destdir="${build.dir.production}" encoding="${build.source.encoding}" source="${build.source.version}" target="${build.target.version}" debug="${debug}" excludes="test/**/*.java" fork="${javac.fork}" includeantruntime="false"> <classpath> - <fileset dir="${lib.dir}" includes="*.jar" /> - <fileset dir="../lib/" includes="*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar"/> + <fileset dir="../lib/" includes="*.jar"/> </classpath> - <compilerarg line="${javac.args}" /> + <compilerarg line="${javac.args}"/> </javac> </target> @@ -123,10 +115,10 @@ </fileset> </copy> <copy todir="${build.dir.production}"> - <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> + <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html"/> </copy> <copy todir="${build.dir.production}"> - <fileset dir="${src.dir}" includes="**/*.properties" /> + <fileset dir="${src.dir}" includes="**/*.properties"/> </copy> <copy todir="${build.dir.production}"> <fileset dir="../resource"> @@ -136,120 +128,72 @@ <include name="toolbarButtonGraphics/**/*.*"/> </fileset> </copy> - <!--copy file="${arch.dir}/archetypes" todir="${build.dir.production}" /--> - <!--copy file="${arch.dir}/atrinik.0" todir="${build.dir.production}" /--> - <!--copy file="${arch.dir}/treasures" todir="${build.dir.production}" /--> - <delete dir="${build.dir.production}/customize" /> + <!--copy file="${arch.dir}/archetypes" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/atrinik.0" todir="${build.dir.production}" /--><!--copy file="${arch.dir}/treasures" todir="${build.dir.production}" /--> + <delete dir="${build.dir.production}/customize"/> - <jar - destfile = "${jarname}" - index = "true" - > + <jar destfile="${jarname}" index="true"> <!-- pack everything into the jar file --> <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> - <fileset file="build.properties" /> - <fileset file="../COPYING" /> + <fileset file="build.properties"/> + <fileset file="../COPYING"/> <fileset dir="${lib.dir}"> - <include name="*-LICENSE" /> + <include name="*-LICENSE"/> </fileset> <fileset dir="../lib"> - <include name="bsh-LICENSE" /> - <include name="java-getopt-1.0.13" /> - <include name="japi.jar-LICENSE" /> - <include name="log4j-1.2.13.jar-LICENSE" /> - <include name="jdom.jar-LICENSE" /> - <include name="java-getopt-1.0.13.jar-LICENSE" /> + <include name="bsh-LICENSE"/> + <include name="java-getopt-1.0.13"/> + <include name="japi.jar-LICENSE"/> + <include name="log4j-1.2.13.jar-LICENSE"/> + <include name="jdom.jar-LICENSE"/> + <include name="java-getopt-1.0.13.jar-LICENSE"/> </fileset> - <zipfileset src="../lib/log4j-1.2.13.jar" /> - <zipfileset src="../lib/java-getopt-1.0.13.jar" /> - <zipfileset src="../lib/jdom.jar" /> - <zipfileset src="../lib/bsh-core-2.0b4.jar" excludes="META-INF/**" /> - <zipfileset src="../lib/bsh-commands-2.0b4.jar" excludes="META-INF/**" /> - <zipfileset src="../lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**" /> - <zipfileset src="../lib/bsh-util-2.0b4.jar" excludes="META-INF/**" /> - <zipgroupfileset dir="../lib/" includes="japi-*.jar" /> + <zipfileset src="../lib/log4j-1.2.13.jar"/> + <zipfileset src="../lib/java-getopt-1.0.13.jar"/> + <zipfileset src="../lib/jdom.jar"/> + <zipfileset src="../lib/bsh-core-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="../lib/bsh-commands-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="../lib/bsh-classgen-2.0b4.jar" excludes="META-INF/**"/> + <zipfileset src="../lib/bsh-util-2.0b4.jar" excludes="META-INF/**"/> + <zipgroupfileset dir="../lib/" includes="japi-*.jar"/> <!-- creating the manifest --> <manifest> <attribute name="Main-Class" value="${package}.AtrinikEditor"/> - <attribute name="SplashScreen-Image" value="icons/CFIntro.gif" /> + <attribute name="SplashScreen-Image" value="icons/CFIntro.gif"/> </manifest> </jar> <!-- delete the build directory --> - <delete dir="${build.dir.production}" /> + <delete dir="${build.dir.production}"/> </target> <!-- run the jar file with default memory (64 Mb on most systems) --> <target name="run" depends="init" description="runs editor."> - <java jar="${jarname}" fork="true" failonerror="true" /> + <java jar="${jarname}" fork="true" failonerror="true"/> </target> <!-- run the jar file with extra memory (128 Mb) --> <target name="run_high" depends="init" description="runs editor with extra memory (128m)."> - <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m" /> + <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m"/> </target> <!-- Create API documentation. --> <target name="doc" depends="init" description="creates JavaDoc documentation for editor source."> - <mkdir dir="javadoc" /> - <javadoc - destdir = "javadoc" - locale = "en_US" - version = "yes" - author = "yes" - use = "yes" - splitindex = "yes" - windowtitle = "${targetName} Editor — API Documentation" - doctitle = "${targetName} Editor<br />API Documentation" - header = "${targetName} Editor<br />API Documentation" - footer = "${targetName} Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" - serialwarn = "yes" - charset = "utf-8" - docencoding = "utf-8" - source = "${build.source.version}" - encoding = "${build.source.encoding}" - linksource = "yes" - private = "yes" - overview = "src/${package}/overview.html" - link = "${user.javadoc.link}" - > + <mkdir dir="javadoc"/> + <javadoc destdir="javadoc" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="${targetName} Editor — API Documentation" doctitle="${targetName} Editor<br />API Documentation" header="${targetName} Editor<br />API Documentation" footer="${targetName} Editor<br />API Documentation" bottom="<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennies, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn="yes" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/${package}/overview.html" link="${user.javadoc.link}"> <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE" /> - <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE"/> + <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE"/> </classpath> - <sourcepath path="${src.dir}" /> - <packageset - dir="src" - defaultexcludes="yes" - > - <include name="**" /> + <sourcepath path="${src.dir}"/> + <packageset dir="src" defaultexcludes="yes"> + <include name="**"/> </packageset> - <tag - name="todo" - description="Todo:" - /> - <tag - name="used" - description="Manually marked as used." - enabled="false" - /> - <tag - name="fixme" - description="Fixme:" - /> - <tag - name="xxx" - description="XXX:" - /> - <tag - name="note" - description="Note:" - /> - <tag - name="devs" - description="At Developers:" - /> + <tag name="todo" description="Todo:"/> + <tag name="used" description="Manually marked as used." enabled="false"/> + <tag name="fixme" description="Fixme:"/> + <tag name="xxx" description="XXX:"/> + <tag name="note" description="Note:"/> + <tag name="devs" description="At Developers:"/> </javadoc> </target> @@ -258,7 +202,7 @@ --> <target name="checkstyle" depends="init" description="performs style checks for source."> <taskdef resource="checkstyletask.properties" classpath="${checkstyle.path}"/> - <mkdir dir="${test.dir}" /> + <mkdir dir="${test.dir}"/> <checkstyle config="${checkstyle.conv}"> <fileset dir="${src.dir}" includes="**/*.java"/> <formatter type="plain"/> @@ -271,61 +215,36 @@ --> <target name="todo" depends="init" description="prints a file with todo information"> <concat> - <fileset file="${todo.file}" /> + <fileset file="${todo.file}"/> </concat> </target> - <target - name = "preparePublish" - description = "preparse files to publish" - depends = "jar" - > - <property name="update.number" value="${build.number}"/> - <property name="update.tstamp" value="${build.tstamp}"/> + <target name="preparePublish" description="preparse files to publish" depends="jar"> + <property name="update.number" value="${build.number}"/> + <property name="update.tstamp" value="${build.tstamp}"/> <property name="update.developer" value="${build.developer}"/> - <property name="update.url" value="${user.update.url}"/> + <property name="update.url" value="${user.update.url}"/> <echoproperties destfile="update.properties"> <propertyset> - <propertyref prefix="update" /> + <propertyref prefix="update"/> </propertyset> </echoproperties> </target> - <target - name = "ftpPublish" - description = "publishes ${jarname} using ftp" - depends = "preparePublish" - > - <ftp - server="${user.ftp.host}" - userid="${user.ftp.user}" - password="${user.ftp.pass}" - remotedir="${user.ftp.dir}" - depends="${user.ftp.depends}" - passive="${user.ftp.passive}" - ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}" - > + <target name="ftpPublish" description="publishes ${jarname} using ftp" depends="preparePublish"> + <ftp server="${user.ftp.host}" userid="${user.ftp.user}" password="${user.ftp.pass}" remotedir="${user.ftp.dir}" depends="${user.ftp.depends}" passive="${user.ftp.passive}" ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}"> <fileset dir="."> - <include name="${jarname}" /> - <include name="update.properties" /> + <include name="${jarname}"/> + <include name="update.properties"/> </fileset> </ftp> </target> - <target - name = "scpPublish" - description = "publishes ${jarname} using scp" - depends = "preparePublish" - > - <scp - todir="${user.scp.dir}" - passphrase="${user.scp.passphrase}" - trust="${user.scp.trust}" - keyfile="${user.scp.keyfile}" - > + <target name="scpPublish" description="publishes ${jarname} using scp" depends="preparePublish"> + <scp todir="${user.scp.dir}" passphrase="${user.scp.passphrase}" trust="${user.scp.trust}" keyfile="${user.scp.keyfile}"> <fileset dir="."> - <include name="${jarname}" /> - <include name="update.properties" /> + <include name="${jarname}"/> + <include name="update.properties"/> </fileset> </scp> </target> Modified: trunk/atrinik/devlib/JAPI.xml =================================================================== --- trunk/atrinik/devlib/JAPI.xml 2010-05-24 15:40:45 UTC (rev 7977) +++ trunk/atrinik/devlib/JAPI.xml 2010-05-24 17:01:28 UTC (rev 7978) @@ -1,5 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- +<?xml version="1.0" encoding="UTF-8"?><!-- ~ Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. ~ Copyright (C) 2000-2010 The Gridarta Developers. ~ @@ -19,634 +18,634 @@ --> <inspections profile_name="JAPI" version="1.0"> - <inspection_tool class="AssertAsName" level="ERROR" enabled="true" /> - <inspection_tool class="EnumAsName" level="ERROR" enabled="true" /> - <inspection_tool class="InstanceofChain" level="WARNING" enabled="true" /> - <inspection_tool class="ClassReferencesSubclass" level="WARNING" enabled="true" /> - <inspection_tool class="DeclareCollectionAsInterface" level="WARNING" enabled="true" /> - <inspection_tool class="InstanceofThis" level="WARNING" enabled="true" /> - <inspection_tool class="OverlyStrongTypeCast" level="WARNING" enabled="true" /> - <inspection_tool class="MethodOnlyUsedFromInnerClass" level="WARNING" enabled="true"> - <option name="ignoreMethodsAccessedFromAnonymousClass" value="false" /> - </inspection_tool> - <inspection_tool class="ReplaceAssignmentWithOperatorAssignment" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentToForLoopParameter" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentToCatchBlockParameter" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentToMethodParameter" level="WARNING" enabled="true" /> - <inspection_tool class="NestedAssignment" level="WARNING" enabled="true" /> - <inspection_tool class="AnonymousClassMethodCount" level="WARNING" enabled="true"> - <option name="m_limit" value="1" /> - </inspection_tool> - <inspection_tool class="FieldCount" level="WARNING" enabled="true"> - <option name="m_countConstantFields" value="false" /> - <option name="m_considerStaticFinalFieldsConstant" value="false" /> - <option name="m_limit" value="10" /> - </inspection_tool> - <inspection_tool class="MethodCount" level="WARNING" enabled="true"> - <option name="m_limit" value="20" /> - </inspection_tool> - <inspection_tool class="ConstructorCount" level="WARNING" enabled="true"> - <option name="m_limit" value="5" /> - </inspection_tool> - <inspection_tool class="ClassNestingDepth" level="WARNING" enabled="true"> - <option name="m_limit" value="1" /> - </inspection_tool> - <inspection_tool class="AnonymousClassComplexity" level="WARNING" enabled="true"> - <option name="m_limit" value="3" /> - </inspection_tool> - <inspection_tool class="ClassComplexity" level="WARNING" enabled="true"> - <option name="m_limit" value="80" /> - </inspection_tool> - <inspection_tool class="ClassCoupling" level="WARNING" enabled="true"> - <option name="m_includeJavaClasses" value="false" /> - <option name="m_includeLibraryClasses" value="false" /> - <option name="m_limit" value="15" /> - </inspection_tool> - <inspection_tool class="AnonymousInnerClass" level="WARNING" enabled="true" /> - <inspection_tool class="ClassMayBeInterface" level="WARNING" enabled="true" /> - <inspection_tool class="ClassNameDiffersFromFileName" level="WARNING" enabled="true" /> - <inspection_tool class="ClassInTopLevelPackage" level="WARNING" enabled="true" /> - <inspection_tool class="ConstantDeclaredInInterface" level="WARNING" enabled="true" /> - <inspection_tool class="EmptyClass" level="WARNING" enabled="true" /> - <inspection_tool class="FinalMethodInFinalClass" level="WARNING" enabled="true" /> - <inspection_tool class="InnerClassOnInterface" level="WARNING" enabled="true"> - <option name="m_ignoreInnerInterfaces" value="false" /> - </inspection_tool> - <inspection_tool class="LimitedScopeInnerClass" level="WARNING" enabled="true" /> - <inspection_tool class="MarkerInterface" level="WARNING" enabled="true" /> - <inspection_tool class="MissingDeprecatedAnnotation" level="WARNING" enabled="true" /> - <inspection_tool class="MissingOverrideAnnotation" level="WARNING" enabled="true" /> - <inspection_tool class="MultipleTopLevelClassesInFile" level="WARNING" enabled="true" /> - <inspection_tool class="ClassInitializer" level="WARNING" enabled="true" /> - <inspection_tool class="ProtectedMemberInFinalClass" level="WARNING" enabled="true" /> - <inspection_tool class="PublicConstructorInNonPublicClass" level="WARNING" enabled="true" /> - <inspection_tool class="Singleton" level="WARNING" enabled="true" /> - <inspection_tool class="StaticNonFinalField" level="WARNING" enabled="true" /> - <inspection_tool class="UtilityClass" level="WARNING" enabled="true" /> - <inspection_tool class="UtilityClassWithPublicConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="UtilityClassWithoutPrivateConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="CloneCallsConstructors" level="WARNING" enabled="true" /> - <inspection_tool class="CloneInNonCloneableClass" level="WARNING" enabled="true" /> - <inspection_tool class="CloneableImplementsClone" level="WARNING" enabled="true"> - <option name="m_ignoreCloneableDueToInheritance" value="false" /> - </inspection_tool> - <inspection_tool class="ThrowablePrintStackTrace" level="WARNING" enabled="true" /> - <inspection_tool class="ThreadDumpStack" level="WARNING" enabled="true" /> - <inspection_tool class="ObsoleteCollection" level="WARNING" enabled="true" /> - <inspection_tool class="SystemOutErr" level="WARNING" enabled="true" /> - <inspection_tool class="CStyleArrayDeclaration" level="WARNING" enabled="true" /> - <inspection_tool class="ChainedEquality" level="WARNING" enabled="true" /> - <inspection_tool class="ConfusingOctalEscape" level="WARNING" enabled="true" /> - <inspection_tool class="ControlFlowStatementWithoutBraces" level="WARNING" enabled="true" /> - <inspection_tool class="LiteralAsArgToStringEquals" level="WARNING" enabled="true" /> - <inspection_tool class="LocalCanBeFinal" level="WARNING" enabled="true"> - <option name="REPORT_VARIABLES" value="true" /> - <option name="REPORT_PARAMETERS" value="true" /> - </inspection_tool> - <inspection_tool class="MissortedModifiers" level="WARNING" enabled="true"> - <option name="m_requireAnnotationsFirst" value="true" /> - </inspection_tool> - <inspection_tool class="MultipleDeclaration" level="WARNING" enabled="true" /> - <inspection_tool class="RedundantFieldInitialization" level="WARNING" enabled="true" /> - <inspection_tool class="RedundantImplements" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessarilyQualifiedStaticUsage" level="WARNING" enabled="true"> - <option name="m_ignoreStaticFieldAccesses" value="false" /> - <option name="m_ignoreStaticMethodCalls" value="false" /> - <option name="m_ignoreStaticAccessFromStaticContext" value="false" /> - </inspection_tool> - <inspection_tool class="UnnecessaryThis" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessarySuperConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryBlockStatement" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryEnumModifier" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryFullyQualifiedName" level="WARNING" enabled="true"> - <option name="m_ignoreJavadoc" value="false" /> - </inspection_tool> - <inspection_tool class="UnnecessaryInterfaceModifier" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryParentheses" level="WARNING" enabled="true" /> - <inspection_tool class="UnnecessaryQualifierForThis" level="WARNING" enabled="true" /> - <inspection_tool class="MultipleTypedDeclaration" level="WARNING" enabled="true" /> - <inspection_tool class="BreakStatement" level="WARNING" enabled="true" /> - <inspection_tool class="BreakStatementWithLabel" level="WARNING" enabled="true" /> - <inspection_tool class="ConditionalExpressionWithIdenticalBranches" level="WARNING" enabled="true" /> - <inspection_tool class="NegatedConditional" level="WARNING" enabled="true"> - <option name="m_ignoreNegatedNullComparison" value="true" /> - </inspection_tool> - <inspection_tool class="ConfusingElse" level="WARNING" enabled="true" /> - <inspection_tool class="ContinueStatement" level="WARNING" enabled="true" /> - <inspection_tool class="ContinueStatementWithLabel" level="WARNING" enabled="true" /> - <inspection_tool class="DefaultNotLastCaseInSwitch" level="WARNING" enabled="true" /> - <inspection_tool class="DuplicateCondition" level="WARNING" enabled="true" /> - <inspection_tool class="EnumSwitchStatementWhichMissesCases" level="WARNING" enabled="true"> - <option name="ignoreSwitchStatementsWithDefault" value="false" /> - </inspection_tool> - <inspection_tool class="FallthruInSwitchStatement" level="WARNING" enabled="true" /> - <inspection_tool class="ForLoopReplaceableByWhile" level="WARNING" enabled="true"> - <option name="m_ignoreLoopsWithoutConditions" value="false" /> - </inspection_tool> - <inspection_tool class="ForLoopWithMissingComponent" level="WARNING" enabled="true" /> - <inspection_tool class="IfStatementWithIdenticalBranches" level="WARNING" enabled="true" /> - <inspection_tool class="NegatedIfElse" level="WARNING" enabled="true"> - <option name="m_ignoreNegatedNullComparison" value="true" /> - </inspection_tool> - <inspection_tool class="IfStatementWithTooManyBranches" level="WARNING" enabled="true"> - <option name="m_limit" value="3" /> - </inspection_tool> - <inspection_tool class="LabeledStatement" level="WARNING" enabled="true" /> - <inspection_tool class="SwitchStatementWithConfusingDeclaration" level="WARNING" enabled="true" /> - <inspection_tool class="NestedSwitchStatement" level="WARNING" enabled="true" /> - <inspection_tool class="NestedConditionalExpression" level="WARNING" enabled="true" /> - <inspection_tool class="OverlyComplexBooleanExpression" level="WARNING" enabled="true"> - <option name="m_limit" value="3" /> - <option name="m_ignorePureConjunctionsDisjunctions" value="true" /> - </inspection_tool> - <inspection_tool class="PointlessIndexOfComparison" level="WARNING" enabled="true" /> - <inspection_tool class="SwitchStatementWithTooFewBranches" level="WARNING" enabled="true"> - <option name="m_limit" value="2" /> - </inspection_tool> - <inspection_tool class="SwitchStatementDensity" level="WARNING" enabled="true"> - <option name="m_limit" value="20" /> - </inspection_tool> - <inspection_tool class="SwitchStatementWithTooManyBranches" level="WARNING" enabled="true"> - <option name="m_limit" value="10" /> - </inspection_tool> - <inspection_tool class="SwitchStatementsWithoutDefault" level="WARNING" enabled="true"> - <option name="m_ignoreFullyCoveredEnums" value="true" /> - </inspection_tool> - <inspection_tool class="UnnecessaryDefault" level="WARNING" enabled="true" /> - <inspection_tool class="ReuseOfLocalVariable" level="WARNING" enabled="true" /> - <inspection_tool class="TooBroadScope" level="WARNING" enabled="true"> - <option name="m_allowConstructorAsInitializer" value="false" /> - <option name="m_onlyLookAtBlocks" value="false" /> - </inspection_tool> - <inspection_tool class="AssignmentToCollectionFieldFromParameter" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentToDateFieldFromParameter" level="WARNING" enabled="true" /> - <inspection_tool class="PackageVisibleField" level="WARNING" enabled="true" /> - <inspection_tool class="PackageVisibleInnerClass" level="WARNING" enabled="true" /> - <inspection_tool class="ProtectedField" level="WARNING" enabled="true" /> - <inspection_tool class="ProtectedInnerClass" level="WARNING" enabled="true" /> - <inspection_tool class="PublicField" level="WARNING" enabled="true" /> - <inspection_tool class="ReturnOfCollectionField" level="WARNING" enabled="true"> - <option name="ignorePrivateMethods" value="true" /> - </inspection_tool> - <inspection_tool class="ReturnOfDateField" level="WARNING" enabled="true" /> - <inspection_tool class="CatchGenericClass" level="WARNING" enabled="true" /> - <inspection_tool class="InstanceofCatchParameter" level="WARNING" enabled="true" /> - <inspection_tool class="ErrorRethrown" level="WARNING" enabled="true" /> - <inspection_tool class="ThreadDeathRethrown" level="WARNING" enabled="true" /> - <inspection_tool class="NestedTryStatement" level="WARNING" enabled="true" /> - <inspection_tool class="NonFinalFieldOfException" level="WARNING" enabled="true" /> - <inspection_tool class="TooBroadCatch" level="WARNING" enabled="true" /> - <inspection_tool class="ThrowCaughtLocally" level="WARNING" enabled="true" /> - <inspection_tool class="ExceptionFromCatchWhichDoesntWrap" level="WARNING" enabled="true" /> - <inspection_tool class="Finalize" level="WARNING" enabled="true" /> - <inspection_tool class="FinalizeNotProtected" level="WARNING" enabled="true" /> - <inspection_tool class="OnDemandImport" level="WARNING" enabled="true" /> - <inspection_tool class="SamePackageImport" level="WARNING" enabled="true" /> - <inspection_tool class="JavaLangImport" level="WARNING" enabled="true" /> - <inspection_tool class="RedundantImport" level="WARNING" enabled="true" /> - <inspection_tool class="UnusedImport" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractClassNeverImplemented" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractClassWithoutAbstractMethods" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractMethodOverridesAbstractMethod" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractMethodOverridesConcreteMethod" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractMethodWithMissingImplementations" level="WARNING" enabled="true" /> - <inspection_tool class="ExtendsConcreteCollection" level="WARNING" enabled="true" /> - <inspection_tool class="NonProtectedConstructorInAbstractClass" level="WARNING" enabled="true"> - <option name="m_ignoreNonPublicClasses" value="false" /> - </inspection_tool> - <inspection_tool class="RedundantMethodOverride" level="WARNING" enabled="true" /> - <inspection_tool class="StaticInheritance" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractMethodCallInConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="InstanceVariableUninitializedUse" level="WARNING" enabled="true"> - <option name="m_ignorePrimitives" value="false" /> - </inspection_tool> - <inspection_tool class="NonFinalStaticVariableUsedInClassInitialization" level="WARNING" enabled="true" /> - <inspection_tool class="OverriddenMethodCallInConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="StaticVariableInitialization" level="WARNING" enabled="true"> - <option name="m_ignorePrimitives" value="false" /> - </inspection_tool> - <inspection_tool class="StaticVariableUninitializedUse" level="WARNING" enabled="true"> - <option name="m_ignorePrimitives" value="false" /> - </inspection_tool> - <inspection_tool class="ThisEscapedInConstructor" level="WARNING" enabled="true" /> - <inspection_tool class="NonThreadSafeLazyInitialization" level="WARNING" enabled="true" /> - <inspection_tool class="DateToString" level="WARNING" enabled="true" /> - <inspection_tool class="NumericToString" level="WARNING" enabled="true" /> - <inspection_tool class="StringEqualsIgnoreCase" level="WARNING" enabled="true" /> - <inspection_tool class="StringToUpperWithoutLocale" level="WARNING" enabled="true" /> - <inspection_tool class="TimeToString" level="WARNING" enabled="true" /> - <inspection_tool class="CharacterComparison" level="WARNING" enabled="true" /> - <inspection_tool class="SimpleDateFormatWithoutLocale" level="WARNING" enabled="true" /> - <inspection_tool class="StringTokenizer" level="WARNING" enabled="true" /> - <inspection_tool class="AbstractClassWithOnlyOneDirectInheritor" level="WARNING" enabled="true" /> - <inspection_tool class="AnonymousInnerClassMayBeStatic" level="WARNING" enabled="true" /> - <inspection_tool class="ConnectionResource" level="WARNING" enabled="true" /> - <inspection_tool class="CheckForOutOfMemoryOnLargeArrayAllocation" level="WARNING" enabled="true"> - <option name="m_limit" value="64" /> - </inspection_tool> - <inspection_tool class="OverlyLargePrimitiveArrayInitializer" level="WARNING" enabled="true"> - <option name="m_limit" value="64" /> - </inspection_tool> - <inspection_tool class="RecordStoreResource" level="WARNING" enabled="true" /> - <inspection_tool class="IndexOfReplaceableByContains" level="WARNING" enabled="true" /> - <inspection_tool class="RawUseOfParameterizedType" level="WARNING" enabled="true"> - <option name="ignoreObjectConstruction" value="true" /> - </inspection_tool> - <inspection_tool class="FieldHasSetterButNoGetter" level="WARNING" enabled="true" /> - <inspection_tool class="ClassWithMultipleLoggers" level="WARNING" enabled="true"> - <option name="loggerClassName" value="java.util.logging.Logger" /> - </inspection_tool> - <inspection_tool class="NonStaticFinalLogger" level="WARNING" enabled="true"> - <option name="loggerClassName" value="java.util.logging.Logger" /> - </inspection_tool> - <inspection_tool class="SystemGC" level="WARNING" enabled="true" /> - <inspection_tool class="StaticCollection" level="WARNING" enabled="true"> - <option name="m_ignoreWeakCollections" value="false" /> - </inspection_tool> - <inspection_tool class="StringBufferField" level="WARNING" enabled="true" /> - <inspection_tool class="ZeroLengthArrayInitialization" level="WARNING" enabled="true" /> - <inspection_tool class="ThreeNegationsPerMethod" level="WARNING" enabled="true"> - <option name="m_ignoreInEquals" value="true" /> - </inspection_tool> - <inspection_tool class="ParametersPerMethod" level="WARNING" enabled="true"> - <option name="m_limit" value="5" /> - </inspection_tool> - <inspection_tool class="CyclomaticComplexity" level="WARNING" enabled="true"> - <option name="m_limit" value="10" /> - </inspection_tool> - <inspection_tool class="MethodCoupling" level="WARNING" enabled="true"> - <option name="m_includeJavaClasses" value="false" /> - <option name="m_includeLibraryClasses" value="false" /> - <option name="m_limit" value="10" /> - </inspection_tool> - <inspection_tool class="NonCommentSourceStatements" level="WARNING" enabled="true"> - <option name="m_limit" value="30" /> - </inspection_tool> - <inspection_tool class="NestingDepth" level="WARNING" enabled="true"> - <option name="m_limit" value="5" /> - </inspection_tool> - <inspection_tool class="ClassNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][0-9A-Za-z]*" /> - <option name="m_minLength" value="4" /> - <option name="m_maxLength" value="64" /> - </inspection_tool> - <inspection_tool class="ConstantNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][A-Z0-9_]*" /> - <option name="m_minLength" value="5" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="EnumeratedClassNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][A-Za-z]*" /> - <option name="m_minLength" value="8" /> - <option name="m_maxLength" value="64" /> - </inspection_tool> - <inspection_tool class="EnumeratedConstantNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][A-Za-z]*" /> - <option name="m_minLength" value="5" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="InstanceMethodNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[a-z][A-Za-z]*" /> - <option name="m_minLength" value="4" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="InstanceVariableNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[a-z][A-Za-z0-9]*" /> - <option name="m_minLength" value="2" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="InterfaceNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][0-9A-Za-z]*" /> - <option name="m_minLength" value="5" /> - <option name="m_maxLength" value="64" /> - </inspection_tool> - <inspection_tool class="LocalVariableNamingConvention" level="WARNING" enabled="true"> - <option name="m_ignoreForLoopParameters" value="false" /> - <option name="m_ignoreCatchParameters" value="false" /> - <option name="m_regex" value="[a-z][A-Za-z0-9]*" /> - <option name="m_minLength" value="1" /> - <option name="m_maxLength" value="20" /> - </inspection_tool> - <inspection_tool class="ParameterNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[a-z][0-9A-Za-z]*" /> - <option name="m_minLength" value="1" /> - <option name="m_maxLength" value="20" /> - </inspection_tool> - <inspection_tool class="NonBooleanMethodNameMayNotStartWithQuestion" level="WARNING" enabled="true"> - <option name="nameCheckString" value="is,can,has,should,could,will,shall,check,contains,equals,add,put,remove,startsWith,endsWith" /> - </inspection_tool> - <inspection_tool class="StaticMethodNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[a-z][0-9A-Za-z]*" /> - <option name="m_minLength" value="4" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="StaticVariableNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="s_[a-z][A-Za-z]*" /> - <option name="m_minLength" value="5" /> - <option name="m_maxLength" value="32" /> - </inspection_tool> - <inspection_tool class="TypeParameterNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z]" /> - <option name="m_minLength" value="1" /> - <option name="m_maxLength" value="1" /> - </inspection_tool> - <inspection_tool class="AnnotationNamingConvention" level="WARNING" enabled="true"> - <option name="m_regex" value="[A-Z][A-Za-z]*" /> - <option name="m_minLength" value="8" /> - <option name="m_maxLength" value="64" /> - </inspection_tool> - <inspection_tool class="ClassNameSameAsAncestorName" level="WARNING" enabled="true" /> - <inspection_tool class="ConfusingMainMethod" level="WARNING" enabled="true" /> - <inspection_tool class="ExceptionNameDoesntEndWithException" level="WARNING" enabled="true" /> - <inspection_tool class="MethodNameSameAsClassName" level="WARNING" enabled="true" /> - <inspection_tool class="MethodNameSameAsParentName" level="WARNING" enabled="true" /> - <inspection_tool class="MethodNamesDifferOnlyByCase" level="WARNING" enabled="true" /> - <inspection_tool class="UpperCaseFieldNameNotConstant" level="WARNING" enabled="true" /> - <inspection_tool class="NonExceptionNameEndsWithException" level="WARNING" enabled="true" /> - <inspection_tool class="ParameterNameDiffersFromOverriddenParameter" level="WARNING" enabled="true"> - <option name="m_ignoreSingleCharacterNames" value="true" /> - </inspection_tool> - <inspection_tool class="QuestionableName" level="WARNING" enabled="true"> - <option name="nameCheckString" value="foo,bar,baz" /> - </inspection_tool> - <inspection_tool class="StandardVariableNames" level="WARNING" enabled="true" /> - <inspection_tool class="DollarSignInName" level="WARNING" enabled="true" /> - <inspection_tool class="ImplicitNumericConversion" level="WARNING" enabled="true"> - <option name="m_ignoreWideningConversions" value="true" /> - </inspection_tool> - <inspection_tool class="ComparisonOfShortAndChar" level="WARNING" enabled="true" /> - <inspection_tool class="ComparisonToNaN" level="WARNING" enabled="true" /> - <inspection_tool class="ConfusingFloatingPointLiteral" level="WARNING" enabled="true" /> - <inspection_tool class="ConstantMathCall" level="WARNING" enabled="true" /> - <inspection_tool class="DivideByZero" level="WARNING" enabled="true" /> - <inspection_tool class="BigDecimalEquals" level="WARNING" enabled="true" /> - <inspection_tool class="FloatingPointEquality" level="WARNING" enabled="true" /> - <inspection_tool class="IntegerDivisionInFloatingPointContext" level="WARNING" enabled="true" /> - <inspection_tool class="LongLiteralsEndingWithLowercaseL" level="WARNING" enabled="true" /> - <inspection_tool class="NonReproducibleMathCall" level="WARNING" enabled="true" /> - <inspection_tool class="CachedNumberConstructorCall" level="WARNING" enabled="true" /> - <inspection_tool class="OverlyComplexArithmeticExpression" level="WARNING" enabled="true"> - <option name="m_limit" value="6" /> - </inspection_tool> - <inspection_tool class="CallToSimpleGetterInClass" level="WARNING" enabled="true" /> - <inspection_tool class="CallToSimpleSetterInClass" level="WARNING" enabled="true" /> - <inspection_tool class="TrivialStringConcatenation" level="WARNING" enabled="true" /> - <inspection_tool class="StringBufferReplaceableByString" level="WARNING" enabled="true" /> - <inspection_tool class="FieldMayBeStatic" level="WARNING" enabled="true" /> - <inspection_tool class="InnerClassMayBeStatic" level="WARNING" enabled="true" /> - <inspection_tool class="MapReplaceableByEnumMap" level="WARNING" enabled="true" /> - <inspection_tool class="MethodMayBeStatic" level="WARNING" enabled="true"> - <option name="m_onlyPrivateOrFinal" value="false" /> - <option name="m_ignoreEmptyMethods" value="true" /> - </inspection_tool> - <inspection_tool class="MultiplyOrDivideByPowerOfTwo" level="WARNING" enabled="true" /> - <inspection_tool class="StringReplaceableByStringBuffer" level="WARNING" enabled="true" /> - <inspection_tool class="SubstringZero" level="WARNING" enabled="true" /> - <inspection_tool class="SetReplaceableByEnumSet" level="WARNING" enabled="true" /> - <inspection_tool class="LengthOneStringsInConcatenation" level="WARNING" enabled="true" /> - <inspection_tool class="StringConcatenationInLoops" level="WARNING" enabled="true"> - <option name="m_ignoreUnlessAssigned" value="false" /> - </inspection_tool> - <inspection_tool class="StringEqualsEmptyString" level="WARNING" enabled="true" /> - <inspection_tool class="StringBufferReplaceableByStringBuilder" level="WARNING" enabled="true" /> - <inspection_tool class="StringBufferToStringInConcatenation" level="WARNING" enabled="true" /> - <inspection_tool class="TailRecursion" level="WARNING" enabled="true" /> - <inspection_tool class="JavaLangReflect" level="WARNING" enabled="true" /> - <inspection_tool class="RandomDoubleForRandomInteger" level="WARNING" enabled="true" /> - <inspection_tool class="RuntimeExec" level="WARNING" enabled="true" /> - <inspection_tool class="SystemExit" level="WARNING" enabled="true" /> - <inspection_tool class="SystemGetenv" level="WARNING" enabled="true" /> - <inspection_tool class="NativeMethods" level="WARNING" enabled="true" /> - <inspection_tool class="UseOfAWTPeerClass" level="WARNING" enabled="true" /> - <inspection_tool class="UseOfJDBCDriverClass" level="WARNING" enabled="true" /> - <inspection_tool class="UseOfProcessBuilder" level="WARNING" enabled="true" /> - <inspection_tool class="UseOfSunClasses" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentToStaticFieldFromInstanceMethod" level="WARNING" enabled="true" /> - <inspection_tool class="AssignmentUsedAsCondition" level="WARNING" enabled="true" /> - <inspection_tool class="ObjectToString" level="WARNING" enabled="true" /> - <inspection_tool class="CastConflictsWithInstanceof" level="WARNING" enabled="true" /> - <inspection_tool class="CastToIncompatibleInterface" level="WARNING" enabled="true" /> - <inspection_tool class="CollectionAddedToSelf" level="WARNING" enabled="true" /> - <inspection_tool class="MisspelledCompareTo" level="WARNING" enabled="true" /> - <inspection_tool class="CovariantCompareTo" level="WARNING" enabled="true" /> - <inspection_tool class="CovariantEquals" level="WARNING" enabled="true" /> - <inspection_tool class="EmptyInitializer" level="WARNING" enabled="true" /> - <inspection_tool class="MisspelledEquals" level="WARNING" enabled="true" /> - <inspection_tool class="EqualsBetweenInconvertibleTypes" level="WARNING" enabled="true" /> - <inspection_tool class="ArrayEquals" level="WARNING" enabled="true" /> - <inspection_tool class="EqualsWhichDoesntCheckParameterClass" level="WARNING" enabled="true" /> - <inspection_tool class="ForLoopThatDoesntUseLoopVariable" level="WARNING" enabled="true" /> - <inspection_tool class="MisspelledHashcode" level="WARNING" enabled="true" /> - <inspection_tool class="InstanceofIncompatibleInterface" level="WARNING" enabled="true" /> - <inspection_tool class="InstantiationOfUtilityClass" level="WARNING" enabled="true" /> - <inspection_tool class="IteratorHasNextCallsIteratorNext" level="WARNING" enabled="true" /> - <inspection_tool class="IteratorNextDoesNotThrowNoSuchElementException" level="WARNING" enabled="true" /> - <inspection_tool class="CompareToUsesNonFinalVariable" level="WARNING" enabled="true" /> - <inspection_tool class="EqualsUsesNonFinalVariable" level="WARNING" enabled="true" /> - <inspection_tool class="HashCodeUsesNonFinalVariable" level="WARNING" enabled="true" /> - <inspection_tool class="NonShortCircuitBoolean" level="WARNING" enabled="true" /> - <inspection_tool class="ObjectEquality" level="WARNING" enabled="true"> - <option name="m_ignoreEnums" value="true" /> - <option name="m_ignoreClassObjects" value="false" /> - <option name="m_ignorePrivateConstructors" value="false" /> - </inspection_tool> - <inspection_tool class="OctalAndDecimalIntegersMixed" level="WARNING" enabled="true" /> - <inspection_tool class="ResultOfObjectAllocationIgnored" level="WARNING" enabled="true" /> - <inspection_tool class="ReturnNull" level="WARNING" enabled="true"> - <option name="m_reportObjectMethods" value="true" /> - <option name="m_reportArrayMethods" value="true" /> - <option name="m_reportCollectionMethods" value="true" /> - </inspection_tool> - <inspection_tool class="StaticFieldReferenceOnSubclass" level="WARNING" enabled="true" /> - <inspection_tool class="StaticCallOnSubclass" level="WARNING" enabled="true" /> - <inspection_tool class="SubtractionInCompareTo" level="WARNING" enabled="true" /> - <inspection_tool class="SuspiciousToArrayCall" level="WARNING" enabled="true" /> - <inspection_tool class="SuspiciousSystemArraycopy" level="WARNING" enabled="true" /> - <inspection_tool class="TextLabelInSwitchStatement" level="WARNING" enabled="true" /> - <inspection_tool class="MisspelledToString" level="WARNING" enabled="true" /> - <inspection_tool class="ArchaicSystemPropertyAccess" level="WARNING" enabled="true" /> - <inspection_tool class="ResultSetIndexZero" level="WARNING" enabled="true" /> - <inspection_tool class="UseOfPropertiesAsHashtable" level="WARNING" enabled="true" /> - <inspection_tool class="UnusedProperty" level="WARNING" enabled="true" /> - <inspection_tool class="ChannelResource" level="WARNING" enabled="true" /> - <inspection_tool class="HibernateResource" level="WARNING" enabled="true" /> - <inspection_tool class="IOResource" level="WARNING" enabled="true" /> - <inspection_tool class="JDBCResource" level="WARNING" enabled="true" /> - <inspection_tool class="JNDIResource" level="WARNING" enabled="true" /> - <inspection_tool class="SocketResource" level="WARNING" enabled="true" /> - <inspection_tool class="DriverManagerGetConnection" level="WARNING" enabled="true" /> - <inspection_tool class="JDBCPrepareStatementWithNonConstantString" level="WARNING" enabled="true" /> - <inspection_tool class="RuntimeExecWithNonConstantString" level="WARNING" enabled="true" /> - <inspection_tool class="JDBCExecuteWithNonConstantString" level="WARNING" enabled="true" /> - <inspection_tool class="LoadLibraryWithNonConstantString" level="WARNING" enabled="true" /> - <inspection_tool class="SystemSetSecurityManager" level="WARNING" enabled="true" /> - <inspection_tool class="ClassLoader2Instantiation" level="WARNING" enabled="true" /> - <inspection_tool class="CustomClassloader" level="WARNING" enabled="true" /> - <inspection_tool class="CustomSecurityManager" level="WARNING" enabled="true" /> - <inspection_tool class="PublicStaticArrayField" level="WARNING" enabled="true" /> - <inspection_tool class="PublicStaticCollectionField" level="WARNING" enabled="true" /> - <inspection_tool class="UnsecureRandomNumberGeneration" level="WARNING" enabled="true" /> - <inspection_tool class="ExternalizableWithSerializationMethods" level="WARNING" enabled="true" /> - <inspection_tool class="ReadObjectInitialization" level="WARNING" enabled="true" /> - <inspection_tool class="NonSerializableWithSerializationMethods" level="WARNING" enabled="true" /> - <inspection_tool class="NonSerializableWithSerialVersionUIDField" level="WARNING" enabled="true" /> - <inspection_tool class="ReadObjectAndWriteObjectPrivate" level="WARNING" enabled="true" /> - <inspection_tool class="ReadResolveAndWriteReplaceProtected" level="WARNING" enabled="true" /> - <inspection_tool class="SerializableWithUnconstructableAncestor" level="WARNING" enabled="true" /> - <inspection_tool class="SerializableHasSerializationMethods" level="WARNING" enabled="true"> - <option name="m_ignoreSerializableDueToInheritance" value="true" /> - </inspection_tool> - <inspection_tool class="SerializableHasSerialVersionUIDField" level="WARNING" enabled="true"> - <option name="m_ignoreSerializableDueToInheritance" value="true" /> - </inspection_tool> - <inspection_tool class="SerializableInnerClassHasSerialVersionUIDField" level="WARNING" enabled="true"> - <option name="m_ignoreSerializableDueToInheritance" value="true" /> - </inspection_tool> - <inspection_tool class="SerializableInnerClassWithNonSerializableOuterClass" level="WARNING" enabled="true"> - <option name="m_ignoreSerializableDueToInheritance" value="true" /> - </inspection_tool> - <inspection_tool class="SerialPersistentFieldsWithWrongSignature" level="WARNING" enabled="true" /> - <inspection_tool class="SerialVersionUIDNotStaticFinal" level="WARNING" enabled="true" /> - <inspection_tool class="TransientFieldInNonSerializableClass" level="WARNING" enabled="true" /> - <inspection_tool class="ArithmeticOnVolatileField" level="WARNING" enabled="true" /> - <inspection_tool class="AwaitNotInLoop" level="WARNING" enabled="true" /> - <inspection_tool class="BusyWait" level="WARNING" enabled="true" /> - <inspection_tool class="ObjectNotify" level="WARNING" enabled="true" /> - <inspection_tool class="ConditionSignal" level="WARNING" enabled="true"... [truncated message content] |
From: <aki...@us...> - 2010-05-24 18:03:23
|
Revision: 7983 http://gridarta.svn.sourceforge.net/gridarta/?rev=7983&view=rev Author: akirschbaum Date: 2010-05-24 18:03:16 +0000 (Mon, 24 May 2010) Log Message: ----------- Replace string constants with named constants. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -93,7 +93,7 @@ public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(net.sf.gridarta.model.archetype.Archetype.TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB } super.addLast(gameObject); } @@ -105,7 +105,7 @@ public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(net.sf.gridarta.model.archetype.Archetype.TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); } Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/scripts/DefaultScriptedEvent.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -20,6 +20,7 @@ package net.sf.gridarta.var.atrinik.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.scripts.AbstractScriptedEvent; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; @@ -36,6 +37,18 @@ public class DefaultScriptedEvent extends AbstractScriptedEvent<GameObject, MapArchObject, Archetype> { /** + * The attribute that holds the script path. + */ + @NotNull + private static final String SCRIPT_PATH = "race"; + + /** + * The attribute that holds the options. + */ + @NotNull + private static final String OPTIONS = "slaying"; + + /** * The {@link ScriptArchUtils} instance to use. */ @NotNull @@ -145,7 +158,7 @@ @Override @NotNull public String getScriptPath() { - return event.getAttributeString("race"); + return event.getAttributeString(SCRIPT_PATH); } /** @@ -154,7 +167,7 @@ @Override @NotNull public String getOptions() { - return event.getAttributeString("slaying"); + return event.getAttributeString(OPTIONS); } private void setPluginName(@NotNull final String pluginName) { @@ -187,9 +200,9 @@ final int eventType = getEventType(); event.setObjectText(""); event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); - event.setAttributeString(net.sf.gridarta.model.archetype.Archetype.NAME, pluginName); - event.setAttributeString("race", scriptPath); - event.setAttributeString("slaying", options); + event.setAttributeString(BaseObject.NAME, pluginName); + event.setAttributeString(SCRIPT_PATH, scriptPath); + event.setAttributeString(OPTIONS, options); } } // class DefaultScriptedEvent Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/DefaultGameObjectParser.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -51,7 +51,7 @@ */ static { - addKey(net.sf.gridarta.model.archetype.Archetype.NAME); + addKey("name"); addKey("name_pl"); addKey("custom_name"); addKey("title"); Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/scripts/DefaultScriptedEvent.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -20,6 +20,7 @@ package net.sf.gridarta.var.crossfire.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.scripts.AbstractScriptedEvent; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; @@ -36,6 +37,18 @@ public class DefaultScriptedEvent extends AbstractScriptedEvent<GameObject, MapArchObject, Archetype> { /** + * The attribute that holds the plugin name. + */ + @NotNull + private static final String PLUGIN_NAME = "title"; + + /** + * The attribute that holds the options. + */ + @NotNull + private static final String OPTIONS = "slaying"; + + /** * The {@link ScriptArchUtils} instance to use. */ @NotNull @@ -134,7 +147,7 @@ @Override @NotNull public String getPluginName() { - return event.getAttributeString("title"); + return event.getAttributeString(PLUGIN_NAME); } /** @@ -143,7 +156,7 @@ @Override @NotNull public String getScriptPath() { - return event.getAttributeString("slaying"); + return event.getAttributeString(OPTIONS); } /** @@ -184,9 +197,9 @@ final int eventType = getEventType(); event.setObjectText(""); event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); - event.setAttributeString("title", pluginName); - event.setAttributeString("slaying", scriptPath); - event.setAttributeString(net.sf.gridarta.model.archetype.Archetype.NAME, options); + event.setAttributeString(PLUGIN_NAME, pluginName); + event.setAttributeString(OPTIONS, scriptPath); + event.setAttributeString(BaseObject.NAME, options); } } // class DefaultScriptedEvent Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -93,7 +93,7 @@ public void addLast(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(net.sf.gridarta.model.archetype.Archetype.TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB } super.addLast(gameObject); } @@ -105,7 +105,7 @@ public void addFirst(@NotNull final GameObject gameObject) { // force type change when a MONSTER is put in a spawn point if (archetypeTypeSet.getTypeOfArch(this).getTypeNo() == Archetype.TYPE_SPAWN_POINT && archetypeTypeSet.getTypeOfArch(gameObject).getTypeNo() == Archetype.TYPE_MOB) { - gameObject.setAttributeString(net.sf.gridarta.model.archetype.Archetype.TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB + gameObject.setAttributeString(TYPE, Integer.toString(Archetype.TYPE_SPAWN_POINT_MOB)); // change to SPAWN_POINT_MOB } super.addFirst(gameObject); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/scripts/DefaultScriptedEvent.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -20,6 +20,7 @@ package net.sf.gridarta.var.daimonin.model.scripts; import net.sf.gridarta.gui.scripts.ScriptedEventEditor; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.scripts.AbstractScriptedEvent; import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; @@ -36,6 +37,18 @@ public class DefaultScriptedEvent extends AbstractScriptedEvent<GameObject, MapArchObject, Archetype> { /** + * The attribute that holds the script path. + */ + @NotNull + private static final String SCRIPT_PATH = "race"; + + /** + * The attribute that holds the options. + */ + @NotNull + private static final String OPTIONS = "slaying"; + + /** * The {@link ScriptArchUtils} instance to use. */ @NotNull @@ -145,7 +158,7 @@ @Override @NotNull public String getScriptPath() { - return event.getAttributeString("race"); + return event.getAttributeString(SCRIPT_PATH); } /** @@ -154,7 +167,7 @@ @Override @NotNull public String getOptions() { - return event.getAttributeString("slaying"); + return event.getAttributeString(OPTIONS); } private void setPluginName(@NotNull final String pluginName) { @@ -187,9 +200,9 @@ final int eventType = getEventType(); event.setObjectText(""); event.setAttributeString(subtypeAttribute, Integer.toString(eventType)); - event.setAttributeString(net.sf.gridarta.model.archetype.Archetype.NAME, pluginName); - event.setAttributeString("race", scriptPath); - event.setAttributeString("slaying", options); + event.setAttributeString(BaseObject.NAME, pluginName); + event.setAttributeString(SCRIPT_PATH, scriptPath); + event.setAttributeString(OPTIONS, options); } } // class DefaultScriptedEvent Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributesdialog/GameObjectAttributesDialog.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -1255,7 +1255,7 @@ // --- parsing succeeded, now we write it into the gameObject/map --- final int typeNo = gameObject.getTypeNo(); gameObject.setObjectText(newArchText.toString()); - gameObject.setAttributeString(Archetype.TYPE, Integer.toString(typeNo)); + gameObject.setAttributeString(BaseObject.TYPE, Integer.toString(typeNo)); if (newMsg[0] != null) { // set new msg text only when it is not equal to Archetype @@ -1541,7 +1541,7 @@ gameObjectAttributesDialog.archetypeType = newType; // change the gameObject to be of the new type: - gameObject.setAttributeString(Archetype.TYPE, Integer.toString(newType.getTypeNo())); + gameObject.setAttributeString(BaseObject.TYPE, Integer.toString(newType.getTypeNo())); dialogAttributes.clear(); type = gameObjectAttributesDialog.typeComboBox.getSelectedIndex(); Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/ArchTab.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -262,7 +262,7 @@ */ @Override protected void apply(@NotNull final G gameObject) { - gameObject.setAttributeString(Archetype.NAME, archNameField.getText()); + gameObject.setAttributeString(BaseObject.NAME, archNameField.getText()); } /** @@ -276,7 +276,7 @@ if (gameObject == null) { setArchNameField("", Color.black); } else { - final String objName = gameObject.getAttributeString("name", false); + final String objName = gameObject.getAttributeString(BaseObject.NAME, false); if (objName.length() > 0) { setArchNameField(objName, Color.blue); } else { @@ -476,7 +476,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Change object attributes"); try { - selectedGameObject.setAttributeString("direction", Integer.toString(direction)); + selectedGameObject.setAttributeString(BaseObject.DIRECTION, Integer.toString(direction)); } finally { mapModel.endTransaction(); } Modified: trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/gui/gameobjectattributespanel/FaceTab.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -37,6 +37,7 @@ import net.sf.gridarta.gui.utils.Severity; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.data.NamedObjects; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.face.FaceObjects; @@ -120,7 +121,7 @@ final MapModel<G, A, R> mapModel = mapSquare.getMapModel(); mapModel.beginTransaction("Change object attributes"); try { - gameObject.setAttributeString("direction", Integer.toString(dir)); + gameObject.setAttributeString(BaseObject.DIRECTION, Integer.toString(dir)); } finally { mapModel.endTransaction(); } @@ -331,9 +332,9 @@ faceName2 = faceName; } if (faceName2 == null) { - gameObject.removeAttribute("face"); + gameObject.removeAttribute(BaseObject.FACE); } else { - gameObject.setAttributeString("face", faceName2); + gameObject.setAttributeString(BaseObject.FACE, faceName2); } final String animName = normalizeFace(animationComponent.getAnimName()); @@ -345,9 +346,9 @@ animName2 = animName; } if (animName2 == null) { - gameObject.removeAttribute("animation"); + gameObject.removeAttribute(BaseObject.ANIMATION); } else { - gameObject.setAttributeString("animation", animName2); + gameObject.setAttributeString(BaseObject.ANIMATION, animName2); } final boolean isAnimated = animatedCheckBox.isSelected(); Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -40,16 +40,6 @@ public interface Archetype<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends BaseObject<G, A, R, R> { /** - * The attribute name of the archetype's object type. - */ - String TYPE = "type"; - - /** - * The attribute name of the archetype's object name. - */ - String NAME = "name"; - - /** * Return whether this archetype uses the "direction" attribute. * @return Whether this archetype uses the "direction" attribute. */ Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -422,11 +422,11 @@ protected void updateArchetype() { beginGameObjectChange(); try { - direction = getAttributeInt("direction"); - setFaceName(getAttributeString("face")); - setAnimName(getAttributeString("animation")); - setTypeNo(getAttributeInt(Archetype.TYPE)); - setObjName(getAttributeString(Archetype.NAME)); + direction = getAttributeInt(DIRECTION); + setFaceName(getAttributeString(FACE)); + setAnimName(getAttributeString(ANIMATION)); + setTypeNo(getAttributeInt(TYPE)); + setObjName(getAttributeString(NAME)); setObjectFace(); if (multi != null) { final int multiShapeID = getArchetype().getMultiShapeID(); @@ -782,11 +782,11 @@ beginGameObjectChange(); try { gameObjectText.addObjectText(line); - direction = getAttributeInt("direction"); - setFaceName(getAttributeString("face")); - setAnimName(getAttributeString("animation")); - setTypeNo(getAttributeInt(Archetype.TYPE)); - setObjName(getAttributeString(Archetype.NAME)); + direction = getAttributeInt(DIRECTION); + setFaceName(getAttributeString(FACE)); + setAnimName(getAttributeString(ANIMATION)); + setTypeNo(getAttributeInt(TYPE)); + setObjName(getAttributeString(NAME)); setObjectFace(); } finally { endGameObjectChange(); @@ -805,11 +805,11 @@ beginGameObjectChange(); try { gameObjectText.setObjectText(objectText); - direction = getAttributeInt("direction"); - setFaceName(getAttributeString("face")); - setAnimName(getAttributeString("animation")); - setTypeNo(getAttributeInt(Archetype.TYPE)); - setObjName(getAttributeString(Archetype.NAME)); + direction = getAttributeInt(DIRECTION); + setFaceName(getAttributeString(FACE)); + setAnimName(getAttributeString(ANIMATION)); + setTypeNo(getAttributeInt(TYPE)); + setObjName(getAttributeString(NAME)); setObjectFace(); } finally { endGameObjectChange(); Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -33,6 +33,36 @@ public interface BaseObject<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>, T extends BaseObject<G, A, R, T>> extends Cloneable, Iterable<G>, Serializable { /** + * The attribute name of the object's animation. + */ + @NotNull + String ANIMATION = "animation"; + + /** + * The attribute name of the object's direction. + */ + @NotNull + String DIRECTION = "direction"; + + /** + * The attribute name of the object's face. + */ + @NotNull + String FACE = "face"; + + /** + * The attribute name of the object's name. + */ + @NotNull + String NAME = "name"; + + /** + * The attribute name of the object's type. + */ + @NotNull + String TYPE = "type"; + + /** * Returns the type number of this Archetype. * @return The type number of this Archetype. */ Modified: trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/exitconnector/ExitLocation.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -21,7 +21,6 @@ import java.awt.Point; import java.io.File; -import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.io.PathManager; import org.jetbrains.annotations.NotNull; @@ -110,7 +109,7 @@ gameObject.setAttributeString("hp", Integer.toString(x)); gameObject.setAttributeString("sp", Integer.toString(y)); if (updateName) { - gameObject.setAttributeString(Archetype.NAME, mapName); + gameObject.setAttributeString(BaseObject.NAME, mapName); } } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObjectUtils.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -64,7 +64,7 @@ // now check if there's a match in the definitions /* we exclude "direction", "type", and "name" on the hard way */ - if (!attrKey.equals("direction") && !attrKey.equals(Archetype.TYPE) && !attrKey.equals(Archetype.NAME) && !type.hasAttributeKey(attrKey)) { + if (!attrKey.equals(BaseObject.DIRECTION) && !attrKey.equals(BaseObject.TYPE) && !attrKey.equals(BaseObject.NAME) && !type.hasAttributeKey(attrKey)) { errors.append(line.trim()).append('\n'); // append line to the errors /* // the attribute doesn't match the definitions, Modified: trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -852,7 +852,7 @@ part = archetypePart.newInstance(gameObjectFactory); } if (direction != null) { - part.setAttributeString("direction", direction.toString()); + part.setAttributeString(BaseObject.DIRECTION, direction.toString()); } if (!parts.isEmpty()) { parts.get(0).addTailPart(part); Modified: trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/test/net/sf/gridarta/exitconnector/ExitConnectorActionsTest.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -28,7 +28,6 @@ import net.sf.gridarta.mapmanager.TestFileControl; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.ArchetypeFactory; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; @@ -406,11 +405,11 @@ mapManager = tmpMapManager; floorArchetype = new TestArchetype("floor", faceObjectProviders, animationObjects); - floorArchetype.setAttributeString(Archetype.TYPE, Integer.toString(FLOOR_TYPE)); + floorArchetype.setAttributeString(BaseObject.TYPE, Integer.toString(FLOOR_TYPE)); archetypeSet.addArchetype(floorArchetype); exitArchetype = new TestArchetype("exit", faceObjectProviders, animationObjects); - exitArchetype.setAttributeString(Archetype.TYPE, Integer.toString(EXIT_TYPE)); + exitArchetype.setAttributeString(BaseObject.TYPE, Integer.toString(EXIT_TYPE)); archetypeSet.addArchetype(exitArchetype); } Modified: trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -22,7 +22,6 @@ import java.util.regex.Pattern; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; @@ -60,7 +59,7 @@ final FaceObjectProviders faceObjectProviders = newFaceObjectProviders(); final TestArchetype archetype = newArchetype("arch", null, faceObjectProviders, animationObjects); Assert.assertNull(archetype.getFaceName()); - archetype.setAttributeString("face", "archface"); + archetype.setAttributeString(BaseObject.FACE, "archface"); Assert.assertEquals("archface", archetype.getFaceName()); final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = newGameObject(archetype, "test", faceObjectProviders, animationObjects); @@ -74,7 +73,7 @@ // set face by text change gameObject.setAttributeString("face1", "face1"); Assert.assertNull(gameObject.getFaceName()); - gameObject.setAttributeString("face", "face2"); + gameObject.setAttributeString(BaseObject.FACE, "face2"); Assert.assertEquals("face2", gameObject.getFaceName()); gameObject.setAttributeString("face2", "face3"); Assert.assertEquals("face2", gameObject.getFaceName()); @@ -245,7 +244,7 @@ } /** - * Checks that the "direction" attribute of an {@link GameObject} contains + * Checks that the "direction" attribute of a {@link GameObject} contains * the expected value. * @param gameObject the game object to check * @param direction the expected direction @@ -256,7 +255,7 @@ } /** - * Checks that caching the "type" attribute does work. + * Checks that caching the {@link }BaseObject#TYPE} attribute does work. */ @Test public void testType1() { @@ -265,16 +264,16 @@ final TestArchetype archetype = newArchetype("arch", null, faceObjectProviders, animationObjects); final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = newGameObject(archetype, "test", faceObjectProviders, animationObjects); checkType(gameObject, 0); - gameObject.setAttributeString("type", "3"); + gameObject.setAttributeString(BaseObject.TYPE, "3"); checkType(gameObject, 3); - gameObject.removeAttribute("type"); + gameObject.removeAttribute(BaseObject.TYPE); checkType(gameObject, 0); gameObject.setObjectText("type 3"); checkType(gameObject, 3); } /** - * Checks that caching the "type" attribute does work. + * Checks that caching the {@link BaseObject#NAME} attribute does work. */ @Test public void testType2() { @@ -283,14 +282,14 @@ final TestArchetype archetype = newArchetype("arch", "type 2", faceObjectProviders, animationObjects); final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = newGameObject(archetype, "test", faceObjectProviders, animationObjects); checkType(gameObject, 2); - gameObject.setAttributeString("type", "3"); + gameObject.setAttributeString(BaseObject.TYPE, "3"); checkType(gameObject, 3); - gameObject.removeAttribute("type"); + gameObject.removeAttribute(BaseObject.TYPE); checkType(gameObject, 2); } /** - * Checks that caching the "type" attribute does work. + * Checks that caching the {@link BaseObject#TYPE} attribute does work. */ @Test public void testType3() { @@ -302,27 +301,27 @@ checkType(gameObject, 1); gameObject.setArchetype(archetype2); checkType(gameObject, 2); - gameObject.setAttributeString("type", "4"); + gameObject.setAttributeString(BaseObject.TYPE, "4"); checkType(gameObject, 4); gameObject.setArchetype(archetype1); checkType(gameObject, 4); - gameObject.removeAttribute("type"); + gameObject.removeAttribute(BaseObject.TYPE); checkType(gameObject, 1); } /** - * Checks that the "type" attribute of an {@link GameObject} contains the - * expected value. + * Checks that the {@link BaseObject#TYPE} attribute of a {@link GameObject} + * contains the expected value. * @param gameObject the game object to check * @param type the expected direction */ private static void checkType(@NotNull final BaseObject<?, ?, ?, ?> gameObject, final int type) { Assert.assertEquals(type, gameObject.getTypeNo()); - Assert.assertEquals(type, gameObject.getAttributeInt("type")); + Assert.assertEquals(type, gameObject.getAttributeInt(BaseObject.TYPE)); } /** - * Checks that caching the "name" attribute does work. + * Checks that caching the {@link BaseObject#NAME} attribute does work. */ @Test public void testName1() { @@ -331,16 +330,16 @@ final TestArchetype archetype = newArchetype("arch", null, faceObjectProviders, animationObjects); final BaseObject<?, ?, ?, ?> gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); checkName(gameObject, "arch", ""); - gameObject.setAttributeString("name", "3"); + gameObject.setAttributeString(BaseObject.NAME, "3"); checkName(gameObject, "3", "3"); - gameObject.removeAttribute("name"); + gameObject.removeAttribute(BaseObject.NAME); checkName(gameObject, "arch", ""); gameObject.setObjectText("name 3"); checkName(gameObject, "3", "3"); } /** - * Checks that caching the "name" attribute does work. + * Checks that caching the {@link BaseObject#NAME} attribute does work. */ @Test public void testName2() { @@ -349,14 +348,14 @@ final TestArchetype archetype = newArchetype("arch", "name 2", faceObjectProviders, animationObjects); final BaseObject<?, ?, ?, ?> gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); checkName(gameObject, "2", "2"); - gameObject.setAttributeString("name", "3"); + gameObject.setAttributeString(BaseObject.NAME, "3"); checkName(gameObject, "3", "3"); - gameObject.removeAttribute("name"); + gameObject.removeAttribute(BaseObject.NAME); checkName(gameObject, "2", "2"); } /** - * Checks that caching the "name" attribute does work. + * Checks that caching the {@link BaseObject#NAME} attribute does work. */ @Test public void testName3() { @@ -368,24 +367,24 @@ checkName(gameObject, "1", "1"); gameObject.setArchetype(archetype2); checkName(gameObject, "2", "2"); - gameObject.setAttributeString("name", "4"); + gameObject.setAttributeString(BaseObject.NAME, "4"); checkName(gameObject, "4", "4"); gameObject.setArchetype(archetype1); checkName(gameObject, "4", "4"); - gameObject.removeAttribute("name"); + gameObject.removeAttribute(BaseObject.NAME); checkName(gameObject, "1", "1"); } /** - * Checks that the "name" attribute of an {@link GameObject} contains the - * expected value. + * Checks that the {@link BaseObject#NAME} attribute of an {@link + * GameObject} contains the expected value. * @param gameObject the game object to check * @param name the expected name (cached value) * @param nameAttribute the expected name ("name" attribute) */ private static void checkName(@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final String name, @NotNull final String nameAttribute) { Assert.assertEquals(name, gameObject.getObjName()); - Assert.assertEquals(nameAttribute, gameObject.getAttributeString("name")); + Assert.assertEquals(nameAttribute, gameObject.getAttributeString(BaseObject.NAME)); } /** @@ -418,7 +417,7 @@ @NotNull private static GameObject<TestGameObject, TestMapArchObject, TestArchetype> newGameObject(@NotNull final TestArchetype archetype, @NotNull final String name, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); - gameObject.setAttributeString(Archetype.NAME, name); + gameObject.setAttributeString(BaseObject.NAME, name); return gameObject; } Modified: trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/test/net/sf/gridarta/model/map/mapmodel/DefaultMapModelTest.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -30,7 +30,6 @@ import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.TestArchetype; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.autojoin.AutojoinLists; @@ -398,7 +397,7 @@ final TestArchetype archetype = new TestArchetype("arch", faceObjectProviders, animationObjects); assert animationObjects != null; final TestGameObject gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); - gameObject.setAttributeString(Archetype.NAME, objectName); + gameObject.setAttributeString(BaseObject.NAME, objectName); return gameObject; } Modified: trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-05-24 17:41:22 UTC (rev 7982) +++ trunk/src/test/net/sf/gridarta/model/match/NamedGameObjectMatcherTest.java 2010-05-24 18:03:16 UTC (rev 7983) @@ -22,8 +22,8 @@ import java.util.regex.Pattern; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DefaultAnimationObjects; -import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.ArchFaceProvider; import net.sf.gridarta.model.face.DefaultFaceObjects; import net.sf.gridarta.model.face.FaceObjectProviders; @@ -112,7 +112,7 @@ @NotNull private static TestArchetype newArchetype(@NotNull final String archetypeName, final int typeNo, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) { final TestArchetype archetype = new TestArchetype(archetypeName, faceObjectProviders, animationObjects); - archetype.setAttributeString(Archetype.TYPE, Integer.toString(typeNo)); + archetype.setAttributeString(BaseObject.TYPE, Integer.toString(typeNo)); return archetype; } @@ -126,7 +126,7 @@ @NotNull private static TestGameObject newGameObject(@NotNull final TestGameObjectFactory gameObjectFactory, @NotNull final TestArchetype archetype, @NotNull final String gameObjectName) { final TestGameObject gameObject = gameObjectFactory.createGameObject(archetype); - gameObject.setAttributeString(Archetype.NAME, gameObjectName); + gameObject.setAttributeString(BaseObject.NAME, gameObjectName); return gameObject; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-05-24 18:42:54
|
Revision: 7985 http://gridarta.svn.sourceforge.net/gridarta/?rev=7985&view=rev Author: akirschbaum Date: 2010-05-24 18:42:47 +0000 (Mon, 24 May 2010) Log Message: ----------- Fix checkstyle issues. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeField.java trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java trunk/src/app/net/sf/gridarta/mainactions/MainActions.java trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java trunk/src/app/net/sf/gridarta/preferences/Storage.java trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/utils/IOUtils.java Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/validation/checks/NonAbsoluteExitPathChecker.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -27,7 +27,6 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.validation.AbstractValidator; import net.sf.gridarta.validation.GameObjectValidator; -import net.sf.gridarta.validation.MapValidator; import net.sf.gridarta.validation.checks.NonAbsoluteExitPathError; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; @@ -35,8 +34,9 @@ import org.jetbrains.annotations.NotNull; /** - * A {@link MapValidator} that checks for relative exit paths within unique - * maps. Such paths do not work reliably in Crossfire and Atrinik. + * A {@link net.sf.gridarta.validation.MapValidator} that checks for relative + * exit paths within unique maps. Such paths do not work reliably in Crossfire + * and Atrinik. * @author Andreas Kirschbaum */ public class NonAbsoluteExitPathChecker extends AbstractValidator implements GameObjectValidator<GameObject, MapArchObject, Archetype> { Modified: trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/delayedmapmodel/DelayedMapModelListenerManager.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -153,7 +153,7 @@ try { final Map<MapModel<G, A, R>, Void> mapModels = new IdentityHashMap<MapModel<G, A, R>, Void>(); while (!Thread.currentThread().isInterrupted()) { - for (; ;) { + while (true) { final long now = System.currentTimeMillis(); synchronized (sync) { if (timeout == 0L) { Modified: trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/filter/MenuItemCreator.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -21,7 +21,6 @@ import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; -import net.sf.gridarta.model.filter.Filter; import net.sf.gridarta.model.filter.FilterConfig; import net.sf.gridarta.model.filter.FilterConfigVisitor; import net.sf.gridarta.model.filter.NamedFilterConfig; @@ -32,7 +31,7 @@ import org.jetbrains.annotations.Nullable; /** - * Creates menu items for {@link Filter} instances. + * Creates menu items for {@link net.sf.gridarta.model.filter.Filter} instances. * @author tchize * @author Andreas Kirschbaum */ Modified: trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/map/mapactions/MapActions.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -501,7 +501,7 @@ */ @ActionMethod public boolean isTileShow() { - return doTileShow(false, false) && false; // XXX: not yet implemented + return /*doTileShow(false, false) && */false; // XXX: not yet implemented } /** Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -106,7 +106,7 @@ int indent = 0; if (arch != null) { - for (; ;) { + while (true) { final GameObject<G, A, R> env = arch.getContainerGameObject(); if (env == null) { break; Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeField.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeField.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeField.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -21,7 +21,6 @@ import java.awt.event.KeyEvent; import java.awt.event.KeyListener; -import javax.swing.JComponent; import javax.swing.JTextField; import javax.swing.KeyStroke; import net.sf.gridarta.utils.EventListenerList2; @@ -29,7 +28,7 @@ import org.jetbrains.annotations.Nullable; /** - * A {@link JComponent} for selecting a {@link KeyStroke}. + * A {@link javax.swing.JComponent} for selecting a {@link KeyStroke}. * @author Andreas Kirschbaum */ public class KeyStrokeField extends JTextField { Modified: trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/spells/SpellsUtils.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -136,7 +136,7 @@ readUntil(in, "{", null); int counter = 0; - for (; ;) { + while (true) { readUntil(in, "{", "}"); readUntil(in, "\"", null); final String name = readUntil(in, "\"").trim(); Modified: trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -80,7 +80,7 @@ * @param menu the menu to remove the entries from */ public static void removeAllToSeparator(final JMenu menu) { - for (; ;) { + while (true) { final Component menuItem = menu.getMenuComponent(0); if (menuItem == null || menuItem instanceof JSeparator) { break; Modified: trunk/src/app/net/sf/gridarta/mainactions/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/mainactions/MainActions.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -1537,7 +1537,7 @@ */ private int getFillDensity(@NotNull final String title) { String input = "100"; - for (; ;) { + while (true) { input = (String) JOptionPane.showInputDialog(parent, "Enter a fill density between 1-100", title, JOptionPane.QUESTION_MESSAGE, null, null, input); if (input == null) { return -1; Modified: trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/maincontrol/GridartaEditor.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -154,7 +154,7 @@ final Getopt g = new Getopt("testprog", args, "bchns", longopts); Mode mode = Mode.NORMAL; boolean doExit = true; - for (; ;) { + while (true) { final int ch = g.getopt(); if (ch == -1) { break; Modified: trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/mapfiles/MapFolder.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -184,7 +184,7 @@ * @param deleteFile if set, also remove the map file */ public void removeAllPickmaps(final boolean deleteFile) { - for (; ;) { + while (true) { final MapFile<G, A, R> mapFile; synchronized (sync) { if (mapFiles.isEmpty()) { Modified: trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/mapmanager/DefaultFileControl.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -276,7 +276,7 @@ @ActionMethod @Override public boolean closeAllMaps() { - for (; ;) { + while (true) { final MapControl<G, A, R> mapControl = mapManager.getOpenMap(); if (mapControl == null) { break; Modified: trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -344,7 +344,7 @@ } int size = 0; // read size ' ' - for (; ;) { + while (true) { final char c = (char) data[offset++]; // XXX: do not cast from byte to char if (c == ' ') { break; @@ -357,7 +357,7 @@ } faceB.setLength(0); // read facename '\n' - for (; ;) { + while (true) { final char c = (char) data[offset++]; // XXX: do not cast from byte to char if (c == '\n') { break; @@ -423,7 +423,7 @@ final InputStream inputStream = new FileInputStream(file); try { final byte[] buf = new byte[CHUNK_SIZE]; - for (; ;) { + while (true) { final int len = inputStream.read(buf); if (len == -1) { break; Modified: trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -102,7 +102,7 @@ // read the whole file line by line boolean hasErrors = false; - for (; ;) { + while (true) { final String inputLine = lnr.readLine(); if (inputLine == null) { break; Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -112,7 +112,7 @@ final G gameObject = gameObjectFactory.newGameObject(archName); boolean msgflag = false; - for (; ;) { + while (true) { final String thisLine2 = reader.readLine(); if (thisLine2 == null) { throw new IOException("unexpected end of file while reading 'arch " + archName + "'"); Modified: trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/model/io/AbstractMapArchObjectParser.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -43,7 +43,7 @@ int height = 0; boolean archflag = false; // flag for arch<->end boolean msgflag = false; // flag for map-message - for (; ;) { + while (true) { final String tmp = reader.readLine(); if (tmp == null) { throw new IOException("unexpected end of file in map header"); Modified: trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureLoader.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -108,7 +108,8 @@ final List<TreasureTreeNode> needLink = new ArrayList<TreasureTreeNode>(); // all sub-treasurelist nodes that need linking // first step: parsing datafile, adding all treasurelists to the tmpList vector - for (int index = 0; ; index++) { + int index = 0; + while (true) { final File treasureLocation; try { treasureLocation = configSource.getFile(globalSettings, "treasures", index); @@ -130,6 +131,7 @@ if (log.isInfoEnabled()) { log.info("Loaded " + (tmpList.size() - tmpListSize) + " treasurelists from '" + treasureLocation + "'."); } + index++; } return createTreasureTree(tmpList, needLink, specialTreasureLists); @@ -217,7 +219,7 @@ try { final BufferedReader bufferedReader = new BufferedReader(reader); try { - for (; ;) { + while (true) { final String rawLine = bufferedReader.readLine(); if (rawLine == null) { break; @@ -295,7 +297,7 @@ boolean insideArch = false; - for (; ;) { + while (true) { final String rawLine = reader.readLine(); if (rawLine == null) { break; Modified: trunk/src/app/net/sf/gridarta/preferences/Storage.java =================================================================== --- trunk/src/app/net/sf/gridarta/preferences/Storage.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/preferences/Storage.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -275,7 +275,7 @@ String path = defaultPath; final LineNumberReader lnr = new LineNumberReader(isr); try { - for (; ;) { + while (true) { final String line2 = lnr.readLine(); if (line2 == null) { break; Modified: trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/resource/AbstractResourcesReader.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -222,7 +222,7 @@ @NotNull private static Map<String, String> loadAnimTree(@NotNull final BufferedReader reader) throws IOException { final Map<String, String> animations = new HashMap<String, String>(); - for (; ;) { + while (true) { final String line = reader.readLine(); if (line == null) { break; Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -128,7 +128,7 @@ final BufferedReader bufferedReader = new BufferedReader(reader); try { // read file into the cmdList vector: - for (; ;) { + while (true) { final String inputLine = bufferedReader.readLine(); if (inputLine == null) { break; Modified: trunk/src/app/net/sf/gridarta/utils/IOUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/IOUtils.java 2010-05-24 18:09:49 UTC (rev 7984) +++ trunk/src/app/net/sf/gridarta/utils/IOUtils.java 2010-05-24 18:42:47 UTC (rev 7985) @@ -137,7 +137,7 @@ final FileOutputStream outputStream = new FileOutputStream(tmpFile); try { final byte[] buf = new byte[65536]; - for (; ;) { + while (true) { final int len = bufferedInputStream.read(buf); if (len == -1) { break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |