You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2010-05-24 12:41:34
|
Revision: 7961 http://gridarta.svn.sourceforge.net/gridarta/?rev=7961&view=rev Author: akirschbaum Date: 2010-05-24 12:41:28 +0000 (Mon, 24 May 2010) Log Message: ----------- Add comment. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java Modified: trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java 2010-05-24 12:17:16 UTC (rev 7960) +++ trunk/src/app/net/sf/gridarta/model/archetypetype/ArchetypeAttributeDefinition.java 2010-05-24 12:41:28 UTC (rev 7961) @@ -23,7 +23,8 @@ import org.jetbrains.annotations.NotNull; /** - * Holds the key/value pair of an archetype attribute definition. + * Holds the key/value pair of an archetype attribute definition. Corresponds to + * a <attribute> entry in types.xml * @author Andreas Kirschbaum */ public class ArchetypeAttributeDefinition { 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 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 00:04:19
|
Revision: 7957 http://gridarta.svn.sourceforge.net/gridarta/?rev=7957&view=rev Author: akirschbaum Date: 2010-05-24 00:04:13 +0000 (Mon, 24 May 2010) Log Message: ----------- Remove unused class. Removed Paths: ------------- trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java Deleted: trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java 2010-05-24 00:03:13 UTC (rev 7956) +++ trunk/src/app/net/sf/gridarta/model/gameobject/IsArchetypeException.java 2010-05-24 00:04:13 UTC (rev 7957) @@ -1,64 +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.gameobject; - -import net.sf.gridarta.model.baseobject.BaseObject; -import org.jetbrains.annotations.NotNull; - -/** - * This exception is thrown in case a method of {@link GameObject} was invoked - * that must not be used for those GameObjects which are Archetypes. This - * exception is currently needed because of a design flaw: Currently Archetypes - * are GameObjects, but they shouldn't. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class IsArchetypeException extends IllegalStateException { - - /** - * The serial version UID. - */ - private static final long serialVersionUID = 1L; - - /** - * The {@link GameObject} that is an {@link net.sf.gridarta.model.archetype.Archetype}. - * @serial - */ - @NotNull - private final BaseObject<?, ?, ?, ?> archetype; - - /** - * Create an IsArchetypeException. - * @param archetype The GameObject that is an Archetype. - */ - public IsArchetypeException(@NotNull final BaseObject<?, ?, ?, ?> archetype) { - super(archetype.toString()); - this.archetype = archetype; - } - - /** - * Returns the GameObject that is an Archetype. - * @return The GameObject that is an Archetype. - */ - @NotNull - public BaseObject<?, ?, ?, ?> getArchetype() { - return archetype; - } - -} // class IsArchetypeException 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-23 23:51:05
|
Revision: 7955 http://gridarta.svn.sourceforge.net/gridarta/?rev=7955&view=rev Author: akirschbaum Date: 2010-05-23 23:50:59 +0000 (Sun, 23 May 2010) Log Message: ----------- Do not create multiple empty arrays. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java 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:48:45 UTC (rev 7954) +++ trunk/src/app/net/sf/gridarta/gui/prefs/GUIPrefs.java 2010-05-23 23:50:59 UTC (rev 7955) @@ -75,6 +75,12 @@ private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); /** + * An empty <code>String</code> array. + */ + @NotNull + private static final String[] EMPTY_STRING_ARRAY = new String[0]; + + /** * The {@link GlobalSettings} to use. */ @NotNull @@ -176,7 +182,7 @@ final Container lineLayout = Box.createHorizontalBox(); final CharSequence availableLocales = ACTION_BUILDER.getString("availableLocales"); - final String[] locNames = availableLocales != null ? StringUtils.PATTERN_WHITESPACE.split(availableLocales, 0) : new String[0]; + final String[] locNames = availableLocales != null ? StringUtils.PATTERN_WHITESPACE.split(availableLocales, 0) : EMPTY_STRING_ARRAY; locales = new Locale[locNames.length + 1]; // locales[0] is intentionally null. It will be displayed as default and always get sorted to the top. for (int i = 0; i < locNames.length; i++) { 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: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-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:01:47
|
Revision: 7952 http://gridarta.svn.sourceforge.net/gridarta/?rev=7952&view=rev Author: akirschbaum Date: 2010-05-23 23:01:41 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/GList.java 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:00:41 UTC (rev 7951) +++ trunk/src/app/net/sf/gridarta/gui/utils/GList.java 2010-05-23 23:01:41 UTC (rev 7952) @@ -21,7 +21,6 @@ import java.awt.Rectangle; import java.awt.event.MouseEvent; -import java.util.Vector; import javax.swing.JList; import javax.swing.ListModel; import org.jetbrains.annotations.NotNull; @@ -47,12 +46,6 @@ private ToolTipProvider<T> toolTipProvider = null; /** - * Creates a new instance with an empty, read-only list model. - */ - public GList() { - } - - /** * Creates a new instance. * @param dataModel the data model */ @@ -61,22 +54,6 @@ } /** - * Creates a new instance. - * @param listData the data to load into the list model - */ - public GList(@NotNull final T[] listData) { - super(listData); - } - - /** - * Creates a new instance. - * @param listData the data to load into the list model - */ - public GList(@NotNull final Vector<? extends T> listData) { - super(listData); - } - - /** * Sets or clears the {@link ToolTipProvider}. * @param toolTipProvider the tool tip provider to set or <code>null</code> * to clear the tool tip provider 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:00:47
|
Revision: 7951 http://gridarta.svn.sourceforge.net/gridarta/?rev=7951&view=rev Author: akirschbaum Date: 2010-05-23 23:00:41 +0000 (Sun, 23 May 2010) Log Message: ----------- Properly suppress compiler warnings. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/connectionview/View.java trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchParameterView.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/gui/utils/GList.java trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypeChooserView.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -245,8 +245,9 @@ @NotNull private ArchetypePanel<G, A, R> getArchetypePanel(final int index) { //JTabbedPane does not use type parameters - //noinspection unchecked - return (ArchetypePanel<G, A, R>) tabDesktop.getComponentAt(index); + @SuppressWarnings({ "unchecked" }) + final ArchetypePanel<G, A, R> archetypePanel = (ArchetypePanel<G, A, R>) tabDesktop.getComponentAt(index); + return archetypePanel; } /** Modified: trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/archetypechooser/ArchetypePanel.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -250,7 +250,7 @@ */ @Nullable public R getSelectedArchetype() { - return (R) archetypeList.getSelectedValue(); + return archetypeList.getSelectedValue(); } /** @@ -270,7 +270,10 @@ */ @Nullable private ArchetypeChooserFolder<G, A, R> getSelectedFolder() { - return (ArchetypeChooserFolder<G, A, R>) folders.getSelectedItem(); + //JComboBox does not use type parameters + @SuppressWarnings({ "unchecked" }) + final ArchetypeChooserFolder<G, A, R> selectedFolder = (ArchetypeChooserFolder<G, A, R>) folders.getSelectedItem(); + return selectedFolder; } /** Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/CellRenderer.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -56,7 +56,7 @@ super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); //DefaultListCellRenderer does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final Connection<K> connection = (Connection<K>) value; sbForFormat.setLength(0); Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/View.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/View.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/View.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -199,8 +199,9 @@ final Collection<Connection<K>> result = new ArrayList<Connection<K>>(); for (final Object selection : connectionList.getSelectedValues()) { //JList does not use type parameters - //noinspection unchecked - result.add((Connection<K>) selection); + @SuppressWarnings({ "unchecked" }) + final Connection<K> connection = (Connection<K>) selection; + result.add(connection); } return result; } Modified: trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/mapdesktop/MapDesktop.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -180,7 +180,7 @@ @Override public void internalFrameActivated(@NotNull final InternalFrameEvent e) { //InternalFrameEvent does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final MapView<G, A, R> mapView = (MapView<G, A, R>) e.getSource(); mapViewFocusGainedNotify(mapView); } @@ -195,8 +195,9 @@ @Override public void internalFrameClosing(@NotNull final InternalFrameEvent e) { //InternalFrameEvent does not use type parameters - //noinspection unchecked - mapViewsManager.closeMapView((MapView<G, A, R>) e.getInternalFrame()); + @SuppressWarnings({ "unchecked" }) + final MapView<G, A, R> mapView = (MapView<G, A, R>) e.getInternalFrame(); + mapViewsManager.closeMapView(mapView); } /** {@inheritDoc} */ @@ -215,7 +216,7 @@ @Override public void internalFrameIconified(@NotNull final InternalFrameEvent e) { //InternalFrameEvent does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final MapView<G, A, R> mapView = (MapView<G, A, R>) e.getSource(); mapViewFocusLostNotify(mapView); } Modified: trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/prefs/NetPrefs.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -161,8 +161,9 @@ @Override public void apply() { //JComboBox does not use type parameters - //noinspection unchecked - PREFS.put(NET_PREFS_KEY_TYPE, ((Enum<Proxy.Type>) proxyType.getSelectedItem()).name()); + @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()); } Modified: trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/script/ScriptManager.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -162,8 +162,9 @@ public void valueChanged(final ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { //JList does not use type parameters - //noinspection unchecked - showScript((Script<G, A, R>) scripts.getSelectedValue()); + @SuppressWarnings({ "unchecked" }) + final Script<G, A, R> script = (Script<G, A, R>) scripts.getSelectedValue(); + showScript(script); } } }); @@ -191,7 +192,7 @@ @Override public void actionPerformed(final ActionEvent e) { //JList does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final Script<G, A, R> script = (Script<G, A, R>) scripts.getSelectedValue(); if (script == null) { return; Modified: trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchParameterView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchParameterView.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/script/parameter/ArchParameterView.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -56,8 +56,9 @@ public void itemStateChanged(final ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { //JComboBox does not use type parameters - //noinspection unchecked - parameter.setValue((Archetype<G, A, R>) value.getSelectedItem()); + @SuppressWarnings({ "unchecked" }) + final Archetype<G, A, R> archetype = (Archetype<G, A, R>) value.getSelectedItem(); + parameter.setValue(archetype); } } }); Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/CellRenderer.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -77,7 +77,7 @@ super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); //DefaultListCellRenderer does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) GameObject<G, A, R> arch = (GameObject<G, A, R>) value; // arch == null should not happen, but it *can* happen when the active Modified: trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/selectedsquare/SelectedSquareView.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -421,9 +421,13 @@ @Nullable G getListGameObject(final int index) { final int actualIndex = getValidIndex(index); - //DefaultListModel does not use type parameters - //noinspection unchecked - return actualIndex < model.getSize() ? (G) model.getElementAt(actualIndex) : null; + if (actualIndex >= model.getSize()) { + return null; + } + + @SuppressWarnings({ "unchecked" }) + final G gameObject = (G) model.getElementAt(actualIndex); + return gameObject; } /** @@ -464,8 +468,9 @@ list.setSelectedIndex(actualIndex); } //JList does not use type parameters - //noinspection unchecked - selectedSquareModel.setSelectedGameObject((G) list.getSelectedValue(), actualIndex); + @SuppressWarnings({ "unchecked" }) + final G gameObject = (G) list.getSelectedValue(); + selectedSquareModel.setSelectedGameObject(gameObject, actualIndex); } /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/GList.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/GList.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/gui/utils/GList.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -102,7 +102,7 @@ } //JList does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final T element = (T) getModel().getElementAt(index); if (toolTipProvider == null) { @@ -111,4 +111,14 @@ return toolTipProvider.getToolTipText(element); } + /** + * {@inheritDoc} + */ + @Override + public T getSelectedValue() { + @SuppressWarnings({ "unchecked" }) + final T selectedValue = (T) super.getSelectedValue(); + return selectedValue; + } + } // class GList Modified: trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/model/filter/FilterParser.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -107,8 +107,8 @@ filterConfig.setEnabled(enabled); filterConfig.setInverted(Boolean.valueOf(value.getChildTextTrim("inverted"))); //Element does not use type parameters - //noinspection unchecked - final Iterable<Element> it = value.getChildren("subfilter"); + @SuppressWarnings({ "unchecked" }) + final Iterable<Element> it = (Iterable<Element>) value.getChildren("subfilter"); for (final Element filterElement : it) { final String name = filterElement.getChildTextTrim("name"); final FilterConfig<?, ?> subFilterConfig = filterConfig.getConfig(name); @@ -132,8 +132,8 @@ final boolean enabled = Boolean.valueOf(value.getChildTextTrim("enabled")); filterConfig.setEnabled(enabled); //Element does not use type parameters - //noinspection unchecked - final Iterable<Element> properties = value.getChildren("property"); + @SuppressWarnings({ "unchecked" }) + final Iterable<Element> properties = (Iterable<Element>) value.getChildren("property"); for (final Element property : properties) { final String pName = property.getChildTextTrim("name"); final String pValue = property.getChildTextTrim("value"); Modified: trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureTreeNode.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -131,8 +131,9 @@ @Override public Enumeration<TreasureTreeNode> children() { //DefaultMutableTreeNode does not use type parameters - //noinspection unchecked - return super.children(); + @SuppressWarnings({ "unchecked" }) + final Enumeration<TreasureTreeNode> tmp = (Enumeration<TreasureTreeNode>) super.children(); + return tmp; } } // class TreasureTreeNode Modified: trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java =================================================================== --- trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java 2010-05-23 22:43:59 UTC (rev 7950) +++ trunk/src/app/net/sf/gridarta/script/ScriptModelParser.java 2010-05-23 23:00:41 UTC (rev 7951) @@ -70,7 +70,7 @@ isScript = true; } else { //Element does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final Iterable<Element> modes = mode.getChildren(); for (final Element m : modes) { final boolean b = Boolean.valueOf(m.getTextTrim()); @@ -88,7 +88,7 @@ scriptModel.setFilter(isFilter); scriptModel.setScript(isScript); //Element does not use type parameters - //noinspection unchecked + @SuppressWarnings({ "unchecked" }) final Collection<Element> params = node.getChildren("parameter"); if (params != null && !params.isEmpty()) { for (final Element parameter : params) { 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 22:37:13
|
Revision: 7949 http://gridarta.svn.sourceforge.net/gridarta/?rev=7949&view=rev Author: akirschbaum Date: 2010-05-23 22:37:07 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 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 22:35:30 UTC (rev 7948) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 2010-05-23 22:37:07 UTC (rev 7949) @@ -308,14 +308,6 @@ } /** - * returns the tab's index for ordering. - * @return the index - */ - public int getIndex() { - return index; - } - - /** * Returns the tab's size. Depending on the tab's location either width or * height is returned. * @return the size 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:35:36
|
Revision: 7948 http://gridarta.svn.sourceforge.net/gridarta/?rev=7948&view=rev Author: akirschbaum Date: 2010-05-23 22:35:30 +0000 (Sun, 23 May 2010) Log Message: ----------- Weaken type. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 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 22:30:29 UTC (rev 7947) +++ trunk/src/app/net/sf/gridarta/gui/utils/tabbedpanel/Tab.java 2010-05-23 22:35:30 UTC (rev 7948) @@ -19,6 +19,7 @@ package net.sf.gridarta.gui.utils.tabbedpanel; +import java.awt.Component; import java.awt.Dimension; import java.awt.Insets; import java.awt.event.MouseAdapter; @@ -249,11 +250,11 @@ } /** - * Returs the {@link JComponent} that is shown when this tab is active. + * Returns the {@link Component} that is shown when this tab is active. * @return the component */ @NotNull - public JComponent getComponent() { + public Component getComponent() { return component; } 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:28:32
|
Revision: 7946 http://gridarta.svn.sourceforge.net/gridarta/?rev=7946&view=rev Author: akirschbaum Date: 2010-05-23 22:28:25 +0000 (Sun, 23 May 2010) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 22:27:09 UTC (rev 7945) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 22:28:25 UTC (rev 7946) @@ -111,13 +111,13 @@ * The map x position if on map. * @serial */ - private int mapx = 0; + private int mapX = 0; /** * The map y position if on map. * @serial */ - private int mapy = 0; + private int mapY = 0; /** * Data for multi-square-arches. Stays <code>null</code> for @@ -530,7 +530,7 @@ */ @Override public int getMapX() { - return mapx; + return mapX; } /** @@ -538,23 +538,23 @@ */ @Override public int getMapY() { - return mapy; + return mapY; } /** * {@inheritDoc} */ @Override - public void setMapX(final int mapx) { - this.mapx = mapx; + public void setMapX(final int mapX) { + this.mapX = mapX; } /** * {@inheritDoc} */ @Override - public void setMapY(final int mapy) { - this.mapy = mapy; + public void setMapY(final int mapY) { + this.mapY = mapY; } /** 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:27:09 UTC (rev 7945) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 22:28:25 UTC (rev 7946) @@ -267,14 +267,14 @@ * @param mapx x coordinate * @warning Only use this method during the load process. */ - void setMapX(int mapx); + void setMapX(int mapX); /** * Set the Y coordinate of this GameObject on its map. * @param mapy y coordinate * @warning Only use this method during the load process. */ - void setMapY(int mapy); + void setMapY(int mapY); /** * Returns whether this object is a single-part object or the head of the 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:27:15
|
Revision: 7945 http://gridarta.svn.sourceforge.net/gridarta/?rev=7945&view=rev Author: akirschbaum Date: 2010-05-23 22:27:09 +0000 (Sun, 23 May 2010) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java Modified: trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-05-23 22:22:32 UTC (rev 7944) +++ trunk/src/app/net/sf/gridarta/gui/map/mapview/MapViewsManager.java 2010-05-23 22:27:09 UTC (rev 7945) @@ -221,16 +221,6 @@ } /** - * Returns the current view positions of all views of a {@link MapControl}. - * @param mapControl the map control - * @return the current view positions of all views - */ - @NotNull - public Point[] getViewPositions(@NotNull final MapControl<G, A, R> mapControl) { - return getMapViewsInt(mapControl).getViewPositions(); - } - - /** * Closes a view of a {@link MapControl}. * @param mapView the view to be closed */ 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 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 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 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 17:26:16
|
Revision: 7940 http://gridarta.svn.sourceforge.net/gridarta/?rev=7940&view=rev Author: akirschbaum Date: 2010-05-23 17:26:10 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{is,set}Artifact() to Archetype. Modified Paths: -------------- 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 Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 17:22:57 UTC (rev 7939) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 17:26:10 UTC (rev 7940) @@ -82,6 +82,15 @@ private String editorFolder = null; /** + * If this flag is set, this Archetype is not a "real" Archetype but comes + * from the artifacts file. Such Archetypes instances are not included in + * the Archetype collection process, since the artifacts file is the same + * for editor and server. + * @serial + */ + private boolean artifact = false; + + /** * Creates a new instance. * @param archetypeName the name of the archetype * @param faceObjectProviders the face object providers for looking up @@ -310,4 +319,20 @@ this.editorFolder = editorFolder; } + /** + * {@inheritDoc} + */ + @Override + public boolean isArtifact() { + return artifact; + } + + /** + * {@inheritDoc} + */ + @Override + public void setArtifact(final boolean artifact) { + this.artifact = artifact; + } + } // 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 17:22:57 UTC (rev 7939) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 17:26:10 UTC (rev 7940) @@ -157,4 +157,20 @@ */ void setEditorFolder(@Nullable String editorFolder); + /** + * Returns whether this GameObject is an Artifact. Artifacts are special + * forms of Archetypes, and they are excluded from Archetypes collection. + * @return <code>true</code> if this GameObject is an Artifact, otherwise + * <code>false</code>. + */ + boolean isArtifact(); + + /** + * Sets whether this GameObject is an Artifact. + * @param artifact <code>true</code> if this GameObject is an Artifact, + * otherwise <code>false</code>. + * @see #isArtifact() + */ + void setArtifact(boolean artifact); + } // 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 17:22:57 UTC (rev 7939) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 17:26:10 UTC (rev 7940) @@ -84,15 +84,6 @@ private ImageIcon normalFace = null; /** - * If this flag is set, this Archetype is not a "real" Archetype but comes - * from the artifacts file. Such Archetypes instances are not included in - * the Archetype collection process, since the artifacts file is the same - * for editor and server. - * @serial - */ - private boolean artifact = false; - - /** * The {@link FaceObjectProviders} for looking up faces. */ @NotNull @@ -462,31 +453,6 @@ * {@inheritDoc} */ @Override - public boolean isArtifact() { - return artifact; - } - - /** - * {@inheritDoc} - */ - @Override - public void setArtifact(final boolean artifact) { - if (this.artifact == artifact) { - return; - } - - beginGameObjectChange(); - try { - this.artifact = artifact; - } finally { - endGameObjectChange(); - } - } - - /** - * {@inheritDoc} - */ - @Override public int getEditType() { return editType; } @@ -847,7 +813,7 @@ @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())) && (faceName == null || faceName.equals(archetype.getFaceName())) && (animName == null || animName.equals(archetype.getAnimName())) && typeNo == archetype.getTypeNo(); + return archetype != null && getArchetypeName().equals(archetype.getArchetypeName()) && objName.equals(archetype.getObjName()) && !gameObjectText.hasObjectText() && (msgText == null || msgText.toString().equals(archetype.getMsgText())) && (faceName == null || faceName.equals(archetype.getFaceName())) && (animName == null || animName.equals(archetype.getAnimName())) && typeNo == archetype.getTypeNo(); } /** @@ -862,7 +828,6 @@ return hasSameContents(abstractBaseObject) && (abstractBaseObject.faceObjName == null ? faceObjName == null : abstractBaseObject.faceObjName.equals(faceObjName)) // ignore "faceObjSource" // ignore "normalFace" - && abstractBaseObject.artifact == artifact // ignore "container" && abstractBaseObject.getArchetype() == getArchetype() && abstractBaseObject.getArchetypeName().equals(getArchetypeName()) && abstractBaseObject.objName.equals(objName) && abstractBaseObject.gameObjectText.equals(gameObjectText) && (abstractBaseObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(abstractBaseObject.msgText.toString())) // ignore "mapx" Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 17:22:57 UTC (rev 7939) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 17:26:10 UTC (rev 7940) @@ -213,22 +213,6 @@ boolean hasSameArchetype(@NotNull G other); /** - * Returns whether this GameObject is an Artifact. Artifacts are special - * forms of Archetypes, and they are excluded from Archetypes collection. - * @return <code>true</code> if this GameObject is an Artifact, otherwise - * <code>false</code>. - */ - boolean isArtifact(); - - /** - * Sets whether this GameObject is an Artifact. - * @param artifact <code>true</code> if this GameObject is an Artifact, - * otherwise <code>false</code>. - * @see #isArtifact() - */ - void setArtifact(boolean artifact); - - /** * Returns the edit type. * @return edit 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 17:23:04
|
Revision: 7939 http://gridarta.svn.sourceforge.net/gridarta/?rev=7939&view=rev Author: akirschbaum Date: 2010-05-23 17:22:57 +0000 (Sun, 23 May 2010) Log Message: ----------- Move BaseObject.{get,set}EditorFolder() to Archetype. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.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 Modified: trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-05-23 17:08:19 UTC (rev 7938) +++ trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java 2010-05-23 17:22:57 UTC (rev 7939) @@ -159,7 +159,7 @@ @NotNull @Override public Object getValueAt(final int rowIndex, final int columnIndex) { - final BaseObject<G, A, R, ?> archetype = archetypes.get(sorting[rowIndex]); + final Archetype<G, A, R> archetype = archetypes.get(sorting[rowIndex]); switch (columnIndex) { case 0: return archetype.getBestName(); Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 17:08:19 UTC (rev 7938) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-05-23 17:22:57 UTC (rev 7939) @@ -75,6 +75,13 @@ private int multiPartNr = 0; /** + * The location in the archetype selector. + * @serial + */ + @Nullable + private String editorFolder = null; + + /** * Creates a new instance. * @param archetypeName the name of the archetype * @param faceObjectProviders the face object providers for looking up @@ -286,4 +293,21 @@ this.multiPartNr = multiPartNr; } + /** + * {@inheritDoc} + */ + @Nullable + @Override + public String getEditorFolder() { + return editorFolder; + } + + /** + * {@inheritDoc} + */ + @Override + public void setEditorFolder(@Nullable final String editorFolder) { + this.editorFolder = editorFolder; + } + } // 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 17:08:19 UTC (rev 7938) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-05-23 17:22:57 UTC (rev 7939) @@ -24,6 +24,7 @@ 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; /** * Reflects an Archetype. This interface is part of extracting the Archetype @@ -143,4 +144,17 @@ void setMultiPartNr(int multiPartNr); + /** + * Returns the editor folder. + * @return the editor folder + */ + @Nullable + String getEditorFolder(); + + /** + * Set the editor folder. + * @param editorFolder the editor folder + */ + void setEditorFolder(@Nullable String editorFolder); + } // 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 17:08:19 UTC (rev 7938) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-05-23 17:22:57 UTC (rev 7939) @@ -149,13 +149,6 @@ private int editType = GUIConstants.EDIT_TYPE_NONE; /** - * The location in the archetype selector. - * @serial - */ - @Nullable - private String editorFolder = null; - - /** * The name of the face. Object face name <code>face * <var>name</var></code>. * @serial @@ -854,7 +847,7 @@ @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())) && (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())) && (faceName == null || faceName.equals(archetype.getFaceName())) && (animName == null || animName.equals(archetype.getAnimName())) && typeNo == archetype.getTypeNo(); } /** @@ -877,30 +870,13 @@ // ignore "attributeCache" // 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; + && (abstractBaseObject.faceName == null ? faceName == null : abstractBaseObject.faceName.equals(faceName)) && (abstractBaseObject.animName == null ? animName == null : abstractBaseObject.animName.equals(animName)) && abstractBaseObject.typeNo == typeNo && abstractBaseObject.direction == direction; } /** * {@inheritDoc} */ - @Nullable @Override - public String getEditorFolder() { - return editorFolder; - } - - /** - * {@inheritDoc} - */ - @Override - public void setEditorFolder(@Nullable final String editorFolder) { - this.editorFolder = editorFolder; - } - - /** - * {@inheritDoc} - */ - @Override public int getDirection() { return 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 17:08:19 UTC (rev 7938) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-05-23 17:22:57 UTC (rev 7939) @@ -438,19 +438,6 @@ boolean isEqual(@NotNull T gameObject); /** - * Returns the editor folder. - * @return the editor folder - */ - @Nullable - String getEditorFolder(); - - /** - * Set the editor folder. - * @param editorFolder the editor folder - */ - void setEditorFolder(@Nullable String editorFolder); - - /** * Returns the direction of this Archetype or GameObject. * @return The direction of this Archetype or 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: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 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 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. |