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-06-05 00:43:36
|
Revision: 8110 http://gridarta.svn.sourceforge.net/gridarta/?rev=8110&view=rev Author: akirschbaum Date: 2010-06-05 00:43:30 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Add transient modifiers. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.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-06-05 00:41:45 UTC (rev 8109) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -50,7 +50,7 @@ * The {@link ArchetypeTypeSet} for looking up archetype types. */ @NotNull - private final ArchetypeTypeSet archetypeTypeSet; + private final transient ArchetypeTypeSet archetypeTypeSet; /** * Creates a new instance. 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-06-05 00:41:45 UTC (rev 8109) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -50,7 +50,7 @@ * The {@link ArchetypeTypeSet} for looking up archetype types. */ @NotNull - private final ArchetypeTypeSet archetypeTypeSet; + private final transient ArchetypeTypeSet archetypeTypeSet; /** * Creates a new instance. Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:41:45 UTC (rev 8109) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -88,7 +88,7 @@ * The {@link FaceObjectProviders} for looking up faces. */ @NotNull - private final FaceObjectProviders faceObjectProviders; + private final transient FaceObjectProviders faceObjectProviders; /** * The name of this object. Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:41:45 UTC (rev 8109) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:43:30 UTC (rev 8110) @@ -39,7 +39,7 @@ * The {@link FaceObjectProviders} for looking up faces. */ @NotNull - private final FaceObjectProviders faceObjectProviders; + private final transient FaceObjectProviders faceObjectProviders; /** * The transparent face. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:41:52
|
Revision: 8109 http://gridarta.svn.sourceforge.net/gridarta/?rev=8109&view=rev Author: akirschbaum Date: 2010-06-05 00:41:45 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Remove redundant code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.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 Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:36:13 UTC (rev 8108) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -60,14 +60,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:36:13 UTC (rev 8108) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -70,14 +70,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { 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-06-05 00:36:13 UTC (rev 8108) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/DefaultArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -60,14 +60,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { 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-06-05 00:36:13 UTC (rev 8108) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/UndefinedArchetype.java 2010-06-05 00:41:45 UTC (rev 8109) @@ -70,14 +70,6 @@ /** * {@inheritDoc} */ - @Override - public boolean isLowestPart() { - return true; - } - - /** - * {@inheritDoc} - */ @NotNull @Override protected Archetype getThis() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:36:19
|
Revision: 8108 http://gridarta.svn.sourceforge.net/gridarta/?rev=8108&view=rev Author: akirschbaum Date: 2010-06-05 00:36:13 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Rename variable name. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:35:47 UTC (rev 8107) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:36:13 UTC (rev 8108) @@ -976,7 +976,7 @@ } else { try { effectiveFaceObjName = animationObject.getFirstFrame(direction); - } catch (final IndexOutOfBoundsException ex) { + } catch (final IndexOutOfBoundsException ignored) { effectiveFaceObjName = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:35:54
|
Revision: 8107 http://gridarta.svn.sourceforge.net/gridarta/?rev=8107&view=rev Author: akirschbaum Date: 2010-06-05 00:35:47 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix compiler warnings. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:34:52 UTC (rev 8106) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/DefaultArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -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/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:34:52 UTC (rev 8106) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/UndefinedArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -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/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-05 00:34:52 UTC (rev 8106) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/UndefinedArchetype.java 2010-06-05 00:35:47 UTC (rev 8107) @@ -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. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:34:59
|
Revision: 8106 http://gridarta.svn.sourceforge.net/gridarta/?rev=8106&view=rev Author: akirschbaum Date: 2010-06-05 00:34:52 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix Javadoc issues. 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/gridarta.ipr trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/archetype/Archetype.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-06-05 00:30:37 UTC (rev 8105) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -30,12 +30,12 @@ /** * The <code>GameObject</code> class handles the Atrinik GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ 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-06-05 00:30:37 UTC (rev 8105) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -31,12 +31,12 @@ /** * The <code>GameObject</code> class handles the Crossfire GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ 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-06-05 00:30:37 UTC (rev 8105) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -30,12 +30,12 @@ /** * The <code>GameObject</code> class handles the Daimonin GameObjects. Usually, - * an GameObject that is really used is derived from a (replacable) default + * an GameObject that is really used is derived from a (replaceable) default * arch. * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo this class is not always the best place for multipart object handling, + * @todo this class is not always the best place for multi-part object handling, * see also {@link net.sf.gridarta.model.baseobject.GameObjectContainer} for * issues about this */ Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/gridarta.ipr 2010-06-05 00:34:52 UTC (rev 8106) @@ -1133,6 +1133,7 @@ <w>autojoin</w> <w>autojoining</w> <w>backbuffer</w> + <w>baseobject</w> <w>beanshell</w> <w>bitmask</w> <w>bitmasks</w> Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -67,11 +67,15 @@ private boolean isLowestPart = true; /** - * The shape ID of this object. + * The multi shape id. * @serial */ private int multiShapeID = 0; + /** + * The multi part id. + * @serial + */ private int multiPartNr = 0; /** Modified: trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 00:30:37 UTC (rev 8105) +++ trunk/src/app/net/sf/gridarta/model/archetype/Archetype.java 2010-06-05 00:34:52 UTC (rev 8106) @@ -33,7 +33,7 @@ * other Archetype related methods from {@link GameObject} to {@link Archetype} * and see what breaks. Then all method signatures are copied to this interface. * Once that is done we technically know what an Archetype is and can create a - * class for it. Once the Archetype classes are finnished, GameObject will no + * class for it. Once the Archetype classes are finished, GameObject will no * longer implement Archetype and we've separated Archetype from GameObject. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ @@ -126,12 +126,28 @@ */ void setLowestPart(boolean isLowestPart); + /** + * Returns the multi shape id. + * @return the multi shape id + */ int getMultiShapeID(); + /** + * Sets the multi shape id. + * @param multiShapeID the multi shape id + */ void setMultiShapeID(int multiShapeID); + /** + * Returns the multi part id. + * @return the multi part id + */ int getMultiPartNr(); + /** + * Sets the multi part id. + * @param multiPartNr the multi part id + */ void setMultiPartNr(int multiPartNr); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:30:44
|
Revision: 8105 http://gridarta.svn.sourceforge.net/gridarta/?rev=8105&view=rev Author: akirschbaum Date: 2010-06-05 00:30:37 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java Modified: trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:27:15 UTC (rev 8104) +++ trunk/src/app/net/sf/gridarta/model/archetype/AbstractArchetype.java 2010-06-05 00:30:37 UTC (rev 8105) @@ -160,6 +160,7 @@ @Override @SuppressWarnings({ "unchecked" }) public R clone() { + //noinspection OverriddenMethodCallDuringObjectConstruction final AbstractArchetype<G, A, R> clone = (AbstractArchetype<G, A, R>) super.clone(); return clone.getThis(); } Modified: trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:27:15 UTC (rev 8104) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:30:37 UTC (rev 8105) @@ -650,6 +650,7 @@ @NotNull @SuppressWarnings({ "unchecked" }) public T clone() { + //noinspection OverriddenMethodCallDuringObjectConstruction 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(); Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-05 00:27:15 UTC (rev 8104) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-05 00:30:37 UTC (rev 8105) @@ -131,6 +131,7 @@ @Override @SuppressWarnings({ "unchecked" }) public G clone() { + //noinspection OverriddenMethodCallDuringObjectConstruction final AbstractGameObject<G, A, R> clone = (AbstractGameObject<G, A, R>) super.clone(); clone.container = null; return clone.getThis(); Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:27:15 UTC (rev 8104) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-05 00:30:37 UTC (rev 8105) @@ -156,6 +156,7 @@ @Override @SuppressWarnings({ "unchecked" }) public G clone() { + //noinspection OverriddenMethodCallDuringObjectConstruction final DefaultIsoGameObject<G, A, R> clone = (DefaultIsoGameObject<G, A, R>) super.clone(); return clone.getThis(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:27:22
|
Revision: 8104 http://gridarta.svn.sourceforge.net/gridarta/?rev=8104&view=rev Author: akirschbaum Date: 2010-06-05 00:27:15 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Suppress warnings. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java Modified: trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-05 00:19:59 UTC (rev 8103) +++ trunk/src/app/net/sf/gridarta/model/gameobject/AbstractGameObject.java 2010-06-05 00:27:15 UTC (rev 8104) @@ -190,6 +190,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions return container.isTop(getThis()); } @@ -201,6 +202,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions return container.isBottom(getThis()); } @@ -212,6 +214,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.moveTop(getThis()); } @@ -223,6 +226,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.moveUp(getThis()); } @@ -234,6 +238,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.moveDown(getThis()); } @@ -245,6 +250,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.moveBottom(getThis()); } @@ -256,6 +262,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.insertBefore(node, getThis()); } @@ -267,6 +274,7 @@ if (container == null) { throw new NotInsideContainerException(getThis()); } + //noinspection ConstantConditions container.insertAfter(getThis(), node); } @@ -321,6 +329,7 @@ @Nullable @Override public G getPrev() { + //noinspection ConstantConditions return container == null ? null : container.getPrev(getThis()); } @@ -330,6 +339,7 @@ @Nullable @Override public G getNext() { + //noinspection ConstantConditions return container == null ? null : container.getNext(getThis()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:20:16
|
Revision: 8103 http://gridarta.svn.sourceforge.net/gridarta/?rev=8103&view=rev Author: akirschbaum Date: 2010-06-05 00:19:59 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix Javadoc issues. 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-06-05 00:15:48 UTC (rev 8102) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:19:59 UTC (rev 8103) @@ -169,8 +169,11 @@ */ private int direction; + /** + * The map lore. + */ @NotNull - private String loreText = ""; // lore text buffer + private String loreText = ""; /** * Creates a new instance. Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 00:15:48 UTC (rev 8102) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 00:19:59 UTC (rev 8103) @@ -239,6 +239,10 @@ */ int getEditType(); + /** + * Sets the edit type. + * @param editType the edit type + */ void setEditType(int editType); /** @@ -446,6 +450,10 @@ */ int getDirection(); + /** + * Returns the {@link FaceSource} of this base object. + * @return the face source + */ @NotNull FaceSource getFaceObjSource(); @@ -465,6 +473,10 @@ void setMulti(@NotNull MultiArchData<G, A, R, T> multi); + /** + * Returns the face name, can be from animation or face. + * @return the face name + */ @Nullable String getFaceObjName(); @@ -499,9 +511,17 @@ @NotNull T clone(); + /** + * Returns the map lore. + * @return the map lore + */ @NotNull String getLoreText(); + /** + * Sets the map lore. + * @param loreText the map lore + */ void setLoreText(@NotNull CharSequence loreText); /** @@ -514,6 +534,11 @@ @NotNull G newInstance(@NotNull GameObjectFactory<G, A, R> gameObjectFactory); + /** + * Calls the appropriate <code>visit()</code> function of a {@link + * BaseObjectVisitor}. + * @param baseObjectVisitor the base object visitor + */ void visit(@NotNull BaseObjectVisitor<G, A, R> baseObjectVisitor); } // interface BaseObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:15:59
|
Revision: 8102 http://gridarta.svn.sourceforge.net/gridarta/?rev=8102&view=rev Author: akirschbaum Date: 2010-06-05 00:15:48 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Remove unused code. 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-06-05 00:13:09 UTC (rev 8101) +++ trunk/src/app/net/sf/gridarta/model/baseobject/AbstractBaseObject.java 2010-06-05 00:15:48 UTC (rev 8102) @@ -415,17 +415,6 @@ * {@inheritDoc} */ @Override - public boolean hasSameArchetype(@NotNull final G other) { - // == is okay because only one instance of an equal Archetype exists. - // TODO will this change in the course of serialization? - //noinspection ObjectEquality - return getArchetype() == other.getArchetype(); - } - - /** - * {@inheritDoc} - */ - @Override public int getEditType() { return editType; } @@ -747,14 +736,6 @@ * {@inheritDoc} */ @Override - public boolean hasObjectText() { - return gameObjectText.hasObjectText(); - } - - /** - * {@inheritDoc} - */ - @Override public void addObjectText(@NotNull final String line) { if (line.length() <= 0) { return; Modified: trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 00:13:09 UTC (rev 8101) +++ trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java 2010-06-05 00:15:48 UTC (rev 8102) @@ -234,15 +234,6 @@ String getArchetypeName(); /** - * Check whether this GameObject has the same Archetype as another - * GameObject. - * @param other other GameObject - * @return <code>true</code> when this GameObject has the same Archetype as - * the other GameObject, otherwise <code>false</code> - */ - boolean hasSameArchetype(@NotNull G other); - - /** * Returns the edit type. * @return edit type */ @@ -423,13 +414,6 @@ String getObjectText(); /** - * Returns whether this GameObject has a set object text. - * @return <code>true</code> if this GameObject has a set object text, - * otherwise <code>false</code>. - */ - boolean hasObjectText(); - - /** * Append <var>text</var> to the object text of this GameObject. * @param line A line of text to append, may contain '\n' for appending * multiple lines. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:15:17
|
Revision: 8100 http://gridarta.svn.sourceforge.net/gridarta/?rev=8100&view=rev Author: akirschbaum Date: 2010-06-05 00:12:39 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Suppress warning. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:11:14 UTC (rev 8099) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:12:39 UTC (rev 8100) @@ -144,6 +144,7 @@ }; actions.put("pressed", action); actions.put("released", null); + //noinspection ThisEscapedInObjectConstruction SwingUtilities.replaceUIActionMap(this, actions); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:15:16
|
Revision: 8101 http://gridarta.svn.sourceforge.net/gridarta/?rev=8101&view=rev Author: akirschbaum Date: 2010-06-05 00:13:09 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/gridarta.ipr Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-06-05 00:12:39 UTC (rev 8100) +++ trunk/gridarta.ipr 2010-06-05 00:13:09 UTC (rev 8101) @@ -1146,6 +1146,7 @@ <w>facename</w> <w>filenames</w> <w>filter<?, ?></w> + <w>focusability</w> <w>formatter</w> <w>gameobject</w> <w>goto</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:11:20
|
Revision: 8099 http://gridarta.svn.sourceforge.net/gridarta/?rev=8099&view=rev Author: akirschbaum Date: 2010-06-05 00:11:14 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Do not call overridable functions from constructor. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:08:42 UTC (rev 8098) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:11:14 UTC (rev 8099) @@ -112,7 +112,7 @@ } }; - addMouseListener(mouseAdapter); + super.addMouseListener(mouseAdapter); final ActionMap actions = new ActionMapUIResource(); final Action action = new AbstractAction() { @@ -151,7 +151,7 @@ * {@inheritDoc} */ @Override - public void setModel(@NotNull final ButtonModel newModel) { + public final void setModel(@NotNull final ButtonModel newModel) { final ButtonModel oldModel = getModel(); if (oldModel instanceof TristateButtonModel) { oldModel.removeChangeListener(enableListener); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:08:50
|
Revision: 8098 http://gridarta.svn.sourceforge.net/gridarta/?rev=8098&view=rev Author: akirschbaum Date: 2010-06-05 00:08:42 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Do not ignore caught exceptions. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:05:59 UTC (rev 8097) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-05 00:08:42 UTC (rev 8098) @@ -137,7 +137,7 @@ try { return super.clone(); } catch (final CloneNotSupportedException ex) { - throw new AssertionError(); + throw new AssertionError(ex); } } Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-05 00:05:59 UTC (rev 8097) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-05 00:08:42 UTC (rev 8098) @@ -181,12 +181,12 @@ } finally { inputStream.close(); } - } catch (final FileNotFoundException e) { - log.error("File '" + url + "' not found."); - } catch (final EOFException e) { + } catch (final FileNotFoundException ex) { + log.error("File '" + url + "' not found: " + ex.getMessage()); + } catch (final EOFException ignored) { // expected exception, do not handle: end of file/spell struct reached - } catch (final IOException e) { - log.error("Cannot read file '" + url + "'!"); + } catch (final IOException ex) { + log.error("Cannot read file '" + url + "': " + ex.getMessage()); } } @@ -244,7 +244,7 @@ // insert method into the document activeTextArea.getDocument().insertString(caretPos, method, null); } catch (final BadLocationException ex) { - log.error("BadLocationException"); + log.error("BadLocationException", ex); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-05 00:06:06
|
Revision: 8097 http://gridarta.svn.sourceforge.net/gridarta/?rev=8097&view=rev Author: akirschbaum Date: 2010-06-05 00:05:59 +0000 (Sat, 05 Jun 2010) Log Message: ----------- Clean up code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java Modified: trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-04 23:58:56 UTC (rev 8096) +++ trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-05 00:05:59 UTC (rev 8097) @@ -95,33 +95,31 @@ * JDialog containing the tree. * @serial */ - private JDialog frame; + @Nullable + private JDialog frame = null; /** * The button for ok. * @serial */ - private AbstractButton okButton; + @NotNull + private final AbstractButton okButton = new JButton("Select"); /** * The button for none. * @serial */ - private AbstractButton noneButton; + @NotNull + private final AbstractButton noneButton = new JButton("None"); /** * The text input field. * @serial */ - private JTextComponent input; + @Nullable + private JTextComponent input = null; /** - * Whether this dialog has been displayed at least once. - * @serial - */ - private boolean hasBeenDisplayed = false; - - /** * Create a new instance. * @param treasureTree the defined treasure lists * @param parent the parent frame for dialog boxes @@ -158,11 +156,13 @@ * @param input Textfield to show. * @param parent Parent frame (attribute dialog) */ - public synchronized void showDialog(final JTextComponent input, @NotNull final Component parent) { + public synchronized void showDialog(@Nullable final JTextComponent input, @NotNull final Component parent) { this.input = input; // set textfield for input/output - if (hasBeenDisplayed) { + final boolean hasBeenDisplayed = frame != null; + if (frame != null) { if (frame.isShowing()) { + assert frame != null; frame.setVisible(false); // frame should be hidden at this point } @@ -186,12 +186,14 @@ final JPanel buttonPanel = buildButtonPanel(); final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, buttonPanel); splitPane.setOneTouchExpandable(false); + assert frame != null; splitPane.setDividerLocation(frame.getHeight() - buttonPanel.getMinimumSize().height - 4); splitPane.setDividerSize(4); splitPane.setResizeWeight(1.0); // show the splitted pane (tree and buttons) + assert frame != null; frame.getContentPane().add(splitPane); expandPath(new TreePath(treasureTree.getRoot())); @@ -207,7 +209,9 @@ } // center dialog relative to parent window + assert frame != null; frame.setSize(470, 550); + assert frame != null; frame.setLocationRelativeTo(parent); if (input != null) { @@ -225,7 +229,9 @@ if (!hasBeenDisplayed) { // If this is the first time, the frame has to be packed, // otherwise no scrolling would be possible (see below). + assert frame != null; frame.pack(); + assert frame != null; frame.setSize(470, 550); setSelectionPath(treePath); } @@ -233,27 +239,29 @@ // scroll the tree to the pre-selected treasurelist scrollRowToVisible(getRowCount() - 1); scrollPathToVisible(treePath); + assert frame != null; frame.setVisible(true); // display the window } else { // no valid treasurelist is preselected: scrollRowToVisible(0); // show first row (root node) setSelectionPath(null); // nothing selected + assert frame != null; frame.setVisible(true); } } else { // no parent attribute dialog exists: scrollRowToVisible(0); // show first row (root node) setSelectionPath(null); // nothing selected + assert frame != null; frame.setVisible(true); } - - hasBeenDisplayed = true; // in future, the dialog doesn't need to be rebuilt } /** * Building the button panel (bottom-line of the dialog window). * @return the JPanel containing all buttons */ + @NotNull private JPanel buildButtonPanel() { final JPanel buttonPanel = new JPanel(new BorderLayout()); // main panel, containing everything @@ -261,25 +269,25 @@ final Container rightSide = new JPanel(); // panel containing right-side buttons // build right side buttons - okButton = new JButton("Select"); okButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final String result = getSelectedTreasureList(); if (result != null) { input.setText(" " + result); + assert frame != null; frame.setVisible(false); } } }); rightSide.add(okButton); - noneButton = new JButton("None"); noneButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { // print "none" into the attribute dialog input.setText(" " + NONE_SYM); + assert frame != null; frame.setVisible(false); } }); @@ -289,6 +297,7 @@ cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { + assert frame != null; frame.setVisible(false); } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 23:59:04
|
Revision: 8096 http://gridarta.svn.sourceforge.net/gridarta/?rev=8096&view=rev Author: akirschbaum Date: 2010-06-04 23:58:56 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Remove nested assignment. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java Modified: trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-04 23:57:12 UTC (rev 8095) +++ trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java 2010-06-04 23:58:56 UTC (rev 8096) @@ -334,8 +334,11 @@ } // climb up the tree path to the last node before root - this is the treasurelist - TreeNode parentNode; - while ((parentNode = node.getParent()) != treasureTree.getRoot()) { + while (true) { + final TreeNode parentNode = node.getParent(); + if (parentNode == treasureTree.getRoot()) { + break; + } node = parentNode; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 23:57:18
|
Revision: 8095 http://gridarta.svn.sourceforge.net/gridarta/?rev=8095&view=rev Author: akirschbaum Date: 2010-06-04 23:57:12 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 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-06-04 23:52:32 UTC (rev 8094) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/FlatMapRenderer.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -60,6 +60,7 @@ /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(FlatMapRenderer.class); /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -46,6 +46,7 @@ * The permanently shown {@link Component}. * @serial */ + @NotNull private final Component component; /** Modified: trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/gui/utils/tristate/TristateCheckBox.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -205,6 +205,7 @@ * Returns the model as a {@link TristateButtonModel}. * @return the model */ + @NotNull public TristateButtonModel getTristateModel() { return (TristateButtonModel) getModel(); } Modified: trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/model/treasurelist/TreasureObj.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -40,6 +40,7 @@ * The name of this treasure object. * @serial */ + @NotNull private final String name; /** @@ -96,6 +97,7 @@ /** * {@inheritDoc} */ + @NotNull @Override public String toString() { final StringBuilder sb = new StringBuilder(); @@ -217,6 +219,7 @@ * Returns the name of this treasure object. * @return the name of this treasure object */ + @NotNull public String getName() { return name; } Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-04 23:52:32 UTC (rev 8094) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2010-06-04 23:57:12 UTC (rev 8095) @@ -41,6 +41,7 @@ import org.apache.log4j.Category; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This class implements a popup window which shows all python methods in the @@ -56,11 +57,13 @@ /** * Python menu definitions. */ + @NotNull private static final String PYTHONMENU_FILE = "cfpython_menu.def"; /** * The Logger for printing log messages. */ + @NotNull private static final Category log = Logger.getLogger(CFPythonPopup.class); /** @@ -72,12 +75,14 @@ * List of menu entries (all CFPython commands). * @serial */ + @Nullable private static String[] menuEntries = null; /** * The popup menu. * @serial */ + @NotNull private final JPopupMenu menu; /** @@ -213,19 +218,21 @@ */ private class MenuActionListener implements ActionListener { + @NotNull private final ScriptEditControl control; + @NotNull private final CFPythonPopup popup; private boolean ignore = false; // while true, all ActionEvents get ignored - MenuActionListener(final CFPythonPopup popup, final ScriptEditControl control) { + MenuActionListener(@NotNull final CFPythonPopup popup, @NotNull final ScriptEditControl control) { this.popup = popup; this.control = control; } @Override - public void actionPerformed(final ActionEvent e) { + public void actionPerformed(@NotNull final ActionEvent e) { if (!ignore) { // get method name to insert String method = popup.getSelectedItem().toString(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 23:52:43
|
Revision: 8094 http://gridarta.svn.sourceforge.net/gridarta/?rev=8094&view=rev Author: akirschbaum Date: 2010-06-04 23:52:32 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Fix Javadoc issues. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java trunk/build.xml 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/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/io/MapArchObjectParser.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/maparchobject/MapArchObject.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/smoothface/DuplicateSmoothFaceException.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/mappropertiesdialog/MapPropertiesDialog.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/maparchobject/MapArchObject.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/actions/CannotLoadMapFileException.java trunk/src/app/net/sf/gridarta/actions/MapSizeMismatchException.java 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/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/findarchetypes/TableModel.java trunk/src/app/net/sf/gridarta/gui/shortcuts/KeyStrokeDialog.java trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java trunk/src/app/net/sf/gridarta/gui/treasurelist/CFTreasureListTree.java trunk/src/app/net/sf/gridarta/gui/treasurelist/TreasureCellRenderer.java trunk/src/app/net/sf/gridarta/gui/utils/borderpanel/BorderSplitPane.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/model/archetypechooser/ArchetypeChooserPanel.java trunk/src/app/net/sf/gridarta/model/baseobject/BaseObject.java trunk/src/app/net/sf/gridarta/model/face/IllegalFaceException.java trunk/src/app/net/sf/gridarta/model/map/mapmodel/MapSquareGrid.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/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/ValidationError.java trunk/src/app/net/sf/gridarta/model/scripts/UndefinedEventArchetypeTypeException.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/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java trunk/src/app/net/sf/gridarta/textedit/textarea/actions/Replace.java trunk/src/app/net/sf/gridarta/validation/checks/NonAbsoluteExitPathError.java trunk/src/test/net/sf/gridarta/model/baseobject/AbstractBaseObjectTest.java Added Paths: ----------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/renderer/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/package.html trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/renderer/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/package.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/package.html trunk/src/app/net/sf/gridarta/gui/archetypechooser/package.html trunk/src/app/net/sf/gridarta/gui/connectionview/package.html trunk/src/app/net/sf/gridarta/gui/filter/package.html trunk/src/app/net/sf/gridarta/gui/help/package.html trunk/src/app/net/sf/gridarta/gui/map/package.html trunk/src/app/net/sf/gridarta/gui/map/tools/package.html trunk/src/app/net/sf/gridarta/gui/package.html trunk/src/app/net/sf/gridarta/gui/pickmapchooser/package.html trunk/src/app/net/sf/gridarta/gui/prefs/package.html trunk/src/app/net/sf/gridarta/gui/selectedsquare/package.html trunk/src/app/net/sf/gridarta/gui/undo/package.html trunk/src/app/net/sf/gridarta/gui/utils/tristate/package.html trunk/src/app/net/sf/gridarta/model/anim/package.html trunk/src/app/net/sf/gridarta/model/data/package.html trunk/src/app/net/sf/gridarta/model/face/package.html trunk/src/app/net/sf/gridarta/model/gameobject/package.html trunk/src/app/net/sf/gridarta/model/io/package.html trunk/src/app/net/sf/gridarta/model/map/validation/package.html trunk/src/app/net/sf/gridarta/model/match/package.html trunk/src/app/net/sf/gridarta/model/scripts/package.html trunk/src/app/net/sf/gridarta/model/undo/package.html trunk/src/app/net/sf/gridarta/package.html trunk/src/app/net/sf/gridarta/textedit/scripteditor/package.html trunk/src/app/net/sf/gridarta/textedit/textarea/package.html trunk/src/app/net/sf/gridarta/validation/checks/package.html trunk/src/app/overview.html Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/map/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/gui/scripts/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/io/package-info.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/map/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/gui/scripts/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/overview.html trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/io/package-info.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/package-info.java trunk/src/app/net/sf/gridarta/gui/archetypechooser/package-info.java trunk/src/app/net/sf/gridarta/gui/connectionview/package-info.java trunk/src/app/net/sf/gridarta/gui/filter/package-info.java trunk/src/app/net/sf/gridarta/gui/help/package-info.java trunk/src/app/net/sf/gridarta/gui/map/package-info.java trunk/src/app/net/sf/gridarta/gui/map/tools/package-info.java trunk/src/app/net/sf/gridarta/gui/package-info.java trunk/src/app/net/sf/gridarta/gui/pickmapchooser/package-info.java trunk/src/app/net/sf/gridarta/gui/prefs/package-info.java trunk/src/app/net/sf/gridarta/gui/selectedsquare/package-info.java trunk/src/app/net/sf/gridarta/gui/undo/package-info.java trunk/src/app/net/sf/gridarta/gui/utils/tristate/package-info.java trunk/src/app/net/sf/gridarta/model/anim/package-info.java trunk/src/app/net/sf/gridarta/model/data/package-info.java trunk/src/app/net/sf/gridarta/model/face/package-info.java trunk/src/app/net/sf/gridarta/model/gameobject/package-info.java trunk/src/app/net/sf/gridarta/model/io/package-info.java trunk/src/app/net/sf/gridarta/model/map/package-info.java trunk/src/app/net/sf/gridarta/model/map/validation/package-info.java trunk/src/app/net/sf/gridarta/model/match/package-info.java trunk/src/app/net/sf/gridarta/model/scripts/package-info.java trunk/src/app/net/sf/gridarta/model/undo/package-info.java trunk/src/app/net/sf/gridarta/package-info.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/package-info.java trunk/src/app/net/sf/gridarta/textedit/textarea/package-info.java trunk/src/app/net/sf/gridarta/validation/checks/package-info.java trunk/src/test/net/sf/gridarta/gui/map/package-info.java trunk/src/test/net/sf/gridarta/model/io/package-info.java trunk/src/test/net/sf/gridarta/model/map/validation/package-info.java trunk/src/test/net/sf/gridarta/package-info.java Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,25 +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. - */ - -/** - * Renders maps. - * @note Management of maps is in a different package: {@link net.sf.gridarta.model.map}. - */ - -package net.sf.gridarta.var.atrinik.gui.map; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,28 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +<p>Renders maps.</p> + +<p>Note: management of maps is in a different package: {@link + net.sf.gridarta.model.map.mapcontrol}.</p> +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/map/renderer/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/mappropertiesdialog/MapPropertiesDialog.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -62,6 +62,7 @@ import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import net.sf.japi.swing.action.ActionBuilder; import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -88,118 +89,229 @@ /** * The parent frame for help windows. + * @serial */ @NotNull private final JFrame helpParent; + /** + * The {@link MapModel} this dialog shows. + * @serial + */ @NotNull private final MapModel<GameObject, MapArchObject, Archetype> mapModel; + /** + * The {@link Window} that represents this dialog. + * @serial + */ @Nullable private Window dialog = null; - // input components, see MapArchObject for expl. of purpose - + /** + * The message text. + * @serial + */ @NotNull - private final JTextArea mapDescription = new JTextArea(4, 4); // the msg text/arch text + private final JTextArea mapDescription = new JTextArea(4, 4); + /** + * The map's name. + * @serial + */ @NotNull - private final JTextField mapName = new JTextField(); // name of arch + private final JTextField mapName = new JTextField(); + /** + * The map's region. + * @serial + */ @NotNull - private final JTextField mapRegion = new JTextField(); // map's region + private final JTextField mapRegion = new JTextField(); + /** + * The name of the sound file. + * @serial + */ @NotNull - private final JTextField mapBackgroundMusic = new JTextField(); // name of soundfile + private final JTextField mapBackgroundMusic = new JTextField(); + /** + * The width in squares. + * @serial + */ @NotNull - private final JFormattedTextField mapWidthField = new JFormattedTextField(); // len x + private final JFormattedTextField mapWidthField = new JFormattedTextField(); + /** + * The height in squares. + * @serial + */ @NotNull - private final JFormattedTextField mapHeightField = new JFormattedTextField(); // len y + private final JFormattedTextField mapHeightField = new JFormattedTextField(); + /** + * The outdoor attribute. + * @serial + */ @NotNull - private final AbstractButton checkboxOutdoor = new JCheckBox(); // map outdoor + private final AbstractButton checkboxOutdoor = new JCheckBox(); + /** + * The enter x attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldEnterX = new JFormattedTextField(); // enter x + private final JFormattedTextField fieldEnterX = new JFormattedTextField(); + /** + * The enter y attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldEnterY = new JFormattedTextField(); // enter y + private final JFormattedTextField fieldEnterY = new JFormattedTextField(); + /** + * The swap time attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); // swap time + private final JFormattedTextField fieldSwapTime = new JFormattedTextField(); + /** + * The reset timeout attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); // reset timeout + private final JFormattedTextField fieldResetTimeout = new JFormattedTextField(); + /** + * The map difficulty attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); // map difficulty + private final JFormattedTextField fieldDifficulty = new JFormattedTextField(); + /** + * The map darkness attribute. + * @serial + */ @NotNull - private final JFormattedTextField fieldDarkness = new JFormattedTextField(); // darkness + private final JFormattedTextField fieldDarkness = new JFormattedTextField(); + /** + * The fixed reset attribute. + * @serial + */ @NotNull - private final AbstractButton checkboxFixedReset = new JCheckBox(); // fixed reset + private final AbstractButton checkboxFixedReset = new JCheckBox(); + /** + * The checkbox for the no save attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoSave = new JCheckBox(); + /** + * The checkbox for the no magic attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoMagic = new JCheckBox(); + /** + * The checkbox for the no priest attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoPriest = new JCheckBox(); + /** + * The checkbox for the no summon attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoSummon = new JCheckBox(); + /** + * The checkbox for the no harm attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoHarm = new JCheckBox(); + /** + * The checkbox for the no fixed login attribute. + * @serial + */ @NotNull private final AbstractButton checkboxNoFixedLogin = new JCheckBox(); + /** + * The checkbox for the unique attribute. + * @serial + */ @NotNull private final AbstractButton checkboxUnique = new JCheckBox(); + /** + * The checkbox for the fixed reset time attribute. + * @serial + */ @NotNull private final AbstractButton checkboxFixedResetTime = new JCheckBox(); + /** + * The checkbox for the player no save attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPlayerNoSave = new JCheckBox(); + /** + * The checkbox for the pvp attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPvp = new JCheckBox(); + /** + * The checkbox for the plugins attribute. + * @serial + */ @NotNull private final AbstractButton checkboxPlugins = new JCheckBox(); /** - * JButton for ok. + * The button for ok. + * @serial */ @NotNull private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "mapOkay", this)); /** - * JButton for cancel. + * The button for cancel. + * @serial */ @NotNull private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "mapCancel", this)); /** - * The MapTilePane. + * The {@link AbstractMapTilePane}. + * @serial */ @NotNull private final AbstractMapTilePane<GameObject, MapArchObject, Archetype> mapTilePane; /** * Whether the map tile pane was enabled. + * @serial */ private final boolean mapTilePaneEnabled; /** - * Creates a map-options dialog. + * Creates a new instance. * @param helpParent the parent frame for help windows * @param mapManager the map manager to use * @param globalSettings the global settings instance @@ -238,9 +350,9 @@ } /** - * Create the mainPanel. - * @param map MapArchObject to create main panel for. - * @return Newly created main panel. + * Creates the main panel. + * @param map the map arch object to create the panel for + * @return the main panel */ @NotNull private Component createMainPanel(@NotNull final MapArchObject map) { @@ -273,9 +385,9 @@ } /** - * Create the mapDataPanel. - * @param map MapArchObject to create panel for. - * @return Newly created mapDataPanel. + * Creates the map data panel. + * @param map the map arch object to create the panel for + * @return the map data panel */ @NotNull private Component createMapDataPanel(@NotNull final net.sf.gridarta.model.map.maparchobject.MapArchObject<MapArchObject> map) { @@ -289,9 +401,9 @@ } /** - * Create the optionsPanel. - * @param map MapArchObject to create panel for. - * @return Newly created optionsPanel. + * Creates the options panel. + * @param map the map arch object to create the panel for + * @return the options panel */ @NotNull private Component createOptionsPanel(@NotNull final MapArchObject map) { @@ -322,9 +434,9 @@ } /** - * Create the mapPanel. - * @param map MapArchObject to create panel for. - * @return Newly created mapPanel. + * Creates the map panel. + * @param map the map arch object to create the panel for + * @return the map panel */ @NotNull private Component createMapPanel(@NotNull final MapArchObject map) { @@ -386,9 +498,9 @@ } /** - * Create the tile path panel. - * @param mapTilePane The <code>MapTilePane<code> contents. - * @return Newly created tile path panel. + * Creates the tile path panel. + * @param mapTilePane the map tile pane contents + * @return the tile path panel */ @NotNull private static Component createTilePathPanel(@NotNull final Component mapTilePane) { @@ -400,6 +512,7 @@ /** * Action method for help. */ + @ActionMethod public void mapHelp() { new Help(helpParent, "tut_mapattr.html").setVisible(true); } @@ -407,6 +520,7 @@ /** * Action method for okay. */ + @ActionMethod public void mapOkay() { if (modifyMapProperties()) { setValue(okButton); @@ -416,6 +530,7 @@ /** * Action method for restore. */ + @ActionMethod public void mapRestore() { restoreMapProperties(); } @@ -423,6 +538,7 @@ /** * Action method for cancel. */ + @ActionMethod public void mapCancel() { setValue(cancelButton); } @@ -449,12 +565,12 @@ } /** - * Create an "attribute"-line (format: <label> <textfield>). - * @param textField formatted textfield - * @param n lenght of textfield - * @param defaultValue initial value in formatted textfield - * @param labelKey (attribute-)label key - * @return created panel + * Creates an "attribute"-line (format: <label> <textfield>). + * @param textField formatted text field + * @param n the length of the text field + * @param defaultValue the initial value in formatted text field + * @param labelKey the (attribute-)label key + * @return the created panel */ @NotNull private static Component createPanelLine(@NotNull final JFormattedTextField textField, final int n, final int defaultValue, @NotNull final String labelKey) { @@ -467,11 +583,12 @@ } /** - * Create a checkbox-line, similar to createPanelLine. - * @param checkBox checkbox - * @param state initial state - * @param labelKey (attribute-)label key - * @return created Checkbox + * Creates a checkbox-line, similar to {@link + * #createPanelLine(JFormattedTextField, int, int, String)}. + * @param checkBox the checkbox + * @param state the initial state + * @param labelKey the (attribute-)label key + * @return the panel */ @NotNull private static Component createPanelCBox(@NotNull final AbstractButton checkBox, final boolean state, @NotNull final String labelKey) { @@ -598,7 +715,7 @@ } /** - * Reset all map properties to the saved values in the map arch object. + * Resets all map properties to the saved values in the map arch object. */ private void restoreMapProperties() { final MapArchObject map = mapModel.getMapArchObject(); Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +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. - */ - -/** - * Script related Atrinik specific classes. - */ - -package net.sf.gridarta.var.atrinik.gui.scripts; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,25 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Graphical User Interface to choose archetypes. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/gui/scripts/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/overview.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ 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. - --> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> -<head> - <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/> - <title></title> -</head> -<body> -<p> - You are reading the Atrinik Java Map Editor (short Atrinik Editor) API - Documentation. The Atrinik Editor is a Java program to create and modify - maps for the MMORPG <a href="http://www.atrinik.org/">Atrinik MMORPG</a>. -</p> - -<h3>UI Classes</h3> - -<p> - The most important UI class is {@link - net.sf.gridarta.var.atrinik.CMainView}. It is the main window, creates the - main layout and holds all actions. Most actions are delegated to {@link - net.sf.gridarta.var.atrinik.CMainControl} upon performation.</p> - -<p> - Map visualization is done by {@link - net.sf.gridarta.var.atrinik.CMapViewBasic}, which renders the map, and - {@link net.sf.gridarta.var.atrinik.CMapViewIFrame}, which is a - JInternalFrame wrapping CMapViewBasic.</p> - -<h3>Data Model</h3> - -<p> - Each archetype is an instance of {@link - net.sf.gridarta.var.atrinik.arch.ArchObject}.</p> - -<h3>Atrinik Editor Terminology Glossary</h3> -<dl> - <dt id="Animation">Animation</dt> - <dd> - An Animation is a list of faces that defines the appearance of an - Archetype in cases the appearance can change. The number of Facings in - an Animation defines how many different sub-animations the animation - contains. Such a sub-animation is for instance used to show the - Archetype from different perspectives, depending on the direction - (facing) of the Archetype. The number of Frames in an Animation defines - the number of different faces used to display the Archetypes' appearance - for a Facing. The Animations are not played by the Editor, - <p/> - It is possible to have an animation which holds different facings but - only 1 frame per facing. Such animations are used to create "turnable" - objects, that can face in different directions. - <p/> - It is possible to have an animation without a specified number of - facings. Such an object is animated but does not change its appearance - depending on the perspective. - <p/> - There are 2 ways for defining an animation. An animation can be - anonymously defined inside a default arch; such animations inherit the - name from the defining arch. Or an animation can be defined in a - separate file in the <code>arch/</code> folder. - <p/> - Animations are NamedObjects, override Faces, they are implemented by - {@link net.sf.gridarta.var.atrinik.arch.anim.AnimationObject} and {@link - net.sf.gridarta.var.atrinik.arch.anim.AnimationObjects}. - </dd> - <dt id="Archetype">Archetype</dt> - <dd> - An Archetype represents a single object including its description. There - are two kinds of Archetypes, a real Archetype and the default - Archetypes. Depending on the start mode of the editor, the default - Archetypes are all loaded either from a file named - <code>arch/archetypes</code> or by scanning the whole <code>arch/</code> - directory tree for <code>.arc</code>-files. Real Archetypes are objects - in maps and each of them refers to a Default Archetype it is derived - from. Each Real Archetype only stores the information that differs from - its Default Archetype. - <p/> - Additionally, an Archetype can be a so called Artifact. Artifacts are - always read from a file named <code>arch/artifacts</code>. Currently, - Artifacts are under migration. After the migration is finished, - Artifacts are special "appliable" Archetypes. You'd select an ArchObject - and apply an Artifact on it, which would copy all Artifact attributes - over the ArchObject attributes. - <p/> - The class that implements Archetypes is {@link - net.sf.gridarta.var.atrinik.arch.ArchObject}. The class that parses text - for modifying ArchObjects is {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectParser}. The class that holds - all Default Archetypes, including those for Default Artifacts, is {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectStack}. - <p/> - </dd> - <dt id="Artifact">Artifact</dt> - <dd> - See <a href="#Archetype">Archetype</a> - - <p/> - </dd> - <dt id="Face">Face</dt> - <dd> - The Face is the appearance of an Archetype. A Face is defined by a - String that uniquely defines the appearance and is used to reference a - corresponding graphic image, usually a PNG file. The {@link - net.sf.gridarta.var.atrinik.arch.ArchObjectStack} contains a collection - of all available faces. - <p/> - Animations override Faces. - </dd> - <dt id="Map">Map</dt> - <dd> - A Map is a 2-dimensional Matrix of Map Squares. X and Y define a grid - representing a world surface. At those grid positions, Map Squares with - Arch Objects can be found and make up the world, its surface, obstacles, - items etc.. - <p/> - The Map itself is defined by a Map Arch. The class storing the Map is - {@link net.sf.gridarta.var.atrinik.map.MapModel}. - </dd> - <dt id="MapSquare">(Map )Square</dt> - <dd> - A Map Square is a Map matrix element. A Map Square holds zero or more - Arch Objects that describe the world in the map at the Map Square's x - and y position. - </dd> -</dl> -</body> -</html> Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +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. - */ - -/** - * Handles the Atrinik variants of {@link net.sf.gridarta.model.gameobject.GameObject GameObjects} and {@link net.sf.gridarta.model.archetype.Archetype Archetypes}. - */ - -package net.sf.gridarta.var.atrinik.model.gameobject; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,27 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Handles the Atrinik variants of {@link +net.sf.gridarta.model.gameobject.GameObject GameObjects} and {@link +net.sf.gridarta.model.archetype.Archetype Archetypes}. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,24 +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. - */ - -/** - * Reading and Writing of Atrinik maps. - */ - -package net.sf.gridarta.var.atrinik.model.io; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,25 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +Script related Atrinik specific classes. +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/io/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF 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-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/maparchobject/MapArchObject.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -45,82 +45,98 @@ /** * No save map. + * @serial */ private boolean noSave = false; /** * No magic spells. + * @serial */ private boolean noMagic = false; /** * No prayers. + * @serial */ private boolean noPriest = false; /** * No harmful spells allowed. + * @serial */ private boolean noHarm = false; /** * No summoning allowed. + * @serial */ private boolean noSummon = false; /** * Check map reset status after re-login. + * @serial */ private boolean fixedLogin = false; /** * Unique map. + * @serial */ private boolean unique = false; /** * Fixed reset time. + * @serial */ private boolean fixedResetTime = false; /** * Players cannot save on this map. + * @serial */ private boolean playerNoSave = false; /** * Player vs Player combat allowed. + * @serial */ private boolean pvp = false; /** * Global map events for this map allowed. + * @serial */ private boolean plugins = false; /** * The tileset id. 0 means no available tileset id + * @serial */ private int tilesetId = 0; /** * The tileset x coordinate. + * @serial */ private int tilesetX = 0; /** * The tileset y coordinate. + * @serial */ private int tilesetY = 0; /** * The name of the background music. Set to empty string if unset. + * @serial */ @NotNull private String backgroundMusic = ""; /** * The region the map is in. + * @serial */ @NotNull private String region = ""; @@ -149,10 +165,18 @@ setRegion(mapArchObject.region); } + /** + * Returns the no save attribute. + * @return the no save attribute + */ public boolean isNoSave() { return noSave; } + /** + * Sets the no save attribute. + * @param noSave the no save attribute + */ public void setNoSave(final boolean noSave) { if (this.noSave == noSave) { return; @@ -162,10 +186,18 @@ setModified(); } + /** + * Returns the no magic attribute. + * @return the no magic attribute + */ public boolean isNoMagic() { return noMagic; } + /** + * Sets the no magic attribute. + * @param noMagic the no magic attribute + */ public void setNoMagic(final boolean noMagic) { if (this.noMagic == noMagic) { return; @@ -175,10 +207,18 @@ setModified(); } + /** + * Returns the no priest attribute. + * @return the no priest attribute + */ public boolean isNoPriest() { return noPriest; } + /** + * Sets the no priest attribute. + * @param noPriest the no priest attribute + */ public void setNoPriest(final boolean noPriest) { if (this.noPriest == noPriest) { return; @@ -188,10 +228,18 @@ setModified(); } + /** + * Returns the no summon attribute. + * @return the no summon attribute + */ public boolean isNoSummon() { return noSummon; } + /** + * Sets the no summon attribute. + * @param noSummon the no summon attribute + */ public void setNoSummon(final boolean noSummon) { if (this.noSummon == noSummon) { return; @@ -201,10 +249,18 @@ setModified(); } + /** + * Returns the no harm attribute. + * @return the no harm attribute + */ public boolean isNoHarm() { return noHarm; } + /** + * Sets the no harm attribute. + * @param noHarm the no harm attribute + */ public void setNoHarm(final boolean noHarm) { if (this.noHarm == noHarm) { return; @@ -214,10 +270,18 @@ setModified(); } + /** + * Returns the fixed login attribute. + * @return the fixed login attribute + */ public boolean isFixedLogin() { return fixedLogin; } + /** + * Sets the fixed login attribute. + * @param fixedLogin the fixed login attribute + */ public void setFixedLogin(final boolean fixedLogin) { if (this.fixedLogin == fixedLogin) { return; @@ -227,10 +291,18 @@ setModified(); } + /** + * Returns the unique attribute. + * @return the unique attribute + */ public boolean isUnique() { return unique; } + /** + * Sets the unique save attribute. + * @param unique the unique attribute + */ public void setUnique(final boolean unique) { if (this.unique == unique) { return; @@ -240,10 +312,18 @@ setModified(); } + /** + * Returns the fixed reset time attribute. + * @return the fixed reset time attribute + */ public boolean isFixedResetTime() { return fixedResetTime; } + /** + * Sets the fixed reset time attribute. + * @param fixedResetTime the fixed reset time attribute + */ public void setFixedResetTime(final boolean fixedResetTime) { if (this.fixedResetTime == fixedResetTime) { return; @@ -253,10 +333,18 @@ setModified(); } + /** + * Returns the player no save attribute. + * @return the player no save attribute + */ public boolean isPlayerNoSave() { return playerNoSave; } + /** + * Sets the player no save attribute. + * @param playerNoSave the player no save attribute + */ public void setPlayerNoSave(final boolean playerNoSave) { if (this.playerNoSave == playerNoSave) { return; @@ -266,10 +354,18 @@ setModified(); } + /** + * Returns the pvp attribute. + * @return the pvp attribute + */ public boolean isPvp() { return pvp; } + /** + * Sets the pvp attribute. + * @param pvp the pvp attribute + */ public void setPvp(final boolean pvp) { if (this.pvp == pvp) { return; @@ -279,10 +375,18 @@ setModified(); } + /** + * Returns the plugins attribute. + * @return the plugins attribute + */ public boolean isPlugins() { return plugins; } + /** + * Sets the plugins attribute. + * @param plugins the plugins attribute + */ public void setPlugins(final boolean plugins) { if (this.plugins == plugins) { return; @@ -292,10 +396,18 @@ setModified(); } + /** + * Returns the tileset id attribute. + * @return the tileset id attribute + */ public int getTilesetId() { return tilesetId; } + /** + * Sets the tileset id attribute. + * @param tilesetId the tileset id attribute + */ public void setTilesetId(final int tilesetId) { if (this.tilesetId == tilesetId) { return; @@ -305,10 +417,18 @@ setModified(); } + /** + * Returns the tileset x attribute. + * @return the tileset x attribute + */ public int getTilesetX() { return tilesetX; } + /** + * Sets the tileset x attribute. + * @param tilesetX the tileset x attribute + */ public void setTilesetX(final int tilesetX) { if (this.tilesetX == tilesetX) { return; @@ -318,10 +438,18 @@ setModified(); } + /** + * Returns the tileset y attribute. + * @return the tileset y attribute + */ public int getTilesetY() { return tilesetY; } + /** + * Sets the tileset y attribute. + * @param tilesetY the tileset y attribute + */ public void setTilesetY(final int tilesetY) { if (this.tilesetY == tilesetY) { return; @@ -353,11 +481,19 @@ setModified(); } + /** + * Returns the region attribute. + * @return the region attribute + */ @NotNull public String getRegion() { return region; } + /** + * Sets the region attribute. + * @param region the region attribute + */ public void setRegion(@NotNull final String region) { final String trimmedRegion = region.trim(); if (this.region.equals(trimmedRegion)) { Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package-info.java 2010-06-04 23:52:32 UTC (rev 8094) @@ -1,25 +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. - */ - -/** - * Main package of Gridarta4Atrinik, contains all classes specific to the Atrinik version of the Gridarta map editor. - * @serial exclude - */ - -package net.sf.gridarta.var.atrinik; Added: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html (rev 0) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html 2010-06-04 23:52:32 UTC (rev 8094) @@ -0,0 +1,26 @@ +<!-- + ~ 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. + --> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<body> +<p>Main package of Gridarta4Atrinik, contains all classes specific to the + Atrinik version of the Gridarta map editor.</p> +</body> +</html> Property changes on: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/package.html ___________________________________________________________________ Added: svn:mime-type + text/html Added: svn:eol-style + LF Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-04 20:00:44 UTC (rev 8093) +++ trunk/build.xml 2010-06-04 23:52:32 UTC (rev 8094) @@ -157,8 +157,8 @@ <target name="apiDoc" description="Creates public javadoc documentation."> <mkdir dir="dest/doc/api/${project.version}"/> - <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html"/> - <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess"/> + <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/copyright.html"/> --> + <!-- <copy todir="dest/doc/api/${project.version}" file="src/doc/api/public/.htaccess"/> --> <javadoc destdir="dest/doc/api/${project.version}" access="protected" author="yes" version="yes" locale="en_US" use="yes" splitindex="yes" windowtitle="Gridarta API documentation" doctitle="Gridarta<br />Yet another Java API<br />API Documentation" header="Gridarta ${project.version}<br />Yet another Java API<br />API Documentation" footer="Gridarta<br />Yet another Java API<br />API Documentation" bottom="<div style="text-align:center;">© 2005-2006 The Gridarta Developers. All rights reserved. See <a href="{@docRoot}/copyright.html">copyright</a></div>" serialwarn="yes" charset="${build.source.encoding}" docencoding="${build.source.encoding}" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="lib" includes="annotations.jar"/> @@ -182,19 +182,26 @@ <sourcepath> <pathelement path="${user.javadoc.javasrc}"/> <pathelement path="src/app"/> + <pathelement path="atrinik/src/app"/> + <pathelement path="crossfire/src/app"/> + <pathelement path="daimonin/src/app"/> </sourcepath> - <packageset dir="src/app" defaultexcludes="yes"> - <include name="**"/> - </packageset> - <tag enabled="true" name="retval" description="Return Values:" scope="methods"/> - <tag enabled="true" name="pre" description="Preconditions:" scope="methods,constructors"/> - <tag enabled="true" name="post" description="Postconditions:" scope="methods"/> - <tag enabled="true" name="note" description="Notes:"/> - <tag enabled="true" name="warning" description="Warnings:"/> - <tag enabled="true" name="todo" description="Todo:"/> - <tag enabled="true" name="fixme" description="Fixme:"/> - <tag enabled="true" name="xxx" description="XXX:"/> - <tag enabled="false" name="used" description="Manually marked as used."/> + <packageset dir="src/app" defaultexcludes="yes"/> + <packageset dir="atrinik/src/app" defaultexcludes="yes"/> + <packageset dir="crossfire/src/app" defaultexcludes="yes"/> + <packageset dir="daimonin/src/app" defaultexcludes="yes"/> + <tag name="todo" description="Todo:"/> + <tag name="used" description="Manually marked as used." enabled="false"/> + <tag name="fixme" description="Fixme:"/> + <tag name="xxx" description="XXX:"/> + <tag name="note" description="Note:"/> + <tag name="warning" description="Warning:"/> + <tag name="retval" description="Return Value:"/> + <tag name="val" description="Value:"/> + <tag name="default" description="Default Value:"/> + <tag name="invariant" description="Invariant:"/> + <tag name="pre" description="Precondition:"/> + <tag name="noinspection" description="No Inspection:"/> </javadoc> </target> @@ -386,18 +393,32 @@ <target name="javadoc" description="Creates the JavaDoc documentation for the complete editor source."> <exec executable="svnversion" outputproperty="build.number"/> <mkdir dir="dest/doc/dev/api"/> - <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta Editor — API Documentation" doctitle="Gridarta Editor ${build.number}<br />API Documentation" header="Gridarta Editor ${build.number}<br />API Documentation" footer="Gridarta Editor ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" link="${user.javadoc.link}"> + <javadoc destdir="dest/doc/dev/api" locale="en_US" version="yes" author="yes" use="yes" splitindex="yes" windowtitle="Gridarta Editor — API Documentation" doctitle="Gridarta Editor ${build.number}<br />API Documentation" header="Gridarta Editor ${build.number}<br />API Documentation" footer="Gridarta Editor ${build.number}<br />API Documentation" serialwarn="no" charset="utf-8" docencoding="utf-8" source="${build.source.version}" encoding="${build.source.encoding}" linksource="yes" private="yes" overview="src/app/overview.html" link="${user.javadoc.link}"> <classpath> <fileset dir="atrinik/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="crossfire/lib" includes="*.jar" excludes="*.jar-LICENSE"/> <fileset dir="lib" includes="*.jar" excludes="*.jar-LICENSE"/> </classpath> - <packageset dir="src/app"/> - <packageset dir="src" includes="test/**"/> - <packageset dir="atrinik/src/app"/> - <packageset dir="crossfire/src/app"/> - <packageset dir="daimonin/src/app"/> + <sourcepath> + <pathelement path="${user.javadoc.javasrc}"/> + <pathelement path="src/app"/> + <pathelement path="src/test"/> + <pathelement path="atrinik/src/app"/> + <pathelement path="atrinik/src/test"/> + <pathelement path="crossfire/src/app"/> + <pathelement path="crossfire/src/test"/> + <pathelement path="daimonin/src/app"/> + <pathelement path="daimonin/src/test"/> + </sourcepath> + <packageset dir="src/app" defaultexcludes="yes"/> + <p... [truncated message content] |
From: <aki...@us...> - 2010-06-04 20:00:50
|
Revision: 8093 http://gridarta.svn.sourceforge.net/gridarta/?rev=8093&view=rev Author: akirschbaum Date: 2010-06-04 20:00:44 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Remove empty packages. Removed Paths: ------------- trunk/src/test/net/sf/gridarta/var/atrinik/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 19:22:04
|
Revision: 8092 http://gridarta.svn.sourceforge.net/gridarta/?rev=8092&view=rev Author: akirschbaum Date: 2010-06-04 19:21:58 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Fail build for checkstyle violations. Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-06-04 19:21:07 UTC (rev 8091) +++ trunk/build.xml 2010-06-04 19:21:58 UTC (rev 8092) @@ -355,7 +355,7 @@ </classpath> </taskdef> <mkdir dir="dest/doc"/> - <checkstyle config="src/checkstyle.xml" failOnViolation="false"> + <checkstyle config="src/checkstyle.xml" failOnViolation="true"> <formatter type="plain" tofile="dest/doc/checkstyle_report.txt"/> <formatter type="plain"/> <fileset dir="src/app" includes="**/*.java"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 19:21:14
|
Revision: 8091 http://gridarta.svn.sourceforge.net/gridarta/?rev=8091&view=rev Author: akirschbaum Date: 2010-06-04 19:21:07 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java 2010-06-04 19:07:47 UTC (rev 8090) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java 2010-06-04 19:21:07 UTC (rev 8091) @@ -277,7 +277,7 @@ public void testReverse() { final GameObjectCreator gameObjectCreator = new GameObjectCreator(); final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0, 0, 0); - final Iterator<GameObject> it= container1.reverse().iterator(); + final Iterator<GameObject> it = container1.reverse().iterator(); it.next(); it.remove(); check(container1, 1, 0, 0, 0, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-04 19:07:55
|
Revision: 8090 http://gridarta.svn.sourceforge.net/gridarta/?rev=8090&view=rev Author: akirschbaum Date: 2010-06-04 19:07:47 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Implement #1714800 (Predefined locations / bookmarks) as Bookmarks menu. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties trunk/daimonin/ChangeLog trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties trunk/src/app/net/sf/gridarta/action.properties trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/RecentMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/utils/MenuUtils.java trunk/src/app/net/sf/gridarta/maincontrol/GUIMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/bookmarks/ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/atrinik/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,3 +1,13 @@ +2010-06-04 Andreas Kirschbaum + + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + 2010-06-03 Andreas Kirschbaum * Make "Move Env" to always insert into the selected map square. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/crossfire/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,5 +1,13 @@ 2010-06-04 Andreas Kirschbaum + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + * Properly retain "elevation" game object attributes when editing maps. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/daimonin/ChangeLog 2010-06-04 19:07:47 UTC (rev 8090) @@ -1,3 +1,13 @@ +2010-06-04 Andreas Kirschbaum + + * Implement #1714800 (Predefined locations / bookmarks) as + Bookmarks menu. + + Add Bookmark adds a new bookmark for the current map. + + Manage Bookmarks opens a dialog for managing existing bookmarks: + change bookmark title, reorder bookmarks, remove bookmark. + 2010-06-03 Andreas Kirschbaum * Make "Move Env" to always insert into the selected map square. Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -24,7 +24,7 @@ ######## # Menus -main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help +main.menubar=file edit map archetypes pickmaps resources tools analyze view bookmarks plugins window help file.menu=newMap openFile recent closeMap - saveMap saveMapAs closeAllMaps revertMap createImage - options shortcuts - exit edit.menu=undo redo - clear cut copy paste pasteTiled - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodFill - selectAll expandEmptySelection growSelection shrinkSelection map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize deleteUnknownObjects - gameObjectTextEditor Modified: trunk/src/app/net/sf/gridarta/action.properties =================================================================== --- trunk/src/app/net/sf/gridarta/action.properties 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/action.properties 2010-06-04 19:07:47 UTC (rev 8090) @@ -124,6 +124,9 @@ scriptEditFile.menu=scriptEditNewScript scriptEditOpen - scriptEditSave scriptEditSaveAs - scriptEditClose scriptEditCloseAll scriptEditEdit.menu=scriptEditUndo scriptEditRedo - scriptEditCut scriptEditCopy scriptEditPaste - scriptEditFind scriptEditReplace scriptEditFindAgain +# Entries after the last separator are replaced with bookmarks. +bookmarks.menu=addBookmark manageBookmarks - + showHelp.icon=general/Help16 tipOfTheDay.icon=general/TipOfTheDay16 Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,196 @@ +/* + * 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.bookmarks; + +import java.awt.Component; +import javax.swing.Action; +import net.sf.gridarta.gui.map.mapview.MapView; +import net.sf.gridarta.gui.map.mapview.MapViewManager; +import net.sf.gridarta.gui.map.mapview.MapViewManagerListener; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenuManager; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.map.mapcontrol.MapControl; +import net.sf.gridarta.model.map.mapmodel.MapModel; +import net.sf.gridarta.utils.ActionUtils; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Implements actions for managing bookmarks. + * @author Andreas Kirschbaum + */ +public class BookmarkActions<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { + + /** + * The {@link ActionBuilder} instance. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link MapMenuManager} defining the bookmarks menu entries. + */ + @NotNull + private final MapMenuManager<G, A, R> bookmarksMapMenuManager; + + /** + * The {@link BookmarksMapMenuPreferences} defining the bookmarks menu + * entries. + */ + @NotNull + private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + + /** + * The {@link MapImageCache} for creating map previews. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link MapViewManager} instance. + */ + @NotNull + private final MapViewManager<G, A, R> mapViewManager; + + /** + * The parent component for dialogs. + */ + @NotNull + private final Component parentComponent; + + /** + * The {@link Action} for "add bookmark". + */ + @NotNull + private final Action addBookmarkAction; + + /** + * The {@link ManageBookmarksDialog} instance. Set to <code>null</code> if not + * yet created. + */ + @Nullable + private ManageBookmarksDialog<G, A, R> manageBookmarksDialog = null; + + /** + * Creates a new instance. + * @param bookmarksMapMenuManager the map menu manager defining the + * bookmarks menu entries + * @param bookmarksMapMenuPreferences the bookmarks map menu preferences + * definition the bookmarks menu entries + * @param mapViewManager the map view manager instance + * @param parentComponent the parent component for dialogs + * @param mapImageCache the map image cache for creating map previews + */ + public BookmarkActions(@NotNull final MapMenuManager<G, A, R> bookmarksMapMenuManager, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapViewManager<G, A, R> mapViewManager, @NotNull final Component parentComponent, @NotNull final MapImageCache<G, A, R> mapImageCache) { + this.bookmarksMapMenuManager = bookmarksMapMenuManager; + this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + this.mapViewManager = mapViewManager; + this.parentComponent = parentComponent; + this.mapImageCache = mapImageCache; + addBookmarkAction = ActionUtils.newAction(ACTION_BUILDER, "Bookmarks", this, "addBookmark"); + ActionUtils.newAction(ACTION_BUILDER, "Bookmarks", this, "manageBookmarks"); + + final MapViewManagerListener<G, A, R> mapViewManagerListener = new MapViewManagerListener<G, A, R>() { + + @Override + public void activeMapViewChanged(@Nullable final MapView<G, A, R> mapView) { + updateActions(); + } + + @Override + public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) { + // ignore + } + + @Override + public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) { + // ignore + } + + }; + mapViewManager.addMapViewManagerListener(mapViewManagerListener); + + updateActions(); + } + + /** + * Action method for "addBookmark". Creates a new bookmark for the currently + * opened map. + */ + @ActionMethod + public void addBookmark() { + doAddBookmark(true); + } + + /** + * Action method for "manage bookmarks". Opens the dialog for editing + * existing bookmarks. + */ + @ActionMethod + public void manageBookmarks() { + if (manageBookmarksDialog == null) { + manageBookmarksDialog = new ManageBookmarksDialog<G, A, R>(parentComponent, bookmarksMapMenuPreferences, mapImageCache); + } + manageBookmarksDialog.showDialog(parentComponent); + } + + /** + * Updates the enabled state of all actions. + */ + private void updateActions() { + addBookmarkAction.setEnabled(doAddBookmark(false)); + } + + /** + * Preforms the action "add bookmark". + * @param performAction whether the action should be performed + * @return whether the action has or can be performed + */ + private boolean doAddBookmark(final boolean performAction) { + final MapView<G, A, R> mapView = mapViewManager.getActiveMapView(); + if (mapView == null) { + return false; + } + + final MapControl<G, A, R> mapControl = mapView.getMapControl(); + final MapModel<G, A, R> mapModel = mapControl.getMapModel(); + if (mapModel.getMapFile() == null) { + return false; + } + + if (performAction) { + final A mapArchObject = mapModel.getMapArchObject(); + final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(mapView, mapArchObject.getMapName()); + if (editBookmarkDialog.showDialog(mapView)) { + bookmarksMapMenuManager.addRecent(mapModel, editBookmarkDialog.getDescription()); + } + } + + return true; + } + +} // class BookmarkActions Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/BookmarkActions.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,196 @@ +/* + * 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.bookmarks; + +import java.awt.Component; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.WindowConstants; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.JTextComponent; +import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.gui.utils.TextComponentUtils; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; + +/** + * A dialog that displays one bookmark and allows to edit the values. + * @author Andreas Kirschbaum + */ +public class EditBookmarkDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JOptionPane { + + /** + * The serial Version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The dialog. + */ + @NotNull + private final JDialog dialog; + + /** + * The text input field for the description. + */ + @NotNull + private final JTextComponent descriptionField = new JTextField(); + + /** + * The {@link JButton} for ok. + */ + @NotNull + private final JButton okButton = new JButton(ACTION_BUILDER.createAction(false, "editBookmarkOkay", this)); + + /** + * The {@link JButton} for cancel. + */ + @NotNull + private final JButton cancelButton = new JButton(ACTION_BUILDER.createAction(false, "editBookmarkCancel", this)); + + /** + * Creates a new instance. + * @param parentComponent the parent component for the dialog + * @param defaultDescription the default value for the description field + */ + public EditBookmarkDialog(@NotNull final Component parentComponent, @NotNull final String defaultDescription) { + okButton.setDefaultCapable(true); + setOptions(new Object[] { okButton, cancelButton }); + + setMessage(createPanel()); + + TextComponentUtils.setAutoSelectOnFocus(descriptionField); + descriptionField.setText(defaultDescription); + + final DocumentListener documentListener = new DocumentListener() { + + /** {@inheritDoc} */ + @Override + public void insertUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void removeUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + /** {@inheritDoc} */ + @Override + public void changedUpdate(@NotNull final DocumentEvent e) { + updateOkButton(); + } + + }; + descriptionField.getDocument().addDocumentListener(documentListener); + updateOkButton(); + + dialog = createDialog(parentComponent, ACTION_BUILDER.getString("editBookmark.title")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.getRootPane().setDefaultButton(okButton); + dialog.pack(); + } + + /** + * Opens the dialog. Returns when the dialog has been dismissed. + * @param parentComponent the parent component for the dialog + * @return whether "ok" was selected + */ + public boolean showDialog(@NotNull final Component parentComponent) { + dialog.setLocationRelativeTo(parentComponent); + dialog.setVisible(true); + return getValue() == okButton; + } + + /** + * Creates the GUI. + * @return the panel containing the GUI + */ + @NotNull + private JPanel createPanel() { + final JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); + + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + + mainPanel.add(new JLabel(ACTION_BUILDER.getString("editBookmark.description"))); + mainPanel.add(Box.createVerticalStrut(5)); + + mainPanel.add(descriptionField); + mainPanel.add(Box.createVerticalStrut(5)); + + return mainPanel; + } + + /** + * Action method for okay. + */ + @ActionMethod + public void editBookmarkOkay() { + if (!getDescription().isEmpty()) { + setValue(okButton); + } + } + + /** + * Action method for cancel. + */ + @ActionMethod + public void editBookmarkCancel() { + setValue(cancelButton); + } + + /** + * Returns the description. + * @return the description + */ + @NotNull + public String getDescription() { + return descriptionField.getText().trim(); + } + + /** + * Sets the enabled state of {@link #okButton} depending on the contents of + * {@link #descriptionField}. + */ + private void updateOkButton() { + okButton.setEnabled(!getDescription().isEmpty()); + } + +} // class EditBookmarkDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/EditBookmarkDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,401 @@ +/* + * 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.bookmarks; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.io.File; +import javax.swing.Action; +import javax.swing.DefaultListCellRenderer; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JViewport; +import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingConstants; +import javax.swing.WindowConstants; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.gui.mapmenu.BookmarksMapMenuPreferences; +import net.sf.gridarta.gui.mapmenu.MapMenuEntry; +import net.sf.gridarta.gui.utils.GUIConstants; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import net.sf.japi.swing.action.ActionMethod; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * A dialog that displays existing bookmarks and allows to edit or remove them. + * @author Andreas Kirschbaum + */ +public class ManageBookmarksDialog<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends JOptionPane { + + /** + * The serial Version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * The {@link BookmarksMapMenuPreferences} to affect. + */ + @NotNull + private final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences; + + /** + * The {@link MapImageCache} for creating map previews. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link JList} of all bookmarks. + */ + @NotNull + private final JList bookmarksList; + + /** + * The map preview image. + */ + @NotNull + private final JLabel preview = new JLabel(); + + /** + * The dialog. + */ + @NotNull + private final JDialog dialog; + + /** + * The {@link Action} for "edit bookmark". + */ + @NotNull + private final Action editAction = ACTION_BUILDER.createAction(false, "manageBookmarksEdit", this); + + /** + * The {@link Action} for "move up bookmark". + */ + @NotNull + private final Action moveUpAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveUp", this); + + /** + * The {@link Action} for "move down bookmark". + */ + @NotNull + private final Action moveDownAction = ACTION_BUILDER.createAction(false, "manageBookmarksMoveDown", this); + + /** + * The {@link Action} for "remove bookmark". + */ + @NotNull + private final Action removeAction = ACTION_BUILDER.createAction(false, "manageBookmarksRemove", this); + + /** + * The {@link JButton} for cancel. + */ + @NotNull + private final JButton closeButton = new JButton(ACTION_BUILDER.createAction(false, "manageBookmarksClose", this)); + + /** + * The currently selected entry. + */ + @Nullable + private MapMenuEntry<G, A, R> selectedMapMenuEntry = null; + + /** + * Creates a new instance. + * @param parentComponent the parent component for the dialog + * @param bookmarksMapMenuPreferences the bookmarks map menu preferences to + * affect + * @param mapImageCache the map image cache for creating map previews + */ + public ManageBookmarksDialog(@NotNull final Component parentComponent, @NotNull final BookmarksMapMenuPreferences<G, A, R> bookmarksMapMenuPreferences, @NotNull final MapImageCache<G, A, R> mapImageCache) { + this.bookmarksMapMenuPreferences = bookmarksMapMenuPreferences; + this.mapImageCache = mapImageCache; + bookmarksList = new JList(bookmarksMapMenuPreferences); + final JButton editButton = new JButton(editAction); + final JButton moveUpButton = new JButton(moveUpAction); + final JButton moveDownButton = new JButton(moveDownAction); + final JButton removeButton = new JButton(removeAction); + setOptions(new Object[] { editButton, moveUpButton, moveDownButton, removeButton, closeButton }); + + setMessage(createPanel()); + + dialog = createDialog(parentComponent, ACTION_BUILDER.getString("manageBookmarks.title")); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setModal(false); + dialog.setResizable(true); + dialog.pack(); + + updateActions(); + } + + /** + * Opens the dialog. Returns after the dialog has been dismissed. + * @param parentComponent the parent component for the dialog + */ + public void showDialog(@NotNull final Component parentComponent) { + setInitialValue(bookmarksList); + bookmarksList.setSelectedIndex(0); + dialog.setLocationRelativeTo(parentComponent); + dialog.setMinimumSize(new Dimension(600, 300)); + dialog.setPreferredSize(new Dimension(800, 600)); + dialog.setVisible(true); + dialog.toFront(); + } + + /** + * Creates the GUI. + * @return the panel containing the GUI + */ + @NotNull + private JPanel createPanel() { + preview.setHorizontalAlignment(SwingConstants.CENTER); + preview.setPreferredSize(new Dimension(200, 200)); + + final JPanel mainPanel = new JPanel(new GridBagLayout()); + + mainPanel.setBorder(GUIConstants.DIALOG_BORDER); + + final JScrollPane bookmarksScrollPane = new JScrollPane(); + bookmarksScrollPane.setViewportView(bookmarksList); + bookmarksScrollPane.setBackground(bookmarksList.getBackground()); + bookmarksScrollPane.getViewport().add(bookmarksList); + bookmarksScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + bookmarksScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); + bookmarksScrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + final GridBagConstraints gbc = new GridBagConstraints(); + gbc.fill = GridBagConstraints.BOTH; + gbc.weightx = 1.0; + gbc.weighty = 1.0; + gbc.gridx = 0; + gbc.gridy = 0; + mainPanel.add(bookmarksScrollPane, gbc); + + gbc.weightx = 0.0; + gbc.gridx = 1; + mainPanel.add(preview, gbc); + + bookmarksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + bookmarksList.setCellRenderer(new DefaultListCellRenderer() { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + @Override + public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + final MapMenuEntry<?, ?, ?> mapMenuEntry = (MapMenuEntry<?, ?, ?>) value; + setText(mapMenuEntry.getTitle()); + final File mapFile = mapMenuEntry.getMapFile(); + setToolTipText(mapFile.getPath()); + return this; + } + + }); + + final ListSelectionListener listSelectionListener = new ListSelectionListener() { + + @Override + public void valueChanged(final ListSelectionEvent e) { + updateSelectedBookmark(); + } + + }; + bookmarksList.addListSelectionListener(listSelectionListener); + + return mainPanel; + } + + /** + * Updates {@link #selectedMapMenuEntry} from {@link #bookmarksList}. + */ + private void updateSelectedBookmark() { + //JList does not use type parameters + @SuppressWarnings({ "unchecked" }) + final MapMenuEntry<G, A, R> mapMenuEntry = (MapMenuEntry<G, A, R>) bookmarksList.getSelectedValue(); + selectedMapMenuEntry = mapMenuEntry; + updateActions(); + } + + /** + * Action method for "edit bookmark". + */ + @ActionMethod + public void manageBookmarksEdit() { + doEditBookmark(true); + } + + /** + * Action method for "move up bookmark". + */ + @ActionMethod + public void manageBookmarksMoveUp() { + doMoveUpBookmark(true); + } + + /** + * Action method for "move down bookmark". + */ + @ActionMethod + public void manageBookmarksMoveDown() { + doMoveDownBookmark(true); + } + + /** + * Action method for "remove bookmark". + */ + @ActionMethod + public void manageBookmarksRemove() { + doRemoveBookmark(true); + } + + /** + * Action method for "close bookmarks dialog". + */ + @ActionMethod + public void manageBookmarksClose() { + setValue(closeButton); + } + + /** + * Edits the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doEditBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (performAction) { + final EditBookmarkDialog<G, A, R> editBookmarkDialog = new EditBookmarkDialog<G, A, R>(this, mapMenuEntry.getTitle()); + if (editBookmarkDialog.showDialog(this)) { + bookmarksMapMenuPreferences.setTitle(mapMenuEntry, editBookmarkDialog.getDescription()); + } + } + + return true; + } + + /** + * Moves up the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doMoveUpBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (!bookmarksMapMenuPreferences.doMoveUp(mapMenuEntry, performAction)) { + return false; + } + + if (performAction) { + bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() - 1); + } + + return true; + } + + /** + * Moves down the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doMoveDownBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (!bookmarksMapMenuPreferences.doMoveDown(mapMenuEntry, performAction)) { + return false; + } + + if (performAction) { + bookmarksList.setSelectedIndex(bookmarksList.getSelectedIndex() + 1); + } + + return true; + } + + /** + * Removes the selected bookmark. + * @param performAction whether the action should be performed + * @return whether the action can or was performed + */ + private boolean doRemoveBookmark(final boolean performAction) { + final MapMenuEntry<G, A, R> mapMenuEntry = selectedMapMenuEntry; + if (mapMenuEntry == null) { + return false; + } + + if (performAction) { + final int index = bookmarksList.getSelectedIndex(); + bookmarksMapMenuPreferences.removeMapMenuEntry(mapMenuEntry); + if (index < bookmarksList.getModel().getSize()) { + bookmarksList.setSelectedIndex(index); + } else if (index > 0) { + bookmarksList.setSelectedIndex(index - 1); + } + } + + return true; + } + + /** + * Updates the actions' states to reflect the current selection. + */ + private void updateActions() { + editAction.setEnabled(doEditBookmark(false)); + moveUpAction.setEnabled(doMoveUpBookmark(false)); + moveDownAction.setEnabled(doMoveDownBookmark(false)); + removeAction.setEnabled(doRemoveBookmark(false)); + final MapMenuEntry<?, ?, ?> mapMenuEntry = selectedMapMenuEntry; + preview.setIcon(mapMenuEntry == null ? null : new ImageIcon(mapImageCache.getOrCreatePreview(mapMenuEntry.getMapFile()))); + } + +} // class ManageBookmarksDialog Property changes on: trunk/src/app/net/sf/gridarta/gui/bookmarks/ManageBookmarksDialog.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,114 @@ +/* + * 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.mapmenu; + +import java.io.File; +import java.io.IOException; +import javax.swing.AbstractListModel; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.mapmanager.FileControl; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.settings.GlobalSettings; +import org.jetbrains.annotations.NotNull; + +/** + * Abstract base class for {@link MapMenuPreferences} implementations. + * @author Andreas Kirschbaum + */ +public abstract class AbstractMapMenuPreferences<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractListModel implements MapMenuPreferences<G, A, R> { + + /** + * The {@link MapViewsManager} instance. + */ + @NotNull + private final MapViewsManager<G, A, R> mapViewsManager; + + /** + * The global settings instance. + */ + @NotNull + private final GlobalSettings globalSettings; + + /** + * The {@link MapImageCache} to use. + */ + @NotNull + private final MapImageCache<G, A, R> mapImageCache; + + /** + * The {@link FileControl}. + */ + @NotNull + private final FileControl<G, A, R> fileControl; + + /** + * Creates a new instance. + * @param mapViewsManager the map views manager instance + * @param globalSettings the global settings instance + * @param mapImageCache the map image cache instance + * @param fileControl the file control + */ + protected AbstractMapMenuPreferences(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { + this.mapViewsManager = mapViewsManager; + this.globalSettings = globalSettings; + this.mapImageCache = mapImageCache; + this.fileControl = fileControl; + } + + /** + * Creates a new {@link MapMenuEntry}. + * @param title the entry's title + * @param mapFile the entry's map file + * @return the new instance + */ + @NotNull + protected MapMenuEntry<G, A, R> newMapMenuEntry(@NotNull final String title, @NotNull final File mapFile) { + return new MapMenuEntry<G, A, R>(title, mapFile, mapViewsManager, mapImageCache, fileControl, getShortDescription(title, getShortMapFile(globalSettings.getMapsDirectory(), mapFile))); + } + + /** + * Returns the base name of a map file. + * @param mapsDirectory the maps directory + * @param mapFile the map file + * @return the base name + */ + @NotNull + private static String getShortMapFile(@NotNull final File mapsDirectory, @NotNull final File mapFile) { + String canonicalMapFile; + String canonicalMapsDirectory; + try { + canonicalMapFile = mapFile.getCanonicalPath(); + canonicalMapsDirectory = mapsDirectory.getCanonicalPath(); + } catch (final IOException ignored) { + canonicalMapFile = mapFile.getAbsolutePath(); + canonicalMapsDirectory = mapsDirectory.getAbsolutePath(); + } + + if (canonicalMapFile.startsWith(canonicalMapsDirectory)) { + return canonicalMapFile.substring(canonicalMapsDirectory.length()).replace('\\', '/'); + } else { + return canonicalMapFile.replace('\\', '/'); + } + } + +} // class AbstractMapMenuPreferences Property changes on: trunk/src/app/net/sf/gridarta/gui/mapmenu/AbstractMapMenuPreferences.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -0,0 +1,295 @@ +/* + * 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.mapmenu; + +import java.io.File; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.prefs.Preferences; +import net.sf.gridarta.MainControl; +import net.sf.gridarta.gui.map.mapview.MapViewsManager; +import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import net.sf.gridarta.mapmanager.FileControl; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.map.maparchobject.MapArchObject; +import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.japi.swing.action.ActionBuilder; +import net.sf.japi.swing.action.ActionBuilderFactory; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link MapMenuPreferences} for bookmark menu entries. + * @author Andreas Kirschbaum + */ +public class BookmarksMapMenuPreferences<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractMapMenuPreferences<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The {@link Preferences}. + */ + @NotNull + private static final Preferences preferences = Preferences.userNodeForPackage(MainControl.class); + + /** + * The {@link ActionBuilder}. + */ + @NotNull + private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta"); + + /** + * List with mapMenuEntries. + */ + @NotNull + private final List<MapMenuEntry<G, A, R>> mapMenuEntries = new LinkedList<MapMenuEntry<G, A, R>>(); + + /** + * Creates a new instance. + * @param mapViewsManager the map views manager instance + * @param globalSettings the global settings instance + * @param mapImageCache the map image cache instance + * @param fileControl the file control + */ + public BookmarksMapMenuPreferences(@NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl) { + super(mapViewsManager, globalSettings, mapImageCache, fileControl); + } + + /** + * {@inheritDoc} + */ + @Override + public void init() { + final int numRecents = preferences.getInt("bookmarkNum", 0); + for (int i = 0; i < numRecents; i++) { + final String title = getTitle(i); + final File mapFile = getMapFile(i); + addMapMenuEntry(title, mapFile, false); + } + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getTitle(final int index) { + return preferences.get("bookmarkTitle[" + Integer.toString(index) + ']', null); + } + + /** + * Sets an entry's title. + * @param mapMenuEntry the entry + * @param title the title + */ + public void setTitle(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, @NotNull final String title) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + preferences.put("bookmarkTitle[" + Integer.toString(index) + ']', title); + mapMenuEntry.setTitle(title); + fireContentsChanged(this, index, index); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public File getMapFile(final int index) { + return new File(preferences.get("bookmarkFilename[" + Integer.toString(index) + ']', null)); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public String getShortDescription(@NotNull final String title, @NotNull final String mapFile) { + return ACTION_BUILDER.format("bookmarkItem.shortdescriptionformat", title, mapFile); + } + + /** + * {@inheritDoc} + */ + @Override + public void addMapMenuEntry(@NotNull final String title, @NotNull final File mapFile, final boolean doSave) { + final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); + final int index = mapMenuEntries.size(); + mapMenuEntries.add(mapMenuEntry); + fireIntervalAdded(this, index, index); + if (doSave) { + save(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void removeMapMenuEntry(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { + final int index = indexOf(mapMenuEntry); + mapMenuEntries.remove(index); + save(); + fireIntervalRemoved(this, index, index); + } + + /** + * Saves all entries to preferences. + */ + private void save() { + int i = 0; + for (final MapMenuEntry<G, A, R> mapMenuEntry : mapMenuEntries) { + preferences.put("bookmarkTitle[" + Integer.toString(i) + ']', mapMenuEntry.getTitle()); + preferences.put("bookmarkFilename[" + Integer.toString(i) + ']', mapMenuEntry.getMapFile().getPath()); + i++; + } + preferences.putInt("bookmarkNum", i); + } + + /** + * {@inheritDoc} + */ + @NotNull + @Override + public Iterator<MapMenuEntry<G, A, R>> iterator() { + return new Iterator<MapMenuEntry<G, A, R>>() { + + /** + * The {@link Iterator} to forward to. + */ + @NotNull + private final Iterator<MapMenuEntry<G, A, R>> it = mapMenuEntries.iterator(); + + /** + * The index of the current entry. + */ + private int index = -1; + + @Override + public boolean hasNext() { + return it.hasNext(); + } + + @Override + public MapMenuEntry<G, A, R> next() { + return it.next(); + } + + @Override + public void remove() { + it.remove(); + fireIntervalRemoved(BookmarksMapMenuPreferences.this, index, index); + index--; + save(); + } + + }; + } + + /** + * {@inheritDoc} + */ + @Override + public int getSize() { + return mapMenuEntries.size(); + } + + /** + * {@inheritDoc} + */ + @Override + public Object getElementAt(final int index) { + return mapMenuEntries.get(index); + } + + /** + * Moves an entry upwards. + * @param mapMenuEntry the entry + * @param performAction whether to perform the move or just check + * @return whether the action was or can be performed + */ + public boolean doMoveUp(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + + if (index <= 0) { + return false; + } + + if (performAction) { + mapMenuEntries.remove(index); + mapMenuEntries.add(index - 1, mapMenuEntry); + save(); + fireContentsChanged(this, index - 1, index); + } + + return true; + } + + /** + * Moves an entry downwards. + * @param mapMenuEntry the entry + * @param performAction whether to perform the move or just check + * @return whether the action was or can be performed + */ + public boolean doMoveDown(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry, final boolean performAction) { + final int index = indexOf(mapMenuEntry); + if (index == -1) { + throw new IllegalArgumentException(); + } + + if (index >= mapMenuEntries.size() - 1) { + return false; + } + + if (performAction) { + mapMenuEntries.remove(index); + mapMenuEntries.add(index + 1, mapMenuEntry); + save(); + fireContentsChanged(this, index, index + 1); + } + + return true; + } + + /** + * Returns the index of a {@link MapMenuEntry} within {@link + * #mapMenuEntries}. + * @param mapMenuEntry the map menu entry + * @return the index + */ + private int indexOf(@NotNull final MapMenuEntry<G, A, R> mapMenuEntry) { + for (int i = 0; i < mapMenuEntries.size(); i++) { + if (mapMenuEntries.get(i) == mapMenuEntry) { + return i; + } + } + return -1; + } + +} // class BookmarksMapMenuPreferences Property changes on: trunk/src/app/net/sf/gridarta/gui/mapmenu/BookmarksMapMenuPreferences.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuEntry.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -49,7 +49,7 @@ * Title = map name. */ @NotNull - private final String title; + private String title; /** * The {@link MapViewsManager} instance. @@ -85,7 +85,6 @@ * @param shortDescription the short description for tooltips */ public MapMenuEntry(@NotNull final String title, @NotNull final File mapFile, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl, @NotNull final String shortDescription) { - super(title); this.mapFile = mapFile; this.title = title; this.mapViewsManager = mapViewsManager; @@ -119,6 +118,15 @@ } /** + * Sets the title of this entry. + * @param title the title + */ + public void setTitle(@NotNull final String title) { + this.title = title; + putValue(NAME, title); + } + + /** * Get the icon of this file. * @return icon of this file */ Modified: trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-03 23:08:35 UTC (rev 8089) +++ trunk/src/app/net/sf/gridarta/gui/mapmenu/MapMenuManager.java 2010-06-04 19:07:47 UTC (rev 8090) @@ -20,17 +20,15 @@ package net.sf.gridarta.gui.mapmenu; import java.io.File; -import java.io.IOException; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.swing.Action; import javax.swing.JMenu; -import net.sf.gridarta.gui.map.mapview.MapViewsManager; -import net.sf.gridarta.gui.mapimagecache.MapImageCache; +import javax.swing.event.ListDataEvent; +import javax.swing.event.ListDataListener; import net.sf.gridarta.gui.utils.MenuUtils; -import net.sf.gridarta.mapmanager.FileControl; import net.sf.gridarta.mapmanager.MapManager; import net.sf.gridarta.mapmanager.MapManagerListener; import net.sf.gridarta.model.archetype.Archetype; @@ -43,7 +41,6 @@ import net.sf.gridarta.model.map.mapmodel.MapModelListener; import net.sf.gridarta.model.map.mapmodel.MapSquare; import net.sf.gridarta.model.map.validation.ErrorCollector; -import net.sf.gridarta.model.settings.GlobalSettings; import net.sf.gridarta.utils.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -55,12 +52,6 @@ public class MapMenuManager<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** - * The {@link MapViewsManager} instance. - */ - @NotNull - private final MapViewsManager<G, A, R> mapViewsManager; - - /** * The menu to update. * @serial */ @@ -68,24 +59,6 @@ private JMenu recentMenu = null; /** - * The global settings instance. - */ - @NotNull - private final GlobalSettings globalSettings; - - /** - * The {@link MapImageCache} to use. - */ - @NotNull - private final MapImageCache<G, A, R> mapImageCache; - - /** - * The {@link FileControl}. - */ - @NotNull - private final FileControl<G, A, R> fileControl; - - /** * The {@link MapMenuPreferences} to use. */ @NotNull @@ -101,19 +74,31 @@ /** * Create a new instance. * @param mapManager the map manager instance - * @param mapViewsManager the map views manager instance - * @param globalSettings the global settings instance - * @param mapImageCache the map image cache instance - * @param fileControl the file control * @param mapMenuPreferences the recent preferences to use */ - public MapMenuManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final GlobalSettings globalSettings, @NotNull final MapImageCache<G, A, R> mapImageCache, @NotNull final FileControl<G, A, R> fileControl, @NotNull final MapMenuPreferences<G, A, R> mapMenuPreferences) { - this.mapViewsManager = mapViewsManager; - this.globalSettings = globalSettings; - this.mapImageCache = mapImageCache; - this.fileControl = fileControl; + public MapMenuManager(@NotNull final MapManager<G, A, R> mapManager, @NotNull final MapMenuPreferences<G, A, R> mapMenuPreferences) { this.mapMenuPreferences = mapMenuPreferences; + final ListDataListener listDataListener = new ListDataListener() { + + @Override + public void intervalAdded(@NotNull final ListDataEvent e) { + updateRecent(); + } + + @Override + public void intervalRemoved(@NotNull final ListDataEvent e) { + updateRecent(); + } + + @Override + public void contentsChanged(@NotNull final ListDataEvent e) { + updateRecent(); + } + + }; + mapMenuPreferences.addListDataListener(listDataListener); + final MapManagerListener<G, A, R> mapManagerListener = new MapManagerListener<G, A, R>() { /** {@inheritDoc} */ @@ -175,8 +160,7 @@ return; } - final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); - mapMenuPreferences.addMapMenuEntryEntry(mapMenuEntry, true); + mapMenuPreferences.addMapMenuEntry(title, mapFile, true); updateRecent(); } @@ -222,53 +206,11 @@ * Initializes the recent state. */ public void initRecent() { - final int numRecents = mapMenuPreferences.getNum(); - for (int i = numRecents - 1; i >= 0; i--) { - final String title = mapMenuPreferences.getTitle(i); - final File mapFile = mapMenuPreferences.getMapFile(i); - final MapMenuEntry<G, A, R> mapMenuEntry = newMapMenuEntry(title, mapFile); - mapMenuPreferences.addMapMenuEntryEntry(mapMenuEntry, false); - } + mapMenuPreferences.init(); updateRecent(); } /** - * Creates a new {@link MapMenuEntry}. - * @param title the entry's title - * @param mapFile the entry's map file - * @return the new instance - */ - @NotNull - private MapMenuEntry<G, A, R> newMapMenuEntry(@NotNull final String title, @NotNull final File mapFile) { - return new MapMenuEntry<G, A, R>(title, mapFile, mapViewsManager, mapImageCache, fileControl, mapMenuPreferences.getShortDescription(title, getShortMapFile(globalSettings.getMapsDirectory(), mapFile))); - } - - /** - * Returns the base name of a map file. - * @param mapsDirectory the maps directory - * @param mapFile the map file - * @return the base name - */ - @NotNull - private static String getShortMapFile(@NotNull final File mapsDirectory, @NotNull final File mapFile) { - String canonicalMapFile; - String canonicalMapsDirectory; - try { - canonicalMapFile = mapFile.getCanonicalPath(); - canonicalMapsDirectory = mapsDirectory.getCanonicalPath(); - } catch (final IOException ignored) { - canonicalMapFile = mapFile.getAbsolutePath(); - canonicalMapsDirectory = mapsDirectory.getAbsolutePath(); - } - - if (canonicalMapFile.startsWith(canonicalMapsDirectory)) { - return canonicalMapFile.substring(canonicalMapsDirectory.length()).replace('\\', '/'); - } else { - return canonicalMapFile.replace('\\', '/'); - } - } - - ... [truncated message content] |
From: <aki...@us...> - 2010-06-03 23:08:42
|
Revision: 8089 http://gridarta.svn.sourceforge.net/gridarta/?rev=8089&view=rev Author: akirschbaum Date: 2010-06-03 23:08:35 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Fix 'mpart_id' rather 'mpart_nr' in error message. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-06-03 23:08:35 UTC (rev 8089) @@ -143,4 +143,4 @@ ####################### # Various Log Messages -logDefArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} +logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParser.java 2010-06-03 23:08:35 UTC (rev 8089) @@ -134,7 +134,7 @@ // set or check mpart_id archetype.setMultiShapeID(multiShapeID); if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); } } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-06-03 23:08:35 UTC (rev 8089) @@ -141,4 +141,4 @@ ####################### # Various Log Messages -logDefArchWithInvalidMpartNr=Arch part {0} has mpart_nr {2}, but head part {1} has mpart_nr {3} +logDefArchWithInvalidMpartId=Arch part {0} has mpart_id {2}, but head part {1} has mpart_id {3} Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-06-03 23:00:42 UTC (rev 8088) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeParser.java 2010-06-03 23:08:35 UTC (rev 8089) @@ -133,7 +133,7 @@ // set or check mpart_id archetype.setMultiShapeID(multiShapeID); if (firstArch != null && multiShapeID != firstArch.getMultiShapeID()) { - errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartNr", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); + errorViewCollector.addWarning(ErrorViewCategory.ARCHETYPE_INVALID, ACTION_BUILDER.format("logDefArchWithInvalidMpartId", archetype.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID()))); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-03 23:00:48
|
Revision: 8088 http://gridarta.svn.sourceforge.net/gridarta/?rev=8088&view=rev Author: akirschbaum Date: 2010-06-03 23:00:42 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Properly retain "elevation" game object attributes when editing maps. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java trunk/crossfire.iml trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java Added Paths: ----------- trunk/crossfire/src/test/net/ trunk/crossfire/src/test/net/sf/ trunk/crossfire/src/test/net/sf/gridarta/ trunk/crossfire/src/test/net/sf/gridarta/var/ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/crossfire/ChangeLog 2010-06-03 23:00:42 UTC (rev 8088) @@ -1,3 +1,8 @@ +2010-06-04 Andreas Kirschbaum + + * Properly retain "elevation" game object attributes when editing + maps. + 2010-06-03 Andreas Kirschbaum * Make "Move Env" to always insert into the selected map square. 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-06-03 22:38:31 UTC (rev 8087) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/gameobject/GameObject.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -80,7 +80,7 @@ * {@inheritDoc} */ @Override - public void propagateElevation(@NotNull final BaseObject<GameObject, MapArchObject, Archetype, ?> gameObject) { + public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { final String elevation = gameObject.getAttributeString(ELEVATION, false); if (elevation.length() != 0) { setAttributeString(ELEVATION, elevation); Added: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java (rev 0) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -0,0 +1,86 @@ +/* + * 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.var.crossfire.model.gameobject; + +import java.util.regex.Pattern; +import net.sf.gridarta.model.anim.AnimationObjects; +import net.sf.gridarta.model.anim.DefaultAnimationObjects; +import net.sf.gridarta.model.face.ArchFaceProvider; +import net.sf.gridarta.model.face.DefaultFaceObjects; +import net.sf.gridarta.model.face.FaceObjectProviders; +import net.sf.gridarta.model.face.FaceObjects; +import net.sf.gridarta.utils.GUIUtils; +import net.sf.gridarta.utils.SystemIcons; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetype; +import org.jetbrains.annotations.NotNull; + +/** + * Creates {@link GameObject GameObjects}. + * @author Andreas Kirschbaum + */ +public class GameObjectCreator { + + /** + * The {@link Archetype} for created game objects. + */ + @NotNull + private final Archetype archetype; + + /** + * The {@link FaceObjectProviders} for created game objects. + */ + @NotNull + private final FaceObjectProviders faceObjectProviders; + + /** + * The {@link AnimationObjects} for created game objects. + */ + @NotNull + private final AnimationObjects animationObjects; + + /** + * Creates a new instance. + */ + GameObjectCreator() { + final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); + final FaceObjects faceObjects = new DefaultFaceObjects("pngFile", "faceTreeFile", Pattern.compile(""), "", archFaceProvider); + final GUIUtils guiUtils = new GUIUtils(); + final SystemIcons systemIcons = new SystemIcons(guiUtils); + faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); + animationObjects = new DefaultAnimationObjects("animTreeFile"); + archetype = new DefaultArchetype("arch", faceObjectProviders, animationObjects); + } + + /** + * Creates a new {@link GameObject}. + * @param elevation the game object's elevation + * @return the new game object + */ + @NotNull + public GameObject newGameObject(final int elevation) { + final GameObject gameObject = new GameObject(archetype, faceObjectProviders, animationObjects); + if (elevation != 0) { + gameObject.setAttributeString(GameObject.ELEVATION, Integer.toString(elevation)); + } + return gameObject; + } + +} // class GameObjectCreator Property changes on: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java (rev 0) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -0,0 +1,351 @@ +/* + * 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.var.crossfire.model.gameobject; + +import java.util.Iterator; +import net.sf.gridarta.model.baseobject.GameObjectContainer; +import net.sf.gridarta.var.crossfire.model.archetype.Archetype; +import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.junit.Assert; +import org.junit.Test; + +/** + * Checks that {@link GameObjectContainer GameObjectContainers} correctly + * propagate elevation information when being modified. + * @author Andreas Kirschbaum + */ +public class PropagateElevationTest { + + /** + * Checks that {@link + * GameObjectContainer#addFirst(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testAddFirst() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> gameObjectContainer = gameObjectCreator.newGameObject(0); + + // first game object => keep + gameObjectContainer.addFirst(gameObjectCreator.newGameObject(123)); + check(gameObjectContainer, 123); + + // without elevation => propagate + gameObjectContainer.addFirst(gameObjectCreator.newGameObject(0)); + check(gameObjectContainer, 123); + + // with elevation => ignore but propagate + gameObjectContainer.addFirst(gameObjectCreator.newGameObject(321)); + check(gameObjectContainer, 123); + } + + /** + * Checks that {@link + * GameObjectContainer#addLast(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testAddLast() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> gameObjectContainer = gameObjectCreator.newGameObject(0); + + // first game object => keep + gameObjectContainer.addLast(gameObjectCreator.newGameObject(123)); + check(gameObjectContainer, 123); + + // without elevation => keep + gameObjectContainer.addLast(gameObjectCreator.newGameObject(0)); + check(gameObjectContainer, 123, 0); + + // with elevation => keep + gameObjectContainer.addLast(gameObjectCreator.newGameObject(321)); + check(gameObjectContainer, 123, 0, 321); + } + + /** + * Checks that {@link + * GameObjectContainer#insertBefore(net.sf.gridarta.model.gameobject.GameObject, + * GameObject)} does work correctly. + */ + @Test + public void testInsertBefore() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> gameObjectContainer = gameObjectCreator.newGameObject(0); + + // first game object => keep + gameObjectContainer.insertBefore(gameObjectCreator.newGameObject(1), null); + check(gameObjectContainer, 1); + + // without elevation => propagate + gameObjectContainer.insertBefore(gameObjectCreator.newGameObject(0), null); + check(gameObjectContainer, 1, 0); + + // with elevation => ignore but propagate + final GameObject ob1 = gameObjectCreator.newGameObject(2); + gameObjectContainer.insertBefore(ob1, null); + check(gameObjectContainer, 1, 0, 0); + + // with elevation => keep + gameObjectContainer.insertBefore(gameObjectCreator.newGameObject(3), ob1); + check(gameObjectContainer, 1, 3, 0, 0); + + // with elevation => ignore but propagate + gameObjectContainer.insertBefore(gameObjectCreator.newGameObject(4), null); + check(gameObjectContainer, 1, 0, 3, 0, 0); + } + + /** + * Checks that {@link + * GameObjectContainer#insertAfter(net.sf.gridarta.model.gameobject.GameObject, + * GameObject)} does work correctly. + */ + @Test + public void testInsertAfter() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> gameObjectContainer = gameObjectCreator.newGameObject(0); + + // first game object => keep + gameObjectContainer.insertAfter(null, gameObjectCreator.newGameObject(1)); + check(gameObjectContainer, 1); + + // at end => keep + final GameObject ob1 = gameObjectCreator.newGameObject(2); + gameObjectContainer.insertAfter(null, ob1); + check(gameObjectContainer, 1, 2); + + // at front, without elevation => propagate + gameObjectContainer.insertAfter(ob1, gameObjectCreator.newGameObject(0)); + check(gameObjectContainer, 1, 0, 2); + + // middle => keep + gameObjectContainer.insertAfter(ob1, gameObjectCreator.newGameObject(3)); + check(gameObjectContainer, 1, 0, 3, 2); + + // at front, with elevation => ignore but propagate + gameObjectContainer.insertAfter(gameObjectContainer.getFirst(), gameObjectCreator.newGameObject(4)); + check(gameObjectContainer, 1, 0, 0, 3, 2); + } + + /** + * Checks that {@link + * GameObjectContainer#moveBottom(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testMoveBottom() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.moveBottom(get(container1, 0)); + check(container1, 1, 0, 0, 0); + container1.moveBottom(get(container1, 1)); + check(container1, 1, 0, 0, 0); + container1.moveBottom(get(container1, 3)); + check(container1, 1, 0, 0, 0); + } + + /** + * Checks that {@link + * GameObjectContainer#moveDown(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testMoveDown() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.moveDown(get(container1, 0)); + check(container1, 1, 0, 0, 0); + container1.moveDown(get(container1, 1)); + check(container1, 1, 0, 0, 0); + container1.moveDown(get(container1, 3)); + check(container1, 1, 0, 0, 0); + } + + /** + * Checks that {@link + * GameObjectContainer#moveUp(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testMoveUp() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.moveUp(get(container1, 0)); + check(container1, 1, 0, 0, 0); + container1.moveUp(get(container1, 1)); + check(container1, 1, 0, 0, 0); + container1.moveUp(get(container1, 3)); + check(container1, 1, 0, 0, 0); + } + + /** + * Checks that {@link + * GameObjectContainer#moveTop(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testMoveTop() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.moveTop(get(container1, 0)); + check(container1, 1, 0, 0, 0); + container1.moveTop(get(container1, 1)); + check(container1, 1, 0, 0, 0); + container1.moveTop(get(container1, 3)); + check(container1, 1, 0, 0, 0); + } + + /** + * Checks that {@link + * GameObjectContainer#remove(net.sf.gridarta.model.gameobject.GameObject)} + * does work correctly. + */ + @Test + public void testRemove() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.remove(get(container1, 0)); + check(container1, 1, 0, 0); + container1.remove(get(container1, 2)); + check(container1, 1, 0); + container1.remove(get(container1, 0)); + check(container1, 1); + container1.remove(get(container1, 0)); + check(container1); + } + + /** + * Checks that {@link + * GameObjectContainer#replace(net.sf.gridarta.model.gameobject.GameObject, + * GameObject)} does work correctly. + */ + @Test + public void testReplace() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0); + container1.replace(get(container1, 0), gameObjectCreator.newGameObject(2)); + check(container1, 1, 0, 0, 0); + container1.replace(get(container1, 1), gameObjectCreator.newGameObject(3)); + check(container1, 1, 3, 0, 0); + container1.replace(get(container1, 0), gameObjectCreator.newGameObject(4)); + check(container1, 1, 3, 0, 0); + } + + /** + * Checks that {@link GameObjectContainer#iterator()}'s {@link + * Iterator#remove()} does work correctly. + */ + @Test + public void testIterator() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0, 0, 0); + final Iterator<GameObject> it = container1.iterator(); + it.next(); + it.remove(); + check(container1, 1, 0, 0, 0, 0); + it.next(); + it.remove(); + check(container1, 1, 0, 0, 0); + it.next(); + it.next(); + it.remove(); + check(container1, 1, 0, 0); + } + + /** + * Checks that {@link GameObjectContainer#reverse()}'s {@link + * Iterator#remove()} does work correctly. + */ + @Test + public void testReverse() { + final GameObjectCreator gameObjectCreator = new GameObjectCreator(); + final GameObjectContainer<GameObject, MapArchObject, Archetype> container1 = newContainer(gameObjectCreator, 1, 0, 0, 0, 0, 0); + final Iterator<GameObject> it= container1.reverse().iterator(); + it.next(); + it.remove(); + check(container1, 1, 0, 0, 0, 0); + it.next(); + it.remove(); + check(container1, 1, 0, 0, 0); + it.next(); + it.next(); + it.remove(); + check(container1, 1, 0, 0); + it.next(); + it.remove(); + check(container1, 1, 0); + it.next(); + it.remove(); + check(container1, 1); + Assert.assertFalse(it.hasNext()); + } + + /** + * Creates a new {@link GameObjectContainer} that contains game objects with + * the given elevation values. + * @param gameObjectCreator the game object creator to use + * @param elevations the elevations + * @return the game object container + */ + @NotNull + private static GameObjectContainer<GameObject, MapArchObject, Archetype> newContainer(@NotNull final GameObjectCreator gameObjectCreator, final int... elevations) { + final GameObjectContainer<GameObject, MapArchObject, Archetype> gameObject = gameObjectCreator.newGameObject(0); + for (final int elevation : elevations) { + gameObject.addLast(gameObjectCreator.newGameObject(elevation)); + } + return gameObject; + } + + /** + * Returns the game object at a given index. + * @param gameObjects the game objects to search + * @param index the index + * @return the game object at <code>index</code> + */ + @NotNull + private static GameObject get(@NotNull final Iterable<GameObject> gameObjects, final int index) { + int left = index; + for (final GameObject gameObject : gameObjects) { + if (left == 0) { + return gameObject; + } + left--; + } + + Assert.fail("index " + index + " not found"); + throw new AssertionError(); + } + + /** + * Checks some game objects for expected elevation values. + * @param gameObjects the game objects + * @param elevation the expected elevation value for the first game object + */ + private static void check(@NotNull final Iterable<GameObject> gameObjects, final int... elevation) { + int i = 0; + for (final GameObject gameObject : gameObjects) { + final int thisElevation = gameObject.getAttributeInt(GameObject.ELEVATION); + final int expectedElevation = i < elevation.length ? elevation[i] : 0; + Assert.assertEquals(gameObject.getBestName(), expectedElevation, thisElevation); + i++; + } + } + +} // class PropagateElevationTest Property changes on: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/PropagateElevationTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/crossfire.iml =================================================================== --- trunk/crossfire.iml 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/crossfire.iml 2010-06-03 23:00:42 UTC (rev 8088) @@ -11,6 +11,9 @@ </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module" module-name="gridarta" /> + <orderEntry type="module" module-name="utils" /> + <orderEntry type="module" module-name="preferences" /> <orderEntry type="module-library"> <library> <CLASSES> @@ -20,9 +23,6 @@ <SOURCES /> </library> </orderEntry> - <orderEntry type="module" module-name="gridarta" /> - <orderEntry type="module" module-name="utils" /> - <orderEntry type="module" module-name="preferences" /> <orderEntry type="module-library"> <library> <CLASSES> @@ -35,6 +35,15 @@ <orderEntry type="module-library"> <library> <CLASSES> + <root url="jar://$MODULE_DIR$/lib/junit-4.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library"> + <library> + <CLASSES> <root url="jar://$MODULE_DIR$/lib/jdom.jar!/" /> </CLASSES> <JAVADOC /> Modified: trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -139,9 +139,12 @@ public void remove() { // keep this in sync with GameObjectContainer#remove(G) // we can't simply invoke GameObjectContainer#remove(current) because that would result in a ConcurrentModificationException. - delegate.remove(); notifyBeginChange(); try { + if (contents.size() >= 2 && contents.get(0) == current) { + contents.get(1).propagateElevation(current); + } + delegate.remove(); current.setContainer(null, 0, 0); } finally { notifyEndChange(); @@ -244,12 +247,12 @@ * @fixme this implementation does not take care of multi square objects. */ public void remove(@NotNull final G gameObject) { + // keep this in sync with iterator() notifyBeginChange(); try { if (contents.size() >= 2 && contents.get(0) == gameObject) { contents.get(1).propagateElevation(gameObject); } - // keep this in sync with iterator() if (!contents.remove(gameObject)) { throw new NotInsideContainerException(this, gameObject); } @@ -473,6 +476,9 @@ int index = 0; for (final G tmpGameObject : contents) { if (tmpGameObject.getHead() == previousGameObject) { + if (index == 0) { + gameObject.propagateElevation(contents.get(0)); + } contents.add(index, gameObject); added = true; break; @@ -491,25 +497,31 @@ /** * Add a GameObject before another. * @param gameObject GameObject to insert - * @param nextGameObject nextGameObject anchor + * @param nextGameObject nextGameObject anchor or <code>null</code> to add + * first * @throws IllegalArgumentException if <var>gameObject</var> already is * inside another container or <var>prev</var> isn't inside this container */ - public void insertBefore(@NotNull final G gameObject, @NotNull final G nextGameObject) { + public void insertBefore(@NotNull final G gameObject, @Nullable final G nextGameObject) { if (gameObject.isInContainer()) { throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because it's already inside " + gameObject.getContainer()); } + if (nextGameObject == null) { + addFirst(gameObject); + return; + } + + if (!nextGameObject.isHead()) { + throw new IllegalArgumentException(); + } + notifyBeginChange(); try { final int insertIndex = contents.indexOf(nextGameObject); if (insertIndex == -1) { throw new IllegalArgumentException("Can't insert " + gameObject + " before " + nextGameObject + " because that isn't inside " + this); } - if (insertIndex == 0) { - assert contents.size() >= 1; - gameObject.propagateElevation(contents.get(0)); - } contents.add(insertIndex + 1, gameObject); setThisContainer(gameObject); } finally { @@ -625,7 +637,7 @@ * An iterator for iterating over a list in reverse order. * @todo move this class to JAPI */ - private static class ReverseIterator<T> implements Iterator<T> { + private static class ReverseIterator<T extends GameObject<?, ?, ?>> implements Iterator<T> { /** * The iterator used for delegation. @@ -634,10 +646,17 @@ private final ListIterator<T> delegate; /** + * The list being iterated over. + */ + @NotNull + private final List<T> list; + + /** * Create a reverse iterator. * @param list to iterate over in reverse order */ private ReverseIterator(@NotNull final List<T> list) { + this.list = list; delegate = list.listIterator(list.size()); } @@ -665,6 +684,9 @@ */ @Override public void remove() { + if (delegate.nextIndex() == 0 && list.size() >= 2) { + list.get(1).propagateElevation(list.get(0)); + } delegate.remove(); } Modified: trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -91,7 +91,7 @@ * {@inheritDoc} */ @Override - public void propagateElevation(@NotNull final BaseObject<G, A, R, ?> gameObject) { + public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { } /** Modified: trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/src/app/net/sf/gridarta/model/gameobject/GameObject.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -79,7 +79,7 @@ * If there is elevation data in the other game object, move it to here. * @param gameObject the other game object */ - void propagateElevation(@NotNull BaseObject<G, A, R, ?> gameObject); + void propagateElevation(@NotNull BaseObject<?, ?, ?, ?> gameObject); /** * {@inheritDoc} The Iterator returned does not recurse, it only contains Modified: trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java =================================================================== --- trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java 2010-06-03 22:38:31 UTC (rev 8087) +++ trunk/src/test/net/sf/gridarta/model/gameobject/TestGameObject.java 2010-06-03 23:00:42 UTC (rev 8088) @@ -83,7 +83,7 @@ * {@inheritDoc} */ @Override - public void propagateElevation(@NotNull final BaseObject<TestGameObject, TestMapArchObject, TestArchetype, ?> gameObject) { + public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { // ignore } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-03 22:38:37
|
Revision: 8087 http://gridarta.svn.sourceforge.net/gridarta/?rev=8087&view=rev Author: akirschbaum Date: 2010-06-03 22:38:31 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Add @NotNull annotations. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java Modified: trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 20:41:36 UTC (rev 8086) +++ trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 22:38:31 UTC (rev 8087) @@ -590,7 +590,7 @@ // writeObject() is not required because this class doesn't require special handling during serialization. - private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { + private void readObject(@NotNull final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); // initialize transients initData(); @@ -637,7 +637,7 @@ * Create a reverse iterator. * @param list to iterate over in reverse order */ - private ReverseIterator(final List<T> list) { + private ReverseIterator(@NotNull final List<T> list) { delegate = list.listIterator(list.size()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-06-03 20:41:43
|
Revision: 8086 http://gridarta.svn.sourceforge.net/gridarta/?rev=8086&view=rev Author: akirschbaum Date: 2010-06-03 20:41:36 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Rename parameter names. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java Modified: trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java =================================================================== --- trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 20:39:09 UTC (rev 8085) +++ trunk/src/app/net/sf/gridarta/model/baseobject/GameObjectContainer.java 2010-06-03 20:41:36 UTC (rev 8086) @@ -448,18 +448,18 @@ * Add a GameObject after another. * @param previousGameObject previous anchor or <code>null</code> to insert * last - * @param newGameObject GameObject to insert - * @throws IllegalArgumentException if <var>newGameObject</var> already is + * @param gameObject GameObject to insert + * @throws IllegalArgumentException if <var>gameObject</var> already is * inside another container or <var>previousGameObject</var> isn't inside * this container */ - public void insertAfter(@Nullable final G previousGameObject, @NotNull final G newGameObject) { - if (newGameObject.isInContainer()) { - throw new IllegalArgumentException("Can't add " + newGameObject + " to " + this + " because it's already inside " + newGameObject.getContainer()); + public void insertAfter(@Nullable final G previousGameObject, @NotNull final G gameObject) { + if (gameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because it's already inside " + gameObject.getContainer()); } if (previousGameObject == null) { - addLast(newGameObject); + addLast(gameObject); return; } @@ -473,16 +473,16 @@ int index = 0; for (final G tmpGameObject : contents) { if (tmpGameObject.getHead() == previousGameObject) { - contents.add(index, newGameObject); + contents.add(index, gameObject); added = true; break; } index++; } if (!added) { - throw new IllegalArgumentException("Can't add " + newGameObject + " to " + this + " because " + previousGameObject + " is not inside"); + throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because " + previousGameObject + " is not inside"); } - setThisContainer(newGameObject); + setThisContainer(gameObject); } finally { notifyEndChange(); } @@ -490,28 +490,28 @@ /** * Add a GameObject before another. - * @param newGameObject GameObject to insert + * @param gameObject GameObject to insert * @param nextGameObject nextGameObject anchor * @throws IllegalArgumentException if <var>gameObject</var> already is * inside another container or <var>prev</var> isn't inside this container */ - public void insertBefore(@NotNull final G newGameObject, @NotNull final G nextGameObject) { - if (newGameObject.isInContainer()) { - throw new IllegalArgumentException("Can't add " + newGameObject + " to " + this + " because it's already inside " + newGameObject.getContainer()); + public void insertBefore(@NotNull final G gameObject, @NotNull final G nextGameObject) { + if (gameObject.isInContainer()) { + throw new IllegalArgumentException("Can't add " + gameObject + " to " + this + " because it's already inside " + gameObject.getContainer()); } notifyBeginChange(); try { final int insertIndex = contents.indexOf(nextGameObject); if (insertIndex == -1) { - throw new IllegalArgumentException("Can't insert " + newGameObject + " before " + nextGameObject + " because that isn't inside " + this); + throw new IllegalArgumentException("Can't insert " + gameObject + " before " + nextGameObject + " because that isn't inside " + this); } if (insertIndex == 0) { assert contents.size() >= 1; - newGameObject.propagateElevation(contents.get(0)); + gameObject.propagateElevation(contents.get(0)); } - contents.add(insertIndex + 1, newGameObject); - setThisContainer(newGameObject); + contents.add(insertIndex + 1, gameObject); + setThisContainer(gameObject); } finally { notifyEndChange(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |